mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.U.ClickableWorkspaces: Drop escaping from clickableWrap
This breaks putting <fn> tags and icons into workspace names, which some people might like. Those few who generate workspace names dynamically from window titles may (and should) escape it themselves.
This commit is contained in:
parent
e91b0fef82
commit
b0f5c69baf
@ -25,7 +25,7 @@ import Control.Monad ((>=>))
|
|||||||
import Data.Functor ((<&>))
|
import Data.Functor ((<&>))
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Hooks.DynamicLog (xmobarAction, xmobarRaw, PP(..))
|
import XMonad.Hooks.DynamicLog (xmobarAction, PP(..))
|
||||||
import XMonad.Util.WorkspaceCompare (getWsIndex)
|
import XMonad.Util.WorkspaceCompare (getWsIndex)
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
@ -39,11 +39,16 @@ import qualified XMonad.StackSet as W
|
|||||||
-- * @xdotool@ on system (in path)
|
-- * @xdotool@ on system (in path)
|
||||||
-- * "XMonad.Hooks.EwmhDesktops" for @xdotool@ support (see Hackage docs for setup)
|
-- * "XMonad.Hooks.EwmhDesktops" for @xdotool@ support (see Hackage docs for setup)
|
||||||
-- * use of UnsafeStdinReader/UnsafeXMonadLog in xmobarrc (rather than StdinReader/XMonadLog)
|
-- * use of UnsafeStdinReader/UnsafeXMonadLog in xmobarrc (rather than StdinReader/XMonadLog)
|
||||||
|
--
|
||||||
|
-- Note that UnsafeStdinReader is potentially dangerous if your workspace
|
||||||
|
-- names are dynamically generated from untrusted input (like window titles).
|
||||||
|
-- You may need to add @xmobarRaw@ to 'ppRename' before applying
|
||||||
|
-- 'clickablePP' in such case.
|
||||||
|
|
||||||
-- | Wrap string with an xmobar action that uses @xdotool@ to switch to
|
-- | Wrap string with an xmobar action that uses @xdotool@ to switch to
|
||||||
-- workspace @i@.
|
-- workspace @i@.
|
||||||
clickableWrap :: Int -> String -> String
|
clickableWrap :: Int -> String -> String
|
||||||
clickableWrap i ws = xmobarAction ("xdotool set_desktop " ++ show i) "1" $ xmobarRaw ws
|
clickableWrap i ws = xmobarAction ("xdotool set_desktop " ++ show i) "1" ws
|
||||||
|
|
||||||
-- | Return a function that wraps workspace names in an xmobar action that
|
-- | Return a function that wraps workspace names in an xmobar action that
|
||||||
-- switches to that workspace.
|
-- switches to that workspace.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user