summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-12-03 04:59:27 +0100
committerlassulus <lassulus@lassul.us>2018-12-03 04:59:27 +0100
commitd1c7ec94eb0d695ee1a9f0a103ffcc9483d1f8cb (patch)
treefc7c8c5b7b5d0e1cb9bc047a757b1f788521c0cd /tv/5pkgs/haskell/xmonad-tv/src
parent2dc617874e001c25c1caceccd14ef7c1f74f73bc (diff)
parent24b07c32840949dbd02a8282d0b5d9cbe1c01bf5 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/haskell/xmonad-tv/src')
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/Paths.hs7
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/main.hs32
2 files changed, 29 insertions, 10 deletions
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
index e12c25bd5..3a879b5d0 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
@@ -13,10 +13,13 @@ passmenu :: FilePath
passmenu = findExecutable "passmenu"
slock :: FilePath
-slock = "/run/wrappers/bin/slock"
+slock = findExecutable "slock"
su :: FilePath
-su = "/run/wrappers/bin/su"
+su = findExecutable "su"
urxvtc :: FilePath
urxvtc = findExecutable "urxvtc"
+
+xcalib :: FilePath
+xcalib = findExecutable "xcalib"
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
index c96a8539e..b7d4e9bca 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
@@ -20,12 +20,13 @@ import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
, removeEmptyWorkspace)
import XMonad.Actions.CycleWS (toggleWS)
import XMonad.Layout.NoBorders ( smartBorders )
+import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall))
+import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink))
import qualified XMonad.StackSet as W
import Data.Map (Map)
import qualified Data.Map as Map
import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook)
import XMonad.Hooks.ManageHelpers (doCenterFloat)
-import XMonad.Layout.FixedColumn (FixedColumn(..))
import XMonad.Hooks.Place (placeHook, smart)
import XMonad.Actions.PerWorkspaceKeys (chooseAction)
@@ -47,6 +48,7 @@ main = getArgs >>= \case
mainNoArgs :: IO ()
mainNoArgs = do
+ let width = 1366
workspaces0 <- getWorkspaces0
handleShutdownEvent <- newShutdownEventHandler
xmonad
@@ -56,7 +58,14 @@ mainNoArgs = do
, modMask = mod4Mask
, keys = myKeys
, workspaces = workspaces0
- , layoutHook = smartBorders $ FixedColumn 1 20 80 10 ||| Full
+ , layoutHook =
+ smartBorders $
+ ResizableTall
+ 1
+ (10 * 6 / width)
+ ((80 * 6 + 2 * (1+1+1))/width) []
+ |||
+ Full
, manageHook =
composeAll
[ appName =? "fzmenu-urxvt" --> doCenterFloat
@@ -125,8 +134,9 @@ myKeys conf = Map.fromList $
, ((_C , xK_Menu ), toggleWS)
, ((_4 , xK_space ), sendMessage NextLayout)
- , ((_4S , xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout
+ , ((_4M , xK_space ), resetLayout)
+ , ((_4 , xK_m ), windows W.focusMaster)
, ((_4 , xK_j ), windows W.focusDown)
, ((_4 , xK_k ), windows W.focusUp)
@@ -134,10 +144,13 @@ myKeys conf = Map.fromList $
, ((_4S , xK_j ), windows W.swapDown)
, ((_4S , xK_k ), windows W.swapUp)
- , ((_4 , xK_h ), sendMessage Shrink)
- , ((_4 , xK_l ), sendMessage Expand)
+ , ((_4M , xK_h ), sendMessage Shrink)
+ , ((_4M , xK_l ), sendMessage Expand)
- , ((_4 , xK_t ), withFocused $ windows . W.sink) -- make tiling
+ , ((_4M , xK_j ), sendMessage MirrorShrink)
+ , ((_4M , xK_k ), sendMessage MirrorExpand)
+
+ , ((_4 , xK_t ), withFocused $ windows . W.sink)
, ((_4 , xK_comma ), sendMessage $ IncMasterN 1)
, ((_4 , xK_period ), sendMessage $ IncMasterN (-1))
@@ -151,6 +164,8 @@ myKeys conf = Map.fromList $
, ((0, xF86XK_AudioLowerVolume), audioLowerVolume)
, ((0, xF86XK_AudioRaiseVolume), audioRaiseVolume)
, ((0, xF86XK_AudioMute), audioMute)
+
+ , ((_4, xK_Prior), forkFile Paths.xcalib ["-invert", "-alter"] Nothing)
]
where
_4 = mod4Mask
@@ -168,6 +183,8 @@ myKeys conf = Map.fromList $
audioRaiseVolume = pactl ["--", "set-sink-volume", "@DEFAULT_SINK@", "+5%"]
audioMute = pactl ["--", "set-sink-mute", "@DEFAULT_SINK@", "toggle"]
+ resetLayout = setLayout $ XMonad.layoutHook conf
+
pagerConfig :: PagerConfig
pagerConfig = def
@@ -186,5 +203,4 @@ pagerConfig = 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]
+allWorkspaceNames = return . map W.tag . W.workspaces