From 3cd06b22069c009b8c5fea2d5fad5f996667d2e3 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Tue, 16 Aug 2022 01:46:04 +0300 Subject: huge update-o --- src/lib/XMonad/Custom/Startup.hs | 52 ++++++---------------------------------- 1 file changed, 7 insertions(+), 45 deletions(-) (limited to 'src/lib/XMonad/Custom/Startup.hs') diff --git a/src/lib/XMonad/Custom/Startup.hs b/src/lib/XMonad/Custom/Startup.hs index 935d08f..3c9379e 100644 --- a/src/lib/XMonad/Custom/Startup.hs +++ b/src/lib/XMonad/Custom/Startup.hs @@ -1,58 +1,20 @@ -- | -- Module : XMonad.Custom.Startup -- Description : Startup hooks --- Copyright : (c) Azat Bahawi 2018-2021 +-- Copyright : (c) Azat Bahawi 2018-2022 -- SPDX-License-Identifier : GPL-3.0-or-later --- Maintainer : azahi@teknik.io +-- Maintainer : azat@bahawi.net -- Stability : experimental -- Portability : non-portable -- module XMonad.Custom.Startup - ( startupHook + ( ngStartupHook ) where -import Control.Monad -import Data.Maybe -import XMonad hiding ( startupHook ) -import XMonad.Hooks.ManageDocks -import XMonad.Hooks.SetWMName -import XMonad.Util.Cursor -import XMonad.Util.SpawnNamedPipe +import XMonad ( X ) +import XMonad.Hooks.SetWMName ( setWMName ) -atomsToFullscreen :: [String] -atomsToFullscreen = - [ "_NET_ACTIVE_WINDOW" - , "_NET_CLIENT_LIST" - , "_NET_CLIENT_LIST_STACKING" - , "_NET_DESKTOP_NAMES" - , "_NET_WM_DESKTOP" - , "_NET_WM_STATE" - , "_NET_WM_STATE_FULLSCREEN" - , "_NET_WM_STATE_HIDDEN" - , "_NET_WM_STRUT" - ] - -addNETSupported :: Atom -> X () -addNETSupported x = withDisplay $ \d -> do - r <- asks theRoot - n <- getAtom "_NET_SUPPORTED" - a <- getAtom "ATOM" - liftIO $ do - p <- join . maybeToList <$> getWindowProperty32 d n r - when (fromIntegral x `notElem` p) - $ changeProperty32 d r n a propModeAppend [fromIntegral x] - -addEWMHFullscreen :: X () -addEWMHFullscreen = do - s <- mapM getAtom atomsToFullscreen - mapM_ addNETSupported s - -startupHook :: X () -startupHook = do - -- spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/top.hs" "xmobarTop" - -- spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/bot.hs" "xmobarBot" - docksStartupHook - addEWMHFullscreen - setDefaultCursor xC_left_ptr +ngStartupHook :: X () +ngStartupHook = do setWMName "xmonad" -- cgit 1.4.1