Separate workspaces for separate screens

master
Hektor Misplon 2023-05-22 18:26:17 +02:00
parent 579af889fe
commit edfe524ae2
1 changed files with 13 additions and 16 deletions

View File

@ -16,6 +16,7 @@ import XMonad.Layout.ToggleLayouts
( ToggleLayout (..), ( ToggleLayout (..),
toggleLayouts, toggleLayouts,
) )
import XMonad.Layout.IndependentScreens
import XMonad.Layout.WindowNavigation import XMonad.Layout.WindowNavigation
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig import XMonad.Util.EZConfig
@ -111,7 +112,10 @@ myLayoutHook =
ratio = 1 / 2 ratio = 1 / 2
delta = 4 / 100 delta = 4 / 100
myWorkspaces = [ "sh", "www", "dev", "pdf", "etc" ] myWorkspaces = [ "sh", "www", "dev", "info", "etc" ]
myWorkspaceKeys = [ "a", "s", "d", "f", "g" ]
mySharedWorkspaces = [ "shared" ]
mySharedWorkspaceKeys = [ "1" ]
myConfig = myConfig =
def def
@ -119,7 +123,7 @@ myConfig =
-- Use Win key instead of Alt -- Use Win key instead of Alt
modMask = mod4Mask, modMask = mod4Mask,
-- , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"] -- , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"]
workspaces = myWorkspaces, workspaces = withScreen 0 myWorkspaces ++ withScreen 1 mySharedWorkspaces,
-- Styling -- Styling
focusedBorderColor = "#000", focusedBorderColor = "#000",
normalBorderColor = "#0000", normalBorderColor = "#0000",
@ -130,8 +134,8 @@ myConfig =
layoutHook = avoidStruts myLayoutHook, layoutHook = avoidStruts myLayoutHook,
handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook
} }
`additionalKeysP` myKeysP
`removeKeysP` myRemoveKeysP `removeKeysP` myRemoveKeysP
`additionalKeysP` myKeysP
-- Keybindings to be added/overridden -- Keybindings to be added/overridden
myKeysP = myKeysP =
@ -172,19 +176,12 @@ myKeysP =
("M-<Right>", spawn "playerctl next"), ("M-<Right>", spawn "playerctl next"),
("M-<Left>", spawn "playerctl previous"), ("M-<Left>", spawn "playerctl previous"),
("M-<Up>", spawn "playerctl play"), ("M-<Up>", spawn "playerctl play"),
("M-<Down>", spawn "playerctl pause"), ("M-<Down>", spawn "playerctl pause")
-- Use a,s,d,f,g to switch to workspaces ] ++ [
("M-a", windows $ W.greedyView "sh"), (m ++ k, windows $ f w) |
("M-s", windows $ W.greedyView "www"), (m, f) <- zip ["M-", "M-S-"]
("M-d", windows $ W.greedyView "dev"), [W.greedyView, W.shift],
("M-f", windows $ W.greedyView "pdf"), (k, w) <- zip myWorkspaceKeys (withScreen 0 myWorkspaces) ++ zip mySharedWorkspaceKeys (withScreen 1 mySharedWorkspaces)
("M-g", windows $ W.greedyView "etc"),
-- Use shift + a,s,d,f,g to move window to workspace
("M-S-a", windows $ W.shift "sh"),
("M-S-s", windows $ W.shift "www"),
("M-S-d", windows $ W.shift "dev"),
("M-S-f", windows $ W.shift "pdf"),
("M-S-g", windows $ W.shift "etc")
] ]
-- Keybindings to be removed -- Keybindings to be removed