aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@josher.dev>2026-04-02 18:54:41 -0600
committerJosh Rahm <rahm@josher.dev>2026-04-02 18:54:41 -0600
commit65c68092cbccc2c54ea792b6d09f643edbebd4de (patch)
tree264336230a6d318aaf20290a3b711da690c6ee5b /src/Main.hs
parentfab982243798b2900796b2ca308df345626cdbef (diff)
downloadrde-65c68092cbccc2c54ea792b6d09f643edbebd4de.tar.gz
rde-65c68092cbccc2c54ea792b6d09f643edbebd4de.tar.bz2
rde-65c68092cbccc2c54ea792b6d09f643edbebd4de.zip
Commits specific to my yoga thinkpad.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
index e6bced1..be77b34 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -125,6 +125,7 @@ main = do
className =? "zenity" --> doCenterFloat,
className =? "gnuplot_qt" --> doCenterFloat,
className =? "Yad" --> doCenterFloat,
+ className =? "XVkbd" --> doBottomFloat,
className =? "Xfce4-notifyd" --> doIgnore,
className =? "popup-terminal" --> doShift "*" <> updatePopupTerminalHook,
className =? "spotify" --> doShift "s",
@@ -204,6 +205,16 @@ doCenterFloat =
centerRect :: W.RationalRect -> W.RationalRect
centerRect (W.RationalRect x y w h) = W.RationalRect ((1 - w) / 2) ((1 - h) / 2) w h
+doBottomFloat :: ManageHook
+doBottomFloat =
+ ask >>= \w -> doF . W.float w . bottomRect . snd =<< liftX (floatLocation w)
+
+bottomRect :: W.RationalRect -> W.RationalRect
+bottomRect (W.RationalRect _ _ w h) =
+ let h' = min 1 (2 * h)
+ w' = min 1 (2 * w)
+ in W.RationalRect ((1 - w') / 2) (1 - h') w' h'
+
windowHooks :: WindowHook -> XConfig l -> XConfig l
windowHooks (Query readerT) config = do
config