You are not logged in.
Pages: 1
I've been hunting the past few days trying to make my dzen bar clickable.
Mainly to switch workspaces in xmonad, and later adding mpd to my dzen bar clicking next stop previous so on.
I've learn that dzen had add a clickable functionality with the ^ca().
There are a few pages about xmonad with dzen clickables.
Such as
http://www.arch-ed.dk/wiki/doku.php?id= … workspaces
And they all follow that format.
Some have
myWorkspaces = clickable . (map dzenEscape) $ nWorkspaces 9 ["web", "irc", "com"]
or
myWorkspaces = clickable . (map dzenEscape) $ ["1","2","3","4","5"]
I do have the latest dzen, and I am using xmonad standard version not darcs.
My xmonad.hs is
--Imports--
import XMonad
--Actions--
import XMonad.Actions.CycleWindows -- classic alt-tab
import XMonad.Actions.CycleWS -- cycle thru WS', toggle last WS
import XMonad.Actions.DwmPromote -- swap master like dwm
--Hooks--
import XMonad.Hooks.DynamicLog -- statusbar
import XMonad.Hooks.EwmhDesktops -- fullscreenEventHook fixes chrome fullscreen
import XMonad.Hooks.ManageDocks -- dock/tray mgmt
import XMonad.Hooks.UrgencyHook -- window alert bells
import XMonad.Hooks.SetWMName -- matlab fix
--Layouts--
import XMonad.Layout.Named -- custom layout names
import XMonad.Layout.NoBorders -- smart borders on solo clients
--Utils--
import XMonad.Util.EZConfig -- append key/mouse bindings
import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
import System.IO -- hPutStrLn scope
import qualified XMonad.StackSet as W -- manageHook rules
main = do
conky <- spawnPipe myDzenConky -- conky stats on the right
statuspipe <- spawnPipe myDzenMain --"dzen2 -bg black -fg white -ta l -w 840"
xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
{ modMask = mod4Mask
, borderWidth = 2
, normalBorderColor = "#dddddd"
, focusedBorderColor = "#0000ff"
-- , handleEventHook = fullscreenEventHook
, workspaces = myWorkspaces
, layoutHook = myLayoutHook
, manageHook = (doF W.swapDown) <+> manageHook defaultConfig --Make new window not be master winodw
, startupHook= setWMName "LG3D"
, logHook = dynamicLogWithPP $ defaultPP
{
ppCurrent = dzenColor "#3399ff" "#000000" . pad --Current workspace (fore/back)ground colour
, ppVisible = dzenColor "#888888" "#000000" . pad
, ppHidden = dzenColor "#dddddd" "#000000" . pad --Unused workspace with apps on it
, ppHiddenNoWindows = dzenColor "#888888" "#000000" . pad --Unused workspace with no apps on it
, ppTitle = dzenColor "#FF00FF" "". shorten 700 . dzenEscape --Title of window on current workspace00AA9DC
, ppOutput = hPutStrLn statuspipe
}
}
`additionalKeysP` myKeys
-- Tags/Workspaces
-- clickable workspaces via dzen/xdotool
myWorkspaces :: [String]
myWorkspaces = clickable . (map dzenEscape) $ ["1","2","3","4","5","6","7","8","9"]
where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
(i,ws) <- zip [1..] l,
let n = i ]
-- Layouts
-- the default layout is fullscreen with smartborders applied to all
myLayoutHook = avoidStruts $ smartBorders ( mtiled ||| full ||| tiled )
where
full = named "X" $ Full
mtiled = named "M" $ Mirror tiled
tiled = named "T" $ Tall 1 (5/100) (2/(1+(toRational(sqrt(5)::Double))))
-- sets default tile as: Tall nmaster (delta) (golden ratio)
-- Statusbars
--
myDzenMain = "dzen2 -bg black -fg white -ta l -w 1610"
myDzenConky = "conky -c ~/.conkyrc | dzen2 -bg black -x '1500' -w '110' -ta 'r'"
-- Key bindings
--
myKeys = [ ("M1-<Tab>" , cycleRecentWindows [xK_Alt_L] xK_Tab xK_Tab ) -- classic alt-tab behaviour
, ("M-b" , sendMessage ToggleStruts ) -- toggle the status bar gap
, ("M-<Tab>" , toggleWS ) -- toggle last workspace (super-tab)
, ("M-<Right>" , nextWS ) -- go to next workspace
, ("M-<Left>" , prevWS ) -- go to prev workspace
, ("M-S-<Right>", shiftToNext ) -- move client to next workspace
, ("M-S-<Left>" , shiftToPrev ) -- move client to prev workspace
, ("M-r" , spawn "xmonad --restart" ) -- restart xmonad w/o recompiling
, ("M-x" , spawn "chromium" ) -- launch browser
, ("M-S-x" , spawn "chromium --incognito" ) -- launch private browser
, ("M-l" , spawn "xscreensaver-command -lock" ) -- lock the screen
, ("C-M1-<Delete>" , spawn "sudo shutdown -r now" ) -- reboot
, ("C-M1-<End>" , spawn "sudo shutdown -h now" ) -- poweroff
, ("<XF86AudioMute>" , spawn "amixer -q sset Master toggle") --Toggle Volume
, ("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 2- unmute") -- lower volume
, ("<XF86AudioRaiseVolume>", spawn "amixer -q sset Master 2+ unmute") -- raise volume
, ("<Print>" , spawn "import -window root `date '+%Y%m%d-%H%M%S'`.png") --Take a Screenshot
]
Put no matter who's configuration I try using dzen is not clickable.
Also my workspaces are always named wierd things like
^a(1,xdotool key super+1()1^a() [for first one]
^a(1,xdotool key super+1()1^a() [for second one]
Is the character c being escaped?
If someone could please tell me how to troubleshoot this problem I will be very greatful.
I've also been searching through the xmonad dzen and xmobar hacking thread.
And they have the format from the link i provided above, and it works for them no problem.
Last edited by Jabrick (2011-11-05 22:37:14)
Offline
Be sure to use the SVN version of dzen2, 0.8.5 doesn't include this feature.
Run the following command to fetch it:
svn checkout http://dzen.googlecode.com/svn/trunk/ dzen
Rob.
Offline
Be sure to use the SVN version of dzen2, 0.8.5 doesn't include this feature.
Run the following command to fetch it:
svn checkout http://dzen.googlecode.com/svn/trunk/ dzen
Rob.
Thank you so much!!
Wow I feel so stupid, its always these simple things that mess me up
I read through previous posts I read and only now notice the mention of svn and gadget.
I guess its because I didn't know anything about svn, revisions and such.
I feel a lot better now!
Thank you Rob.
Offline
Pages: 1