summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-06-02 11:17:18 +0200
committermakefu <github@syntax-fehler.de>2016-06-02 11:17:18 +0200
commit4f28d9a306c2989304b52889c07e22992e40da0b (patch)
treed07166696ed3bd97bb6a165418af8611b8f68571 /tv/5pkgs
parentd5961aa09e399bb30f940eb5ac2cfe26dfa51d65 (diff)
parent7bd85d7bbbce68ba7317e16b805b1093ded3f1e2 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'tv/5pkgs')
-rw-r--r--tv/5pkgs/default.nix4
-rw-r--r--tv/5pkgs/xmonad-tv.nix (renamed from tv/5pkgs/xmonad-tv/Main.hs)56
-rw-r--r--tv/5pkgs/xmonad-tv/.gitignore1
-rw-r--r--tv/5pkgs/xmonad-tv/Makefile6
-rw-r--r--tv/5pkgs/xmonad-tv/xmonad.cabal18
5 files changed, 40 insertions, 45 deletions
diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix
index b520e1a32..05dc02887 100644
--- a/tv/5pkgs/default.nix
+++ b/tv/5pkgs/default.nix
@@ -18,8 +18,6 @@
};
ff = pkgs.callPackage ./ff {};
viljetic-pages = pkgs.callPackage ./viljetic-pages {};
- xmonad-tv =
- let src = pkgs.writeNixFromCabal "xmonad-tv.nix" ./xmonad-tv; in
- pkgs.haskellPackages.callPackage src {};
+ xmonad-tv = import ./xmonad-tv.nix { inherit pkgs; };
};
}
diff --git a/tv/5pkgs/xmonad-tv/Main.hs b/tv/5pkgs/xmonad-tv.nix
index 817d0092e..74e43dc79 100644
--- a/tv/5pkgs/xmonad-tv/Main.hs
+++ b/tv/5pkgs/xmonad-tv.nix
@@ -1,3 +1,14 @@
+{ pkgs, ... }:
+pkgs.writeHaskellBin "xmonad-tv" {
+ depends = [
+ "containers"
+ "unix"
+ "X11"
+ "xmonad"
+ "xmonad-contrib"
+ "xmonad-stockholm"
+ ];
+} ''
{-# LANGUAGE DeriveDataTypeable #-} -- for XS
{-# LANGUAGE FlexibleContexts #-} -- for xmonad'
{-# LANGUAGE LambdaCase #-}
@@ -40,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-*"
@@ -64,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
@@ -72,7 +83,9 @@ mainNoArgs = do
-- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
--, handleEventHook = handleTimerEvent
, manageHook = placeHook (smart (1,0)) <+> floatNextHook
- , startupHook = spawn "echo emit XMonadStartup"
+ , startupHook = do
+ path <- liftIO (getEnv "XMONAD_STARTUP_HOOK")
+ forkFile path [] Nothing
, normalBorderColor = "#1c1c1c"
, focusedBorderColor = "#f000b0"
, handleEventHook = handleShutdownEvent
@@ -110,24 +123,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)
@@ -187,9 +206,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
@@ -202,6 +221,8 @@ myKeys conf = Map.fromList $
_4CM = _4 .|. _C .|. _M
_4SM = _4 .|. _S .|. _M
+ amixer args = forkFile amixerPath args Nothing
+
pagerConfig :: PagerConfig
pagerConfig = def
@@ -278,3 +299,4 @@ wGSConfig = def
allWorkspaceNames :: W.StackSet i l a sid sd -> X [i]
allWorkspaceNames ws =
return $ map W.tag (W.hidden ws) ++ [W.tag $ W.workspace $ W.current ws]
+''
diff --git a/tv/5pkgs/xmonad-tv/.gitignore b/tv/5pkgs/xmonad-tv/.gitignore
deleted file mode 100644
index 616204547..000000000
--- a/tv/5pkgs/xmonad-tv/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/shell.nix
diff --git a/tv/5pkgs/xmonad-tv/Makefile b/tv/5pkgs/xmonad-tv/Makefile
deleted file mode 100644
index cbb0776e6..000000000
--- a/tv/5pkgs/xmonad-tv/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-.PHONY: ghci
-ghci: shell.nix
- nix-shell --command 'exec ghci -Wall'
-
-shell.nix: xmonad.cabal
- cabal2nix --shell . > $@
diff --git a/tv/5pkgs/xmonad-tv/xmonad.cabal b/tv/5pkgs/xmonad-tv/xmonad.cabal
deleted file mode 100644
index f9ea4dd7d..000000000
--- a/tv/5pkgs/xmonad-tv/xmonad.cabal
+++ /dev/null
@@ -1,18 +0,0 @@
-Author: tv
-Build-Type: Simple
-Cabal-Version: >= 1.2
-License: MIT
-Name: xmonad-tv
-Version: 0
-
-Executable xmonad
- Build-Depends:
- base,
- containers,
- unix,
- X11,
- xmonad,
- xmonad-contrib,
- xmonad-stockholm
- GHC-Options: -Wall -O3 -threaded -rtsopts
- Main-Is: Main.hs