about summary refs log tree commit diff
path: root/src/XMonad/Custom/Manage.hs
blob: deffa3ba882e8c4299beebd5e1548d4ff6e5fe03 (plain) (blame)
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
-- |
-- Module      : XMonad.Custom.Manage
-- Copyright   : (c) 2018-2020 Azat Bahawi <azahi@teknik.io>
-- License     : BSD3-style (see LICENSE)
-- Maintainer  : Azat Bahawi <azahi@teknik.io>
-- Stability   : unstable
-- Portability : unportable
--

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