Skip to content

Commit

Permalink
Add emwh above/sticky hook
Browse files Browse the repository at this point in the history
  • Loading branch information
TimenZan committed Jan 9, 2025
1 parent d741d6f commit 9b68d90
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xmonad/.config/xmonad/xmonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ import XMonad.Util.SpawnOnce (spawnOnOnce, spawnOnce)
import XMonad.Util.Themes

import Graphics.X11.ExtraTypes.XF86
import XMonad.Actions.CopyWindow (copyToAll)
import XMonad.Util.WindowProperties (getProp32)

-- The command to lock the screen or show the screensaver.
myScreensaver :: String
Expand Down Expand Up @@ -282,9 +284,21 @@ myManageHook =
, moveC "discord" "2"
, moveC "Steam" "9"
, isFullscreen --> (doF W.focusDown <+> doFullFloat)
, hasNetWMState "_NET_WM_STATE_ABOVE" --> doFloat
, hasNetWMState "_NET_WM_STATE_STICKY" --> doF copyToAll
]
where
moveC c w = className =? c --> doShift w
getNetWMState :: Window -> X [Atom]
getNetWMState w = do
atom <- getAtom "_NET_WM_STATE"
maybe [] (map fromIntegral) <$> getProp32 atom w
hasNetWMState :: String -> Query Bool
hasNetWMState state_net = do
window <- ask
wmstate <- liftX $ getNetWMState window
atom <- liftX $ getAtom state_net
return $ elem atom wmstate

desktopStartupHook = do
spawnOnOnce "9" "nice qbittorrent"
Expand Down

0 comments on commit 9b68d90

Please sign in to comment.