You are not logged in.
Greetings,
I am running xmonad with a dzen2 status bar displaying time etc. My laptop has a 10.1" screen with a resolution of 1024x600, so I want reserve as many of those 600 pixels as possible for my applications. Towards this end, I want to make my status bar vertical on the side of my screen, instead of it being horizontal at the top of my screen. My approach is strongly inspired by this. So far, the dzen command I am using is
dzen2 -l 11 -ta l -sa l -e 'onstart=uncollapse' -w '10'and my conky config (starting with a very basic one, and once that works, will add more stuff to it).
background no
out_to_console yes
update_interval 1.0
short_units yes
format_human_readable yes
out_to_x no
TEXT
${time %b} \
${time %d} \
${time %H}\
${time %M}This conky configuration displays date and time in a fairly minimal way.
$ conky
Feb 25 1221
Feb 25 1221
Feb 25 1221
^CFeb 25 1221
Conky: received SIGINT or SIGTERM to terminate. bye!When I run
conky | dzen2 -l 11 -ta l -sa l -e 'onstart=uncollapse' -w '10'one "F" (first letter in Feb for February) per second appear in the tiny vertical dzen2 until it is filled. If I remove the "\" at the end of the lines at the end of my conky configuration, I get a column with the first character in month, date, hour and minute respectively. I haven't seen convenient ways to manipulate strings in a conky config file, so to get one character per line, I tried piping the output of conky through a fold:
$ conky -c ~/.xmonad/conkyrc | fold -w 1
F
e
b
2
5
1
2
2
7
^CConky: received SIGINT or SIGTERM to terminate. bye!which works as expected. However, if I squeeze that between conky and dzen,
conky | fold -w 1 | dzen2 -l 11 -ta l -sa l -e 'onstart=uncollapse' -w '10'I don't see anything in my dzen statusbar. Just to see what the problem was, I tried instead squeezing a sed command between conky and dzen:
conky | sed -e 's/F/f/g' | dzen2 -l 11 -ta l -sa l -e 'onstart=uncollapse' -w '10'I would expect one "f" (the "F" in Feb turned into lowercase) per second to appear in the vertical dzen2 until it is filled, but instead, nothing appears.
It seems that putting something between conky and dzen2 prevents conky from "pushing" data into dzen2; since dzen2 doesn't "pull", nothing is displayed.
Do you guys know how to solve this issue, or do you know of another, simpler way to achieve what I am trying to achieve?
Cheers,
Willard.
Offline
Well, what might work is first let conky and sed write their output into a fifo and then display the content of the fifo with cat and finally pipe the output of cat into dzen2… Just a guess, I didn't try it myself.
Offline
Thank you for your reply.
To debug, I have simplified my conky configuration to the following.
$ cat ~/.conkyrc
out_to_x no
out_to_console yes
update_interval 1.0
TEXT
${time %S}Here's what happens if I run conky.
$ conky
02
03
04
^C05
Conky: received SIGINT or SIGTERM to terminate. bye!Here's what happens if I (anonymous-)pipe conky through a fold.
$ conky | fold -w 1
1
2
1
3
1
4
^CConky: received SIGINT or SIGTERM to terminate. bye!I then tried the named FIFOs you suggested. First, I created my pipes.
$ mkfifo /tmp/conkypipe
$ mkfifo /tmp/foldpipeNext, I tried executing the following in terminal A.
$ conky > /tmp/conkypipe # (A)Then, in my main terminal, I cat the pipe, and this happens.
$ cat /tmp/conkypipe
58
59
00
01
^C(that is, exactly what was expected). Terminating "cat" also terminates (A) running in terminal A.
However, if I instead run (A) in terminal A, the following in terminal B,
$ cat /tmp/conkypipe | fold -w 1 > /tmp/foldpipe # (B)and then this in my main terminal:
$ cat /tmp/foldpipe nothing happens in my main terminal. If I ^C in the main terminal, nothing happens in terminals A and B. Conky is not terminated until I ^C in terminal A.
So, same problem, w/o involving dzen2. Hopefully a solution to the above translates to a solution to my original problem. Do you know what's going on?
In case someone wants to try the above through dzen, here is the dzen command I would use for debugging.
dzen2 -l 1 -w 20 -ta l -e 'onstart=uncollapse'Offline
I got your email, willardthor. My reply got munged by gmail, it doesn't play nice with the s-nail mail client/msmtp, one of the two... something about not being RFC 2822-compliant. That aside:
your problem is fairly simple to solve, though I seem to recall it being outrageously frustrating at the time. There are two solutions to the conky-but-not-much-screen-space problem: one is what you asked for (somewhat) and the other is not what you asked for but is the setup I currently use, which I find to be great for minimal-space screens.
1. go in to your conky config with your favorite text editor (I use vim) and change the following values so they look like this:
alignment middle_left
out_to_x yes
out_to_console no
own_window yes
own_window_type panel
gap_x 5now you just have to set your window manager to force windows to not overlap panels. You can do this automatically with some WMs (i.e. xmonad with avoidStruts) or you can set a pixel padding value manually, if the WM supports it. Also, remeber to set your config up so that data is displayed on multiple lines instead of on one line, like you would for dzen output. As you can see, this does produce a wide vertical strip down one side of the screen wich windows will not overlap. However, it still takes up way more space than is convenient in your situation.
2. this solution involves setting up conky as you would normally (i.e. out to own window instead of piped to dzen) and then using a script to toggle it on and off. I use two separate conky panels on either side of my screen, the configs for which are below. There's no need to set them up as panels, since they'll be popping in and out at the press of a key rather than sitting atop your windows perpetually.
primary panel (system info) config:
background no
out_to_console no
update_interval 0.50
short_units yes
format_human_readable yes
out_to_x yes
extra_newline no
use_xft yes
xftfont xft:Terminus:antialias=true:pixelsize=16:style=Regular
temperature_unit celcius
own_window yes
alignment middle_right
own_window_type panel
draw_borders yes
border_width 1
default_color ff7e00
double_buffer yes
use_spacer
gap_x 5
gap_y 0
mpd_host /home/bryant/.mpd/socket
own_window_argb yes
TEXT
$alignc${time %H:%M:%S}
$alignc${time %a %b %d %Y}
$alignc$uptime
$hr 1
[battery: ${battery_percent BAT1}%]
(${battery_time BAT1})
$alignc${battery_bar 4,150 BAT1}
$hr 1
[RAM: $memperc%]
${membar 5,60}
[CPU: $cpu%]
${cpugraph 20,60 100}
[freq: ${freq 1}MHz]
[temp: ${acpitemp}C]
$hr
[disk]
${fs_free /} free
read: ${diskio_read /dev/sda} write: ${diskio_write /dev/sda}
${diskiograph_read 20,60 -l} ${diskiograph_write 20,60 -l}
$hr
[processes]
${top name 1}
${top name 2}
${top name 3}
${top name 4}
${top name 5}
${top name 6}
${top name 7}secondary panel (mail, music etc.)
background no
out_to_console no
update_interval 1.0
short_units yes
format_human_readable yes
out_to_x yes
extra_newline no
use_xft yes
xftfont xft:Terminus:antialias=true:pixelsize=16:style=Regular
temperature_unit celcius
own_window yes
alignment middle_left
own_window_type panel
draw_borders yes
border_width 1
default_color ff7e00
double_buffer yes
use_spacer
gap_x 5
gap_y 0
mpd_host /home/<you>/.mpd/socket
own_window_argb yes
TEXT
[network]
${if_up wlp1s0}ID: ${wireless_essid wlp1s0}
BR: ${wireless_bitrate wlp1s0}% $else off $endif
$hr
[MPD]$if_mpd_playing
${mpd_status}
vol: ${exec amixer sget Master | sed -n "s/.*\([0-9][0-9]\)%.*/\1/p"}%
$color${scroll 15 3 $mpd_title}$color
$mpd_artist
$mpd_elapsed / $mpd_length
rep: $mpd_repeat
rand: $mpd_random $else
off $endif
$hr
[mailbox]
new: ${new_mails <path_to_maildir>}
unseen: ${unseen_mails <path_to_maildir>}
unanswered: ${unreplied_mails /home/bryant/.mail/gmx/INBOX}
drafts: ${draft_mails <path_to_maildir>}change the maildir and mpd paths and the default color to your liking. Modify as desired.
here is the toggle script. Just make it executable and bind it to a key (I use F1). I recommend using a single key for convenience.
#!/usr/bin/bash
if [ -z $(pidof conky) ]; then
conky -c ~/.conkyrc1 &
conky -c ~/.conkyrc2 &
else
pkill conky
fiA note: if you choose the second method, you'll have to remember to check it regularly to keep an eye on your battery, as it won't be in front of you all the time. If your battery supports it, write a udev rule with notify-send to alert you when the battery level drops too low. Or you can run the following script as a cron job every few minutes:
#!/bin/bash
level=$(cat /sys/class/power_supply/BAT1/capacity)
time=$(acpi -b | sed 's/.*\([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\).*/\1/')
if [ $level -le 10 ]; then
notify-send "battery" "charge level is low ($level)%\nest. time remaining: $time"
elif [ $level -le 5 ]; then
notify-send "battery" "charge level critical (<5%).\nplease recharge\nest. time remaining: $time"
fialter as necessary.
Best of luck! I hope this helps in some way.
Also, while this is a subject for a different thread, does anyone happen to know why my email didn't get through, as I mentioned above?
Offline