-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmonad.hs
92 lines (80 loc) · 3.29 KB
/
xmonad.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import System.IO
import XMonad
import XMonad.Actions.WindowGo
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe,runInTerm)
import XMonad.Util.EZConfig
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ResizableTile
import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
import XMonad.Layout.TwoPane
import XMonad.Layout.Named
import XMonad.Layout.NoBorders
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.SimplestFloat
import qualified XMonad.Layout.MultiToggle as MT
import XMonad.Layout.MultiToggle.Instances
import qualified XMonad.Layout.Fullscreen as FS
import Graphics.X11.ExtraTypes.XF86
colorBlue = "#857da9"
colorGreen = "#88b986"
colorGray = "#676767"
colorWhite = "#d3d7cf"
colorGrayAlt = "#313131"
colorNormalbg = "#1a1e1b"
baseConfig = desktopConfig
main :: IO()
main = do
statusBar <- spawnPipe myStatusBar
xmonad $ FS.fullscreenSupport $ ewmh defaultConfig
{ terminal = "urxvtc"
, modMask = myModMask
, borderWidth = 4
, normalBorderColor = "#262626"
, focusedBorderColor = "#aaaaaa"
, logHook = myLogHook statusBar
, workspaces = myWorkspaces
, startupHook = setWMName "LG3D"
, layoutHook = avoidStruts layout
, manageHook = manageDocks <+> mymanageHook <+> raiseHook
, handleEventHook = docksEventHook <+> fullscreenEventHook
}
`additionalKeys`
[ ((0 , xF86XK_AudioMute), spawn "/home/haneta/.local/bin/mute-toggle.sh")
, ((0 , xF86XK_AudioRaiseVolume), spawn "/home/haneta/.local/bin/volume-change.sh '+'")
, ((0 , xF86XK_AudioLowerVolume), spawn "/home/haneta/.local/bin/volume-change.sh '-'")
]
`additionalKeysP`
[ ("M-c", runOrRaise "google-chrome-stable" (className =? "Google-chrome"))
, ("M-<Return>", spawn "urxvtc")
, ("M-S-<Return>", spawn "urxvtc -g 90x30 -name 'urxvt-float'")
, ("M-8", spawn "xbacklight - 10")
, ("M-9", spawn "xbacklight + 10")
, ("M-f", sendMessage $ MT.Toggle NBFULL)
, ("M-S-f", withFocused float)
, ("M-S-h", sendMessage MirrorShrink)
, ("M-S-l", sendMessage MirrorExpand)
]
toggleStrutsKey XConfig { XMonad.modMask = modMask } = ( modMask, xK_b )
myModMask = mod4Mask
myStatusBar = "xmobar $HOME/.xmonad/xmobarrc"
myLogHook h = dynamicLogWithPP $ mySBPP { ppOutput = hPutStrLn h }
myWorkspaces = [ "1", "2", "3", "4", "5" ]
mySBPP = xmobarPP { ppCurrent = xmobarColor "#f0c674" "#1d1f21"
, ppTitle = xmobarColor "#8abeb7" "#1d1f21" }
myLayout = MT.mkToggle1 NBFULL $ smartBorders
$ (( named "RTall" $ spacing ( ResizableTall 1 (3/100) (1/2) [] ))
||| ( named "TwoPane" $ spacing (TwoPane (3/100) (1/2)) ))
where
spacing = smartSpacing 6 . gaps [(U, 4), (D, 4), (L, 4), (R, 4)]
layout = toggleLayouts (noBorders Full) $ onWorkspace "5" simplestFloat $ myLayout
mymanageHook = composeAll [ isFullscreen --> doFullFloat
, isDialog --> doCenterFloat
, title =? "urxvt-float" --> doSideFloat SC
, className =? "mpv" --> doCenterFloat ]