You are not logged in.
this started out as a let's-see-if-it's-possible sort of thing, and now it's driving me mad that I can't figure this out. I'm attempting to make dzen + conky act as a statusbar, positioned vertically on the left side of my screen. my current .xinitrc line is:
conky -c /home/bryant/conkyrc | dzen2 -x '0' -w '60' -h '900' -ta 'l' -bg '#000000' -fg '#00ee00' -y '50' -fn '-*-terminus-*-r-normal-*-*-130-*-*-*-*-*-*'&my conky config is:
background no
out_to_console yes
background no
out_to_console yes
update_interval 1.0
short_units yes
format_human_readable yes
out_to_x no
TEXT
{${time %a %b %d %Y}
${time %H:%M:%S}}
[RAM: $memperc%]
[CPU: $cpu%]
[disk I/O: ${diskio_write /dev/sda}/${diskio_read /dev/sda}]
[SSD: ${fs_used /}/${fs_size /} (${fs_used_perc /}%)]
${if_existing /proc/net/route wlp1s0}[network: ${wireless_essid wlp1s0} (${wireless_link_qual_perc wlp1s0}%)] $else [network: -- ]$endif
${if_existing /sys/class/power_supply/BAT1}[battery: ${battery_percent BAT1}%,
(${battery_time BAT1})] $else ${if_existing /sys/class/power_supply/ADP1} [AC power] $else [battery: -- ]$endifI realize that most of this won't fit in a 40-pixel bar, but I'm still working out the formatting. dzen positions itself properly, but it only displays part of the fist line no matter how wide I make it.
Last edited by ParanoidAndroid (2013-07-16 05:19:14)
Offline
Hello...
I don't know what you exactly mean with 'only part of the first line', but I'll take a wild guess that you want to display more than just one line.
In that case you need to start dzen like this:
your_script_here.sh | dzen2 -e 'onstart=uncollapse' -l 20 <your other options>dzen sets the first line as title, and the rest is put into the slave part. The -l option specifies how many lines you want to show in the slave part.
By default, the slave part is only displayed when you hover it with your mouse (this is called an 'event'). You may specify what happens at what event with the -e option; here I specified that the slave window shall be displayed on the 'startup' event.
See the dzen2 README.
But I'm not sure whether that's what you try to do.
Last edited by ayekat (2013-06-25 15:18:21)
Offline
I tried the multiple line thing, and it didn't work.
what I'm trying to do is turn dzen into a collumn on the left side of my screen, displaying data in a vertical format inside said collumn. My conky input has been reformatted to produce a collumn format that can fit the bar, but it still only shows the first line of my conky input, and does not update it. (that is, the one line of text in the bar is static.) Interestingly, your suggestion and variants thereof from the wiki produced no difference from the earlier behavior. I'm flummoxed.
Last edited by ParanoidAndroid (2013-06-26 00:44:22)
Offline
[...], and does not update it. (that is, the one line of text in the bar is static.)[...]
Have you tried running your conky instance without piping into dzen? Does it correctly output and update the values there?
Apart from that, I'm clueless, too :-/
Offline
I think this does what you want:
conky -c conkyrc | dzen2 -l 4 -ta l -sa l -e 'onstart=uncollapse'but if I use your conkyrc, conky complains about 'missing endif's. It works if I use this conkyrc:
background no
out_to_console yes
background no
out_to_console yes
update_interval 1.0
short_units yes
format_human_readable yes
out_to_x no
TEXT
${time %H:%M:%S}
[RAM: $memperc%]
[CPU: $cpu%]
[disk I/O: ${diskio_write /dev/sda}/${diskio_read /dev/sda}]
[SSD: ${fs_used /}/${fs_size /} (${fs_used_perc /}%)]Last edited by 2ManyDogs (2013-07-01 14:58:12)
Offline
Not exactly. I'm trying to make dzen a collumn, not a bar. Imagine, for a moment: a vertical black stripe the height of the screen on the left side, about 150px wide, containing a collumn of text that tells of computer stats. That's what I'm looking for.
interestingly, the suggestion by 2ManyDogs works... until I add the height and width parameters. Then all I see is a black bar on the left of my screen, containing only the first line of conky output and frozen. And yes, conky updates the text normally in any other format or in console mode. What gives?
Offline
interestingly, the suggestion by 2ManyDogs works... until I add the height and width parameters.
Please post the exact command you are now using with dzen2.
Wouldn't this be easier to do with just conky? You aren't really doing anything with dzen that conky can't do by itself.
Offline
Not exactly. I'm trying to make dzen a collumn, not a bar.
In my understanding, a column is nothing else than a bar that has the height of the screen, and doesn't cover the entire width of the screen :-)
Last edited by ayekat (2015-03-25 09:45:39)
Offline
My current xinitrc line is:
conky -c ~/conkyrc | dzen2 -l 14 -ta l -sa l -e 'onstart=uncollapse' -bg '#000000' -fg '#00ee00' -fn '-*-terminus-*-r-normal-*-*-21-*-*-*-*-*-*' -w '150' -h '900'It works great until I add height and width, then it just ceases to work. The bar is displayed, but the text within is only one line which is not updated.
As for using conky alone... I'm testing this right now. I've thought of it before, but I much prefer dzen because it's a tad lighter on resources than conky's graphical mode. Also, how do I get xmonad to reserve space for conky on the edge of the screen? I never quite figured it out. I know I can set aside space for dzen, but it only seems to apply to the upper and lower edges. Can I manually set aside a space of XxY pixels in xmonad.hs?
Offline
I think the problem you are having is this:
-h <pixels>
Set line height (defaults to fontheight + 2 pixels).
You are setting the line height to 900 (not the height of dzen2). So you only see one line, whose height is the entire height of your screen. Try setting the height to a smaller value (like 60) and you will see more lines, with more space between them (because the lines are higher than the font, but smaller than the screen).
I don't know anything about xmonad, but see if it has a "pad" setting of some sort that allows you to reserve a portion of the screen.
Last edited by 2ManyDogs (2013-06-28 00:26:52)
Offline
@ 2ManyDogs, Just curious, what terminal emulator do you use?
Last edited by w201 (2013-06-28 01:51:06)
Offline
Thanks 2ManyDogs, that got it working. New problem: it inserts a newline between each line and sticks a bunch of daimond shaped bulletpoints before each line. Is there a way to eliminate that?
Also, it fails to display the $hr character (a horizontal line).
EDIT:
Adjusting the -h parameter fixed the newline issue, but it still has the weird bullet point thing going on.
Last edited by ParanoidAndroid (2013-06-28 02:31:17)
Offline
@ 2ManyDogs, Just curious, what terminal emulator do you use?
You mean in the scrot I posted? That's urxvt and tmux.
Last edited by 2ManyDogs (2013-06-28 06:27:40)
Offline
[...]
Also, it fails to display the $hr character (a horizontal line).EDIT:
Adjusting the -h parameter fixed the newline issue, but it still has the weird bullet point thing going on.
As far as I remember, the $hr variable (and graphical elements of conky in general) cannot be displayed in dzen. On my computer they got replaced by those diamond symbols.
In fact, every output of conky that looks funky on the terminal will do so in dzen. :-)
The config you provided above doesn't contain any such graphics, and thus in dzen it looks OK (at least for me™).
So if you want to display icons and lines and stuff, you will need to do it the dzen-way and load them as X-Bitmap images with ^i().
Now for bars that will quickly become a major PITA, in conky, and the main reason why people tend to write their own scripts in python, sh (or C, in my case ^^) for piping information into dzen.
Last edited by ayekat (2013-06-28 09:20:09)
Offline
Sweet. Got it working properly. But a new problem has popped up: xmonad won't reserve space for it, despite using the avoidStruts and manageDocks in the proper way. Here is my xmonad.hs:
import XMonad
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import XMonad.Util.Run
import XMonad.Actions.CycleWS
import Graphics.X11.ExtraTypes.XF86
import Graphics.X11.Xlib
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
-- layout
myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
-- window rules
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
-- , className =? "Gimp" --> doFloat
, className =? "feh" --> doFloat
, resource =? "desktop_window" --> doIgnore ]
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod4Mask, xK_x ), kill) -- close window
, ((modMask, xK_q), restart "xmonad" True)
, ((mod4Mask, xK_m ), nextWS) -- move to next workspace
, ((mod4Mask, xK_n ), prevWS) -- move to prev workspace
, ((mod4Mask .|. mod1Mask, xK_m ), shiftToNext) -- move window to next workspace
, ((mod4Mask .|. mod1Mask, xK_n ), shiftToPrev) -- move window to prev workspace
, ((mod4Mask, xK_o ), windows W.swapMaster) -- push to master
, ((mod4Mask, xK_i ), windows W.focusMaster)
, ((mod4Mask, xK_h), sendMessage Shrink) -- shrink the master area
, ((modMask, xK_comma ), sendMessage (IncMasterN 1))
, ((modMask, xK_period ), sendMessage (IncMasterN (-1)))
, ((mod4Mask, xK_j ), windows W.focusDown) -- swap the focused window with the next window
, ((mod4Mask, xK_0 ), (setLayout $ XMonad.layoutHook conf)) --Reset layout to workspaces default
, ((mod4Mask, xK_k ), windows W.focusUp) -- swap thefocused window with the previous window
, ((mod4Mask, xK_l ), sendMessage Expand) -- expand the master area
, ((mod4Mask .|. shiftMask, xK_q), io (exitWith ExitSuccess)) -- quit xmonad
, ((0, xK_Print ), spawn "/home/bryant/.scripts/screenshot")
, ((mod4Mask, xK_BackSpace ), spawn "/home/bryant/.scripts/screenlock")
, ((mod4Mask .|. shiftMask, xK_r ), spawn "/home/bryant/.scripts/remind-notify")
, ((mod4Mask, xK_space ), spawn "/home/bryant/.scripts/touchpadtoggle")
, ((mod4Mask, xK_semicolon ), spawn "dmenu_run -b -p Run: -nf green -sb green -nb black -sf black -fn 'Terminus-16' -h 23")
, ((mod4Mask .|. shiftMask, xK_Return), spawn "urxvtc")
, ((mod4Mask .|. shiftMask, xK_3 ), spawn "urxvtc -e calc")
, ((mod4Mask .|. shiftMask, xK_a ), spawn "urxvtc -e mocp")
, ((mod4Mask .|. shiftMask, xK_m ), spawn "urxvtc -e htop")
, ((mod4Mask .|. shiftMask, xK_n ), spawn "urxvtc -e newsbeuter")
, ((mod4Mask .|. shiftMask, xK_c ), spawn "urxvtc -e wyrd")
, ((mod4Mask .|. shiftMask, xK_2 ), spawn "urxvtc -e mutt")
, ((mod4Mask .|. shiftMask, xK_e ), spawn "urxvtc -e vim")
, ((mod4Mask .|. shiftMask, xK_Home ), spawn "urxvtc -e ranger")
, ((mod4Mask .|. shiftMask, xK_p), spawn "urxvtc -e cboard")
, ((mod4Mask .|. shiftMask, xK_g ), spawn "gimp")
, ((mod4Mask .|. shiftMask, xK_d ), spawn "dwb")
, ((mod4Mask .|. shiftMask, xK_l ), spawn "urxvtc -e elinks")
, ((mod4Mask, xK_b ), spawn "sleep 0.5 && xset dpms force off")
, ((mod4Mask, xK_s ), spawn "systemctl suspend")
, ((0, 0x1008FF14 ), spawn "mocp -G")
, ((0, 0x1008FF17 ), spawn "mocp -f")
, ((0, 0x1008FF16 ), spawn "mocp -r")
, ((0, xK_F6 ), spawn "/usr/bin/mute_toggle")
, ((0, xK_F7 ), spawn "/usr/bin/vol_down")
, ((0, xK_F8 ), spawn "/usr/bin/vol_up") ]
myLogHook = dynamicLog
main = do
xmonad $ defaultConfig
{
-- override settings
terminal = "urxvtc"
, borderWidth = 1
, modMask = mod4Mask
, workspaces = ["1","2","3","4","5","6","7","8","9","10"]
, normalBorderColor = "#000000"
, focusedBorderColor = "#00ee00"
, focusFollowsMouse = False
, layoutHook = myLayout
, manageHook = myManageHook <+> manageDocks
, handleEventHook = docksEventHook
, logHook = myLogHook
, keys = myKeys
}Offline
w201 wrote:@ 2ManyDogs, Just curious, what terminal emulator do you use?
You mean in the scrot I posted? That's urxvt and tmux.
Right. Thought it was a drop down terminal, that's why I asked. Don't wanna hijack the thread, thanks!
Offline
I've been fiddling with my xmonad.hs and it appears that xmonad does things automatically, i.e. there is no "pad" setting such that I can reserve a user-set amount of space for dzen or conky. It does indeed reserve space automatically... for the title section of dzen only. the slave window is not treated as part of dzen. I tried using the ^tw directive in my conkyrc to force dzen to shove everything into the title window, but this did not work. Any suggestions?
Offline
solution achieved. Running conky in graphical mode and setting window manager hints to 'panel' did the trick nicely. Additionally, got a pretty sweet config working. Marking this thread as solved.
Offline