From 44e5f582dbfce55b58b792f9519a7a1810990e82 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 1 Dec 2018 11:40:01 +0100 Subject: tv xmonad: use ResizableTall --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index c96a8539e..79b603b5d 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 @@ -134,8 +143,11 @@ 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) + + , ((_4M , xK_j ), sendMessage MirrorShrink) + , ((_4M , xK_k ), sendMessage MirrorExpand) , ((_4 , xK_t ), withFocused $ windows . W.sink) -- make tiling -- cgit v1.2.3 From ac837f8d32319daa8594616b3c6e224747bc6ef1 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 1 Dec 2018 11:40:33 +0100 Subject: tv xmonad: Super-m to focus master --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 79b603b5d..ebd902b1d 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -136,6 +136,7 @@ myKeys conf = Map.fromList $ , ((_4 , xK_space ), sendMessage NextLayout) , ((_4S , xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout + , ((_4 , xK_m ), windows W.focusMaster) , ((_4 , xK_j ), windows W.focusDown) , ((_4 , xK_k ), windows W.focusUp) -- cgit v1.2.3 From 5c6f751028f3e17b740ce239701044e74e2f0890 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 1 Dec 2018 11:40:58 +0100 Subject: tv xmonad: cleanup --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index ebd902b1d..f82077a21 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -134,7 +134,7 @@ 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) @@ -150,7 +150,7 @@ myKeys conf = Map.fromList $ , ((_4M , xK_j ), sendMessage MirrorShrink) , ((_4M , xK_k ), sendMessage MirrorExpand) - , ((_4 , xK_t ), withFocused $ windows . W.sink) -- make tiling + , ((_4 , xK_t ), withFocused $ windows . W.sink) , ((_4 , xK_comma ), sendMessage $ IncMasterN 1) , ((_4 , xK_period ), sendMessage $ IncMasterN (-1)) @@ -181,6 +181,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 @@ -199,5 +201,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 -- cgit v1.2.3 From 29d9070f04fd57ced04b4304f27b4adc042c4388 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 14:51:35 +0100 Subject: tv xmonad shell: use currentSystem in executable --- tv/5pkgs/haskell/xmonad-tv/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/shell.nix b/tv/5pkgs/haskell/xmonad-tv/shell.nix index 2f9fff6ed..936e69627 100644 --- a/tv/5pkgs/haskell/xmonad-tv/shell.nix +++ b/tv/5pkgs/haskell/xmonad-tv/shell.nix @@ -28,7 +28,7 @@ in config.systemd.services.xmonad.environment.XMONAD_CACHE_DIR } - xmonad=$CACHEDIR/main + xmonad=$CACHEDIR/xmonad-${lib.currentSystem} xmonad_build() {( set -efu -- cgit v1.2.3 From b9bd7a08b8aab6c0a7b4df5bad2ac7d40474633a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 14:52:25 +0100 Subject: tv xmonad: find all paths --- tv/5pkgs/haskell/xmonad-tv/src/Paths.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs index e12c25bd5..317900c1c 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs @@ -13,10 +13,10 @@ 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" -- cgit v1.2.3 From a58628d1c3c8fb4d730ee77ce3fae6130271962f Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 15:43:49 +0100 Subject: tv xmonad: add xcalib --- tv/5pkgs/haskell/xmonad-tv/src/Paths.hs | 3 +++ tv/5pkgs/haskell/xmonad-tv/src/main.hs | 2 ++ 2 files changed, 5 insertions(+) (limited to 'tv/5pkgs/haskell') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs index 317900c1c..3a879b5d0 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs @@ -20,3 +20,6 @@ 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 f82077a21..b7d4e9bca 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -164,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 -- cgit v1.2.3