about summary refs log tree commit diff
path: root/src/lib/XMonad/Custom/Manage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/XMonad/Custom/Manage.hs')
-rw-r--r--src/lib/XMonad/Custom/Manage.hs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/lib/XMonad/Custom/Manage.hs b/src/lib/XMonad/Custom/Manage.hs
new file mode 100644
index 0000000..dbc560e
--- /dev/null
+++ b/src/lib/XMonad/Custom/Manage.hs
@@ -0,0 +1,54 @@
+-- |
+-- Module                  : XMonad.Custom.Manage
+-- Description             : Window management hooks and scratchpads
+-- Copyright               : (c) Azat Bahawi 2018-2021
+-- SPDX-License-Identifier : GPL-3.0-or-later
+-- Maintainer              : azahi@teknik.io
+-- Stability               : experimental
+-- Portability             : non-portable
+--
+
+module XMonad.Custom.Manage
+  ( manageHook
+  ) where
+
+import           XMonad                  hiding ( manageHook )
+import           XMonad.Custom.Scratchpads
+import           XMonad.Hooks.InsertPosition
+import           XMonad.Hooks.ManageDocks
+import           XMonad.Hooks.ManageHelpers
+import           XMonad.Layout.Fullscreen
+import           XMonad.Util.NamedScratchpad
+
+composeActions :: [MaybeManageHook]
+composeActions =
+  [ appName =? "emacs-popup" -?> tileBelowNoFocus
+  , appName =? "eterm" -?> tileBelow
+  , className =? "Pinentry" -?> doCenterFloat
+  , className =? "Steam" <&&> not <$> title =? "Steam" -?> doFloat
+  , className =? "Xmessage" -?> doCenterFloat
+  , className =? "Zenity" -?> doCenterFloat
+  , className =? "explorer.exe" -?> doFullFloat
+  , className =? "qemu-system-x86" -?> doCenterFloat
+  , className =? "qemu-system-x86_64" -?> doCenterFloat
+  , className =? "urxvt" -?> tileBelow
+  , className =? "xterm" -?> tileBelow
+  , isDialog -?> doCenterFloat
+  , isFullscreen -?> doFullFloat
+  , pure True -?> tileNormal
+  , stringProperty "WM_WINDOW_ROLE" =? "pop-up" -?> doCenterFloat
+  , stringProperty "WM_WINDOW_ROLE" =? "GtkFileChooserDialog" -?> doCenterFloat
+  , transience
+  ]
+ where
+  tileNormal       = insertPosition Above Newer
+  tileBelow        = insertPosition Below Newer
+  tileBelowNoFocus = insertPosition Below Older
+
+manageHook :: ManageHook
+manageHook = mconcat
+  [ manageDocks
+  , fullscreenManageHook
+  , namedScratchpadManageHook scratchpads
+  , composeOne composeActions
+  ]

Consider giving Nix/NixOS a try! <3