aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-04 19:16:32 +0200
committerAdrian Kummerlaender2018-05-04 19:16:32 +0200
commit74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d (patch)
treeac6e2e20929f24ef9653e7d8eb331a1813719e98
parent980d05929791e5f9920294f937cbeaa5e6bd31ba (diff)
downloadnixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar.gz
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar.bz2
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar.lz
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar.xz
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.tar.zst
nixos_home-74951f7eb0d8914201a5a4fa1b534abfe0ecfa0d.zip
Add support for large drop-down scratchpads to XMonad
-rw-r--r--conf/xmonad/xmonad.hs40
1 files changed, 22 insertions, 18 deletions
diff --git a/conf/xmonad/xmonad.hs b/conf/xmonad/xmonad.hs
index bea9bd2..f42ec34 100644
--- a/conf/xmonad/xmonad.hs
+++ b/conf/xmonad/xmonad.hs
@@ -48,22 +48,26 @@ availableLayouts = smartBorders $ tabs ||| tilesLM ||| tilesRM ||| tilesTM ||| t
windowBringerDmenuConfig = def { menuCommand = "rofi"
, menuArgs = [ "-p", "win", "-dmenu", "-i" ] }
-floatRectFull = hideScreenBorder $ RationalRect 0 0 1 1
-floatRectLarge = hideScreenBorder $ RationalRect (1/20) (1/20) (18/20) (18/20)
-floatRectCenter = hideScreenBorder $ RationalRect (1/6) (1/6) (2/3) (2/3)
-floatRectBottom = hideScreenBorder $ RationalRect (1/20) (1/3) (18/20) (2/3)
-floatRectTop = hideScreenBorder $ RationalRect (1/20) 0 (18/20) (2/3)
-floatRectLeft = hideScreenBorder $ RationalRect 0 (1/20) (1/2) (18/20)
-floatRectRight = hideScreenBorder $ RationalRect (1/2) (1/20) (1/2) (18/20)
+floatRectTop h = hideScreenBorder $ RationalRect (1/20) 0 (18/20) h
+floatRectBottom h = hideScreenBorder $ RationalRect (1/20) (1-h) (18/20) h
+floatRectLeft w = hideScreenBorder $ RationalRect 0 (1/20) w (18/20)
+floatRectRight w = hideScreenBorder $ RationalRect (1-w) (1/20) w (18/20)
+
+dropUp = floatRectBottom $ 2/3
+dropUpLarge = floatRectBottom $ 18/20
+dropDown = floatRectTop $ 2/3
+dropDownLarge = floatRectTop $ 18/20
+sideBarLeft = floatRectLeft $ 1/2
+sideBarRight = floatRectRight $ 1/2
scratchpads = [ NS "terminal" "kitty --class=scratchterm" (className =? "scratchterm")
- (customFloating floatRectTop)
+ (customFloating dropDown)
, NS "browser" "firefox" (className =? "Firefox")
- (customFloating floatRectTop)
+ (customFloating dropDown)
, NS "documentation" "zeal" (className =? "Zeal")
- (customFloating floatRectLarge)
+ (customFloating dropDown)
, NS "messaging" "telegram-desktop" (className =? "TelegramDesktop")
- (customFloating floatRectRight) ]
+ (customFloating sideBarRight) ]
keybindings =
-- xmonad session control
@@ -103,13 +107,13 @@ keybindings =
, ("M-S-s k" , shiftTo Prev nonEmptyWS >> moveTo Prev nonEmptyWS)
-- floating placement
, ("M-w t" , withFocused $ windows . sink)
- , ("M-w f" , withFocused $ placeFloating floatRectFull )
- , ("M-w S-c" , withFocused $ placeFloating floatRectLarge)
- , ("M-w c" , withFocused $ placeFloating floatRectCenter)
- , ("M-w j" , withFocused $ placeFloating floatRectBottom)
- , ("M-w k" , withFocused $ placeFloating floatRectTop)
- , ("M-w h" , withFocused $ placeFloating floatRectLeft)
- , ("M-w l" , withFocused $ placeFloating floatRectRight)
+ , ("M-w f" , withFocused $ placeFloating $ RationalRect 0 0 1 1)
+ , ("M-w j" , withFocused $ placeFloating dropUp)
+ , ("M-w S-j" , withFocused $ placeFloating dropUpLarge)
+ , ("M-w k" , withFocused $ placeFloating dropDown)
+ , ("M-w S-k" , withFocused $ placeFloating dropDownLarge)
+ , ("M-w h" , withFocused $ placeFloating sideBarLeft)
+ , ("M-w l" , withFocused $ placeFloating sideBarRight)
-- system control
, ("M-c <Up>" , spawn "amixer sset Master 10%+")
, ("M-c <Down>" , spawn "amixer sset Master 10%-")