summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tv/2configs/xserver/default.nix5
-rw-r--r--tv/5pkgs/xmonad-tv.nix42
2 files changed, 25 insertions, 22 deletions
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index 08b69067c..51e243284 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -99,11 +99,6 @@ let
xmonad-start = pkgs.writeScriptBin "xmonad" ''
#! ${pkgs.bash}/bin/bash
set -efu
- export PATH; PATH=${makeSearchPath "bin" [
- # TODO put paths into a Haskell module instead of PATH
- pkgs.alsaUtils
- pkgs.rxvt_unicode
- ]}:/var/setuid-wrappers
settle() {(
# Use PATH for a clean journal
command=''${1##*/}
diff --git a/tv/5pkgs/xmonad-tv.nix b/tv/5pkgs/xmonad-tv.nix
index 086fd911e..794d90688 100644
--- a/tv/5pkgs/xmonad-tv.nix
+++ b/tv/5pkgs/xmonad-tv.nix
@@ -51,11 +51,11 @@ import XMonad.Stockholm.Rhombus
import XMonad.Stockholm.Shutdown
-myTerm :: String
-myTerm = "urxvtc"
+amixerPath :: FilePath
+amixerPath = "${pkgs.alsaUtils}/bin/amixer"
-myRootTerm :: String
-myRootTerm = "urxvtc -name root-urxvt -e su -"
+urxvtcPath :: FilePath
+urxvtcPath = "${pkgs.rxvt_unicode}/bin/urxvtc"
myFont :: String
myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
@@ -75,7 +75,7 @@ mainNoArgs = do
-- $ withUrgencyHookC BorderUrgencyHook { urgencyBorderColor = "magenta" } urgencyConfig { suppressWhen = Never }
$ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ")
$ def
- { terminal = myTerm
+ { terminal = urxvtcPath
, modMask = mod4Mask
, keys = myKeys
, workspaces = workspaces0
@@ -83,7 +83,7 @@ mainNoArgs = do
-- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
--, handleEventHook = handleTimerEvent
, manageHook = placeHook (smart (1,0)) <+> floatNextHook
- , startupHook = spawn "echo emit XMonadStartup"
+ , startupHook = liftIO (putStrLn "emit XMonadStartup")
, normalBorderColor = "#1c1c1c"
, focusedBorderColor = "#f000b0"
, handleEventHook = handleShutdownEvent
@@ -121,24 +121,30 @@ displaySomeException :: SomeException -> String
displaySomeException = displayException
+forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
+forkFile path args env =
+ xfork (executeFile path False args env) >> return ()
+
+spawnRootTerm :: X ()
+spawnRootTerm =
+ forkFile
+ urxvtcPath
+ ["-name", "root-urxvt", "-e", "/var/setuid-wrappers/su", "-"]
+ Nothing
+
spawnTermAt :: String -> X ()
---spawnTermAt _ = floatNext True >> spawn myTerm
---spawnTermAt "ff" = floatNext True >> spawn myTerm
---spawnTermAt _ = spawn myTerm
spawnTermAt ws = do
env <- liftIO getEnvironment
let env' = ("XMONAD_SPAWN_WORKSPACE", ws) : env
- xfork (executeFile "urxvtc" True [] (Just env')) >> return ()
+ forkFile urxvtcPath [] (Just env')
myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
myKeys conf = Map.fromList $
- [ ((_4 , xK_Escape ), spawn "/var/setuid-wrappers/slock")
+ [ ((_4 , xK_Escape ), forkFile "/var/setuid-wrappers/slock" [] Nothing)
, ((_4S , xK_c ), kill)
, ((_4 , xK_x ), chooseAction spawnTermAt)
- , ((_4C , xK_x ), spawn myRootTerm)
- --, ((_4M , xK_x ), spawn "xterm")
- --, ((_4M , xK_x ), mySpawn "xterm")
+ , ((_4C , xK_x ), spawnRootTerm)
--, ((_4 , xK_F1 ), withFocused jojo)
--, ((_4 , xK_F1 ), printAllGeometries)
@@ -198,9 +204,9 @@ myKeys conf = Map.fromList $
--, (_4 , xK_v ) & \k -> (k, gridselectWorkspace wsGSConfig { gs_navigate = makeGSNav k } W.view)
--, (_4S , xK_v ) & \k -> (k, gridselectWorkspace wsGSConfig { gs_navigate = makeGSNav k } W.shift)
--, (_4 , xK_b ) & \k -> (k, goToSelected wGSConfig { gs_navigate = makeGSNav k })
- , ((noModMask, xF86XK_AudioLowerVolume), spawn "amixer sset Master 5%-")
- , ((noModMask, xF86XK_AudioRaiseVolume), spawn "amixer sset Master 5%+")
- , ((noModMask, xF86XK_AudioMute), spawn "amixer sset Master toggle")
+ , ((noModMask, xF86XK_AudioLowerVolume), amixer ["sset", "Master", "5%+"])
+ , ((noModMask, xF86XK_AudioRaiseVolume), amixer ["sset", "Master", "5%-"])
+ , ((noModMask, xF86XK_AudioMute), amixer ["sset", "Master", "toggle"])
]
where
_4 = mod4Mask
@@ -213,6 +219,8 @@ myKeys conf = Map.fromList $
_4CM = _4 .|. _C .|. _M
_4SM = _4 .|. _S .|. _M
+ amixer args = forkFile amixerPath args Nothing
+
pagerConfig :: PagerConfig
pagerConfig = def