Make xmobar workspaces clickable
Clicking a workspace switches to it; one visible on the other screen is swapped onto the focused screen. xmobar uses UnsafeXMonadLog so the click actions are kept.
This commit is contained in:
@@ -51,9 +51,9 @@ Config { overrideRedirect = True
|
|||||||
] 600
|
] 600
|
||||||
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
||||||
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
||||||
, Run XMonadLog
|
, Run UnsafeXMonadLog
|
||||||
]
|
]
|
||||||
, sepChar = "%"
|
, sepChar = "%"
|
||||||
, alignSep = "}{"
|
, alignSep = "}{"
|
||||||
, template = " | %XMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% "
|
, template = " | %UnsafeXMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% "
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ Config { overrideRedirect = True
|
|||||||
, Run XPropertyLog "_XMONAD_TRAYPAD"
|
, Run XPropertyLog "_XMONAD_TRAYPAD"
|
||||||
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
||||||
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
||||||
, Run XMonadLog
|
, Run UnsafeXMonadLog
|
||||||
]
|
]
|
||||||
, sepChar = "%"
|
, sepChar = "%"
|
||||||
, alignSep = "}{"
|
, alignSep = "}{"
|
||||||
, template = " | %XMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% %_XMONAD_TRAYPAD% "
|
, template = " | %UnsafeXMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% %_XMONAD_TRAYPAD% "
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import XMonad.Layout.Spiral
|
|||||||
import XMonad.Layout.Tabbed
|
import XMonad.Layout.Tabbed
|
||||||
import XMonad.Layout.ThreeColumns
|
import XMonad.Layout.ThreeColumns
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
import XMonad.Util.ClickableWorkspaces
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import qualified XMonad.Util.Hacks as Hacks
|
import qualified XMonad.Util.Hacks as Hacks
|
||||||
import XMonad.Util.Loggers
|
import XMonad.Util.Loggers
|
||||||
@@ -32,6 +33,7 @@ main :: IO ()
|
|||||||
main =
|
main =
|
||||||
xmonad
|
xmonad
|
||||||
. ewmhFullscreen
|
. ewmhFullscreen
|
||||||
|
. setEwmhSwitchDesktopHook W.greedyView
|
||||||
. ewmh
|
. ewmh
|
||||||
. dynamicEasySBs myStatusBars
|
. dynamicEasySBs myStatusBars
|
||||||
. addRandrChangeHook (spawn myScreenHotplug)
|
. addRandrChangeHook (spawn myScreenHotplug)
|
||||||
@@ -186,7 +188,7 @@ myStatusBars :: ScreenId -> X StatusBarConfig
|
|||||||
myStatusBars (S i) = do
|
myStatusBars (S i) = do
|
||||||
nScreens <- gets (length . W.screens . windowset)
|
nScreens <- gets (length . W.screens . windowset)
|
||||||
let rc = if nScreens > 1 && i /= 1 then "xmobarrc_hdmi" else "xmobarrc_laptop"
|
let rc = if nScreens > 1 && i /= 1 then "xmobarrc_hdmi" else "xmobarrc_laptop"
|
||||||
pure $ statusBarProp ("xmobar -x " ++ show i ++ " ~/.config/xmobar/" ++ rc) (pure myXmobarPP)
|
pure $ statusBarProp ("xmobar -x " ++ show i ++ " ~/.config/xmobar/" ++ rc) (clickablePP myXmobarPP)
|
||||||
|
|
||||||
myXmobarPP :: PP
|
myXmobarPP :: PP
|
||||||
myXmobarPP =
|
myXmobarPP =
|
||||||
|
|||||||
Reference in New Issue
Block a user