You are not logged in.
Pages: 1
Topic closed
I am using XMonad on my laptop and I also have a monitor for the laptop. The monitor has higher resolution than my laptop so when I connect my laptop to the monitor, the dzen bar and trayer will still stay the same size so there will be a big gap between the right side of the bar and the right side of the screen.
If I reload XMonad, trayer will go to the right place but dzen will stay the same size.
Is there a way to specify the trayer size dynamically using percentage?
-- Command to launch the bar.
myBar = "dzen2 -bg black -fg white -ta l -w 1352 -x 0"
conkyBar = "conky -c ~/.xmonad/conkyrc | dzen2 -bg black -fg white -ta r -w 432 -x 1352"
myTrayer = "killall trayer; trayer --edge top --align right --widthtype request --SetDockType true --SetPartialStrut true --transparent true --alpha 0 --tint 0x000000 --expand true --heighttype pixel --height 16"
-- Custom PP, configure it as you like. It determines what's being written to the bar.
myPP = dzenPP {
ppCurrent = dzenColor "white" "#00cc00" . pad
, ppHiddenNoWindows = dzenColor "#efefef" "#2f2f2f" . pad
, ppTitle = ("^fg(#00ff00) " ++) . dzenEscape
}
........
myLogHook :: Handle -> X ()
myLogHook h = dynamicLogWithPP $ myPP { ppOutput = hPutStrLn h }
main = do
myStatusBarPipe <- spawnPipe myBar
conkyBarProc <- spawnPipe conkyBar
trayproc <- spawnPipe myTrayer
xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig {
terminal = "urxvt"
, manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
--, manageHook = myManageHook
--, layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ myLayout
, logHook = myLogHook myStatusBarPipe
, modMask = mod4Mask
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
, handleEventHook = ewmhDesktopsEventHook
, keys = myKeys
}
Normally
On larger monitor:
Last edited by helloworld1 (2012-12-29 04:17:04)
Offline
I'm not a pro with Desktop Enviornments, but my best guess would be to google how bigger giants such as Gnome or KDE manage that, then look for alternatives.
It always makes me laugh when people complain and rage over any distro's management ideal, when this is a linux community, and you could always make your own distro and experience the pains yourself.
Offline
I'm not a pro with Desktop Enviornments, but my best guess would be to google how bigger giants such as Gnome or KDE manage that, then look for alternatives.
Well they have dedicated status bar instead of separate bar for workspace information, system information and system tray.
Offline
Hello,
I have simmilar setup, but i don't call dzen directly, instead i call simple bash wrapper that computes screen offsets, based on screen resolution (via xrandr).
Here it is:
#!/bin/bash
# Get monitor width and height for proper Layout
SCREEN_WIDTH=$(xrandr | grep -Po --color=never "(?<=\ connected )[\d]+(?=x[\d]+)")
SCREEN_HEIGHT=$(xrandr | grep -Po --color=never "(?<=\ connected )[\d]+x[\d]+" | sed -r "s/[0-9]+x//")
# Layout
HEIGHT=16
WIDTH=700
Y_POS=$(echo "$SCREEN_HEIGHT - $HEIGHT" | bc)
# Colors and font
FONT="-*-montecarlo-medium-r-normal-*-11-*-*-*-*-*-*-*"
DZEN_BG="#020202"
DZEN_FG="#9d9d9d"
dzen2 -x 0 -y $Y_POS -h $HEIGHT -w $WIDTH -ta l -fg $DZEN_FG -bg $DZEN_BG -fn $FONT -p -e ''
Last edited by nsl (2012-12-29 16:57:02)
Offline
Here is what OP wanted. Unfortunately, answer came too late I guess.
http://xmonad.org/xmonad-docs/xmonad-co … -Dzen.html
EDIT: actually, this still isn't what op wanted.
Last edited by reddhawk (2016-11-25 08:52:50)
Offline
Thanks for sharing, but OP hasn't been back in over two years. I think we can put this topic to rest now.
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed