-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmonad.hs
66 lines (60 loc) · 3.1 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
import XMonad hiding (Tall(..))
import qualified XMonad.StackSet as W
import XMonad.Actions.CopyWindow
import XMonad.Layout.Tabbed
import XMonad.Layout.HintedTile
import XMonad.Layout.NoBorders
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat)
import XMonad.Hooks.EwmhDesktops
import XMonad.Prompt
import XMonad.Actions.SpawnOn
import XMonad.Util.SpawnOnce
import XMonad.Layout.LayoutScreens
import XMonad.Layout.TwoPane
import Data.List (isPrefixOf)
import qualified Data.Map as M
import Graphics.X11.ExtraTypes.XF86 (xF86XK_AudioLowerVolume, xF86XK_AudioRaiseVolume, xF86XK_AudioMute)
main = xmonad . docks . ewmh $ defaultConfig
{ terminal = "gnome-terminal"
, workspaces = ["irc", "web"] ++ map show [3 .. 8 :: Int] ++ ["tv"]
, mouseBindings = \(XConfig {modMask = modm}) -> M.fromList $
[ ((modm, button1), (\w -> focus w >> mouseMoveWindow w))
, ((modm, button2), (\w -> focus w >> windows W.swapMaster))
, ((modm.|. shiftMask, button1), (\w -> focus w >> mouseResizeWindow w)) ]
, keys = \c -> mykeys c `M.union` keys defaultConfig c
, layoutHook = modifiers layouts
, manageHook = manageHook defaultConfig
<+> manageSpawn
<+> (isFullscreen --> doFullFloat)
<+> (className =? "Kodi" --> doShift "tv")
-- float chrome extension windows, mainly for hangouts popups
<+> (isPrefixOf "crx_" <$> appName --> doFloat)
}
where
tiled = HintedTile 1 0.03 0.5 TopLeft
layouts = (tiled Tall ||| (tiled Wide ||| Full)) ||| tabbed shrinkText myTheme
modifiers = avoidStruts . smartBorders
mykeys (XConfig {modMask = modm}) = M.fromList $
[((modm, xK_p ), shellPromptHere myPromptConfig)
,((modm .|. shiftMask, xK_Return), spawnHere =<< asks (terminal . config))
,((modm .|. shiftMask, xK_c ), kill1)
,((modm .|. shiftMask .|. controlMask, xK_c ), kill)
,((modm .|. shiftMask, xK_0 ), windows $ copyToAll)
,((modm, xK_z ), layoutScreens 2 $ TwoPane 0.5 0.5)
,((modm .|. shiftMask, xK_z ), rescreen)
,((modm, xK_b ), sendMessage ToggleStruts)
,((modm .|. shiftMask, xK_l ), spawn "systemctl suspend")
,((0, xF86XK_AudioLowerVolume), spawn "pactl set-sink-volume alsa_output.usb-SteelSeries_SteelSeries_Arctis_7-00.stereo-game -5%")
,((0, xF86XK_AudioRaiseVolume), spawn "pactl set-sink-volume alsa_output.usb-SteelSeries_SteelSeries_Arctis_7-00.stereo-game +5%")
,((0, xF86XK_AudioMute), spawn "pactl set-sink-mute alsa_output.usb-SteelSeries_SteelSeries_Arctis_7-00.stereo-game toggle")
]
myFont = "xft:Bitstream Vera Sans Mono:pixelsize=10"
myTheme = def { fontName = myFont }
myPromptConfig = def
{ position = Top
, font = myFont
, showCompletionOnTab = True
, historyFilter = deleteConsecutive
, promptBorderWidth = 0 }