tv xmonad: make XMONAD_STARTUP_HOOK optional
This commit is contained in:
parent
51a520b3a5
commit
2409647272
@ -3,6 +3,7 @@ pkgs.writeHaskell "xmonad-tv" {
|
|||||||
executables.xmonad = {
|
executables.xmonad = {
|
||||||
extra-depends = [
|
extra-depends = [
|
||||||
"containers"
|
"containers"
|
||||||
|
"extra"
|
||||||
"unix"
|
"unix"
|
||||||
"X11"
|
"X11"
|
||||||
"xmonad"
|
"xmonad"
|
||||||
@ -19,11 +20,12 @@ pkgs.writeHaskell "xmonad-tv" {
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
|
import Control.Monad.Extra (whenJustM)
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
import Graphics.X11.ExtraTypes.XF86
|
||||||
import Text.Read (readEither)
|
import Text.Read (readEither)
|
||||||
import XMonad
|
import XMonad
|
||||||
import System.IO (hPutStrLn, stderr)
|
import System.IO (hPutStrLn, stderr)
|
||||||
import System.Environment (getArgs, withArgs, getEnv, getEnvironment)
|
import System.Environment (getArgs, withArgs, getEnv, getEnvironment, lookupEnv)
|
||||||
import System.Posix.Process (executeFile)
|
import System.Posix.Process (executeFile)
|
||||||
import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
|
import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
|
||||||
, removeEmptyWorkspace)
|
, removeEmptyWorkspace)
|
||||||
@ -84,9 +86,9 @@ mainNoArgs = do
|
|||||||
-- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
|
-- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
|
||||||
--, handleEventHook = handleTimerEvent
|
--, handleEventHook = handleTimerEvent
|
||||||
, manageHook = placeHook (smart (1,0)) <+> floatNextHook
|
, manageHook = placeHook (smart (1,0)) <+> floatNextHook
|
||||||
, startupHook = do
|
, startupHook =
|
||||||
path <- liftIO (getEnv "XMONAD_STARTUP_HOOK")
|
whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK"))
|
||||||
forkFile path [] Nothing
|
(\path -> forkFile path [] Nothing)
|
||||||
, normalBorderColor = "#1c1c1c"
|
, normalBorderColor = "#1c1c1c"
|
||||||
, focusedBorderColor = "#f000b0"
|
, focusedBorderColor = "#f000b0"
|
||||||
, handleEventHook = handleShutdownEvent
|
, handleEventHook = handleShutdownEvent
|
||||||
|
Loading…
Reference in New Issue
Block a user