tv xmonad: use ewmhExtra
This commit is contained in:
parent
fd90f35fd9
commit
19cfdf9a22
@ -5,16 +5,15 @@ module Main (main) where
|
|||||||
|
|
||||||
import System.Exit (exitFailure)
|
import System.Exit (exitFailure)
|
||||||
import XMonad.Hooks.EwmhDesktops (ewmh)
|
import XMonad.Hooks.EwmhDesktops (ewmh)
|
||||||
|
import XMonad.Hooks.EwmhDesktops.Extra (ewmhExtra)
|
||||||
import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, toggleFocus)
|
import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, toggleFocus)
|
||||||
|
|
||||||
import Control.Exception
|
|
||||||
import Control.Monad.Extra (whenJustM)
|
import Control.Monad.Extra (whenJustM)
|
||||||
import qualified Data.Aeson
|
import qualified Data.Aeson
|
||||||
import qualified Data.ByteString.Char8
|
import qualified Data.ByteString.Char8
|
||||||
import qualified Data.List
|
import qualified Data.List
|
||||||
import qualified Data.Maybe
|
import qualified Data.Maybe
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
import Graphics.X11.ExtraTypes.XF86
|
||||||
import Text.Read (readEither)
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Extra (isFloatingX)
|
import XMonad.Extra (isFloatingX)
|
||||||
import System.IO (hPutStrLn, stderr)
|
import System.IO (hPutStrLn, stderr)
|
||||||
@ -76,11 +75,10 @@ mainNoArgs = do
|
|||||||
myTermFont <- getEnv "XMONAD_TERM_FONT"
|
myTermFont <- getEnv "XMONAD_TERM_FONT"
|
||||||
myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension
|
myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension
|
||||||
myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension
|
myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension
|
||||||
workspaces0 <- getWorkspaces0
|
|
||||||
handleShutdownEvent <- newShutdownEventHandler
|
handleShutdownEvent <- newShutdownEventHandler
|
||||||
let
|
config <-
|
||||||
config =
|
ewmhExtra
|
||||||
ewmh
|
$ ewmh
|
||||||
$ withUrgencyHookC
|
$ withUrgencyHookC
|
||||||
BorderUrgencyHook
|
BorderUrgencyHook
|
||||||
{ urgencyBorderColor = "#ff0000"
|
{ urgencyBorderColor = "#ff0000"
|
||||||
@ -93,7 +91,6 @@ mainNoArgs = do
|
|||||||
{ terminal = {-pkg:alacritty-tv-}"alacritty"
|
{ terminal = {-pkg:alacritty-tv-}"alacritty"
|
||||||
, modMask = mod4Mask
|
, modMask = mod4Mask
|
||||||
, keys = myKeys myTermFont
|
, keys = myKeys myTermFont
|
||||||
, workspaces = workspaces0
|
|
||||||
, layoutHook =
|
, layoutHook =
|
||||||
refocusLastLayoutHook $
|
refocusLastLayoutHook $
|
||||||
gaps (zip [U,R,D,L] myScreenGaps) $
|
gaps (zip [U,R,D,L] myScreenGaps) $
|
||||||
@ -125,23 +122,6 @@ mainNoArgs = do
|
|||||||
launch config directories
|
launch config directories
|
||||||
|
|
||||||
|
|
||||||
getWorkspaces0 :: IO [String]
|
|
||||||
getWorkspaces0 =
|
|
||||||
try (getEnv "XMONAD_WORKSPACES0_FILE") >>= \case
|
|
||||||
Left e -> warn (displaySomeException e)
|
|
||||||
Right p -> try (readFile p) >>= \case
|
|
||||||
Left e -> warn (displaySomeException e)
|
|
||||||
Right x -> case readEither x of
|
|
||||||
Left e -> warn e
|
|
||||||
Right y -> return y
|
|
||||||
where
|
|
||||||
warn msg = hPutStrLn stderr ("getWorkspaces0: " ++ msg) >> return []
|
|
||||||
|
|
||||||
|
|
||||||
displaySomeException :: SomeException -> String
|
|
||||||
displaySomeException = displayException
|
|
||||||
|
|
||||||
|
|
||||||
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
|
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
|
||||||
forkFile path args env =
|
forkFile path args env =
|
||||||
xfork (executeFile path True args env) >> return ()
|
xfork (executeFile path True args env) >> return ()
|
||||||
|
Loading…
Reference in New Issue
Block a user