You are not logged in.
Hi,
I was able to set up a quite nice layout for xmonad and dzen. However I am unable to see any icon for the weather. I double checked in the shell that I typed the path to the icon correctly and everything seemed ok.
I also thought that I did not assigned enough space for the icon but I have a space of 20 by 20 for them.
So I do not really get why it is not working as I basically copied dzen wiki?
I also tried dmpipe without any succes. Here is what I am doing so if any of you had a set up for dmplex I would greatly appreciate. (by the way I am using zsh as shell)
mkfifo dmpipe
#tail -f dmpipe | dmplex | dzen2 -h 20 -x 1000 -ta r -fn '-*-liberation mono-*-r-*-*-10-*-*-*-*-*-*-*' -e '' &
#"1 "$volume > dmpipe
#"2 "$weather > dmpipe
FYI: my different dzen and script mem consumption
zsh (9) 7.3 M
sleep (4) 540k
dzen (5) 4.3 M
I will soon try to move to conky+dzen to see if I could improve that. And come back with new numbers
#!/bin/zsh
local colorText="#999F9F"
local FG='#aaaaaa'
local BG='black'
local FONT='-*-liberation mono-*-r-*-*-10-*-*-*-*-*-*-*'
local ICONPATH='/home/lymphatik/.xmonad/icons'
local BARH=8 # Height of gdbar
local BARW=50 # Width of gdbar
local WIFI=eth1
local MAXPOS="100"
local BARBG='#E1F2F7' # bg color gdbar
local BARFG='#999F9F' # fg color gdbar
local FW="mpc seek +5" # 5 sec forwards
local RW="mpc seek -5" # 5 sec backwards
local NEXTS="mpc next" # previous song
local PREVS="mpc prev" # next song
local TOGGS="mpc toggle" # play/pause
calendar(){
TODAY=$(expr `date +'%d'` + 0)
MONTH=`date +'%m'`
YEAR=`date +'%Y'`
while true
do
date +'%a.%d.%m %H:%M'
# current month, highlight header and today
cal | sed -r -e "1,2 s/.*/^fg(white)&^fg()/" -e "s/(^| )($TODAY)($| )/\1^bg(white)^fg(#111)\2^fg()^bg()\3/"
# next month, hilight header
[ $MONTH -eq 12 ] && YEAR=`expr $YEAR + 1`
cal `expr \( $MONTH + 1 \) % 12` $YEAR | sed -e "1,2 s/.*/^fg(white)&^fg()/"
sleep 60;
done
}
calendar | dzen2 -x 1120 -h 20 -w 160 -l 18 -ta r -sa c -fn $FONT &
# todo only change color of the icon
volume(){
#while [ $? -ne 1 -a $? -ge 0 ] && echo -n '^fg()'
while true
do
if (amixer sget Master | grep -qF '[off]')
then
color='#484C48'
icon=${ICONPATH}/spkr_02.xbm
else
color='#999F9F'
icon=${ICONPATH}/spkr_01.xbm
fi
perc=$(amixer sget Master | sed -ne 's/^.*Front Left: .*\[\([0-9]*\)%\].*$/\1/p')
echo "$perc" | gdbar -fg $color -s o -bg $BARBG -h $BARH -w $BARW -l "^fg($color)^i($icon)^p(2)^fg()"
inotifywait -t 30 /dev/snd/controlC0 -qq
done
}
volume | dzen2 -x 1115 -h 20 -w 65 -ta r -fn $FONT -e 'button1=exec:amixer -c 0 set Master toggle -q: amixer -c 0 set PCM toggle -q: amixer -c 0 set Surround toggle -q: amixer -c 0 set Center toggle -q: amixer -c 0 set LFE toggle -q;button4=exec:amixer -c 0 set Master 2dB+ -q: amixer -c 0 set PCM 2dB+ -q: amixer -c 0 set Surround 2dB+ -q: amixer -c 0 set Center 2dB+ -q: amixer -c 0 set LFE 2dB+ -q;button5=exec:amixer -c 0 set Master 2dB- -q: amixer -c 0 set PCM 2dB- -q: amixer -c 0 set Surround 2dB- -q: amixer -c 0 set Center 2dB- -q: amixer -c 0 set LFE 2dB- -q' &
gmail(){
while true
do
python ~/.xmonad/script/dzenGmailNotify/dzenGmailNotify.py
sleep 1800;
done
}
gmail | dzen2 -x 1075 -h 20 -w 30 -ta r -fn $FONT -e 'button1=exec:firefox mail.google.com/mail/#inbox' &
weather(){
while echo -n ' '
do
perl ~/.xmonad/script/dzenWeather/dzen_weather.pl
sleep 1800; # 30 min
done
}
weather | dzen2 -x 1005 -w 60 -h 20 -l 2 -sa r -ta r -fn $FONT &
mpdbar(){
while true;
do
POS=`mpc | sed -ne 's/^.*(\([0-9]*\)%).*$/\1/p'`
POSM="$POS $MAXPOS"
#echo -n "^i(${ICONPATH}/note.xbm) "
#TITLE=`mpc | sed -n '1p' | awk '{if ($1 != "volume:") print}'`" | tr '\n' ' '
TITLE="`mpc | sed -n '1p' | awk '{if ($1 != "volume:") print}'`"
echo -n "^i(${ICONPATH}/note.xbm) $TITLE[0,20] "
echo "$POSM" | gdbar -h $BARH -s o -w $BARW -fg $BARFG -bg $BARBG
sleep 1;
done
}
mpdbar | dzen2 -x 800 -w 190 -h 20 -ta r -fn $FONT -e "button4=exec:$RW;button5=exec:$FW;button1=exec:$PREVS;button3=exec:$NEXTS;button2=exec:$TOGGS" &
dzen_weather.pl
#!/usr/bin/perl
#
# (c) 2007 by Robert Manea
use Weather::Com::Finder;
# Fill with valid values
#
my $PartnerId = 'haha';
my $LicenseKey = 'youlou'';
my $iconpath = '/home/lymphatik/.xmonad/script/dzenWeather';
my %weatherargs = (
'partner_id' => $PartnerId,
'license' => $LicenseKey,
);
my $weather_finder = Weather::Com::Finder->new(%weatherargs);
# Fill in your location
my $locations = $weather_finder->find('Rouen, France');
my $temp_today = $locations->[0]->current_conditions()->windchill();
my $icon_today = $locations->[0]->current_conditions()->icon();
my $hum_today = $locations->[0]->current_conditions()->humidity();
my $forecast = $locations->[0]->forecast();
#tomorrow
my $htemp_tomorrow = $forecast->day(1)->high();
my $ltemp_tomorrow = $forecast->day(1)->low();
my $icon_tomorrow = $forecast->day(1)->day->icon();
#day 2
my $htemp_day2 = $forecast->day(2)->high();
my $ltemp_day2 = $forecast->day(2)->low();
my $icon_day2 = $forecast->day(2)->day->icon();
my $wvar ="^i(${iconpath}/${icon_today}-scaled.xpm)^p(2)${temp_today}° ${hum_today}%\n".
"^p(4)^i(${iconpath}/${icon_tomorrow}-scaled.xpm)^p(2)${htemp_tomorrow}° ${ltemp_tomorrow}°\n".
"^p(4)^i(${iconpath}/${icon_dat}-scaled.xpm)^p(2)${htemp_day2}° ${ltemp_day2}°";
print "$wvar", "\n";
Offline
hello. i want to try dzen with kde. i have a few questions:
1) how can i set window rules for it? (i want to make it slightly transparent)
2) can i make it act like a panel so other windows dont maximize over it?
thanks in advance for your help.
Desktop/Laptop - DWM :: VM - screen
Registered Linux User Number 483137 :: Victory! :: GitHub
Offline
1. dzen2 is not capable of transparency afaik, without using ugly a workaround such as devilspie and transset.
2. dzen2 has a "-dock" option, perhaps you should try this.
Offline
stngth=`iwconfig wlan0 | awk -F '=' '/Quality/ {print $2}' | cut -d '/' -f 1` bars=`expr $stngth / 10` case $bars in 0) bar='[-------]' ;; 1) bar='[#------]' ;; 2) bar='[##-----]' ;; 3) bar='[###----]' ;; 4) bar='[####---]' ;; 5) bar='[#####--]' ;; 6) bar='[######-]' ;; 7) bar='[#######]' ;; *) bar='[--!!!--]' ;; esac echo $essid$bar fi
Just thought I'd point out you can do a similar bar within awk itself, and so avoid extra processing in the shell. Since you're already using awk, you might as well do the lot with awk. Also, I like to avoid as many external commands as possible to minimise the shell's resource use (every external command spawns a sub-shell, which is very slow in terms of processing), so I use this instead of calling gdbar or dbar. This is for a small volume graph:
amixer | awk 'BEGIN { FS="[\\[\\]]" } ; / Front/ { printf "%i%%[%-5.*s]", $2, ($2+10)/20, "=====" ; exit }'
which produces, for example, "83%[==== ]", or "25%[== ]".
For those who want the details, BEGIN, FS , "/ Front" and "exit" are setting things up to get the first line of output from amixer that has the string " Front", putting the volume into parameter $2, and then quitting without processing any more lines since I'm only interested in the Master volume.
The guts are in the printf statement, which you could use for any type of bar graph. It outputs the volume as an integer percent "%i%%" from the first of printf's parameters ($2), then a '[' char, then a '=' for each 20%, then spaces and a ']' char. "%-5.*s" means a string left-aligned 5 chars wide, with the number of chars to output from the next in the list of printf's parameters ("($2+10)/20"), and the chars themselves from the next after that of printf's parameters ("=====").
HTH,
Nick
Offline
1. dzen2 is not capable of transparency afaik, without using ugly a workaround such as devilspie and transset.
2. dzen2 has a "-dock" option, perhaps you should try this.
-dock is an invalid option. has it changed or something?
Desktop/Laptop - DWM :: VM - screen
Registered Linux User Number 483137 :: Victory! :: GitHub
Offline
However I am unable to see any icon for the weather
The weather icons are .xpm and dzen does not compile with xpm or xinerama support by default. to remedy this download the source:
svn co http://dzen.google.code/svn/trunk dzensrc
make sure you have libxpm-dev and recompile/install with the apropriate bits commented/uncommented in the config.mk file.
Offline
thanks it worked perfectly
Offline
I'm sorry if this isn't the better thread for this action, but I compiled dzen2 with XFT support but I can't set them.
For example:
tvale@~ % echo "Hello, world" | dzen2 -fn 'Droid Sans Mono' -p
dzen: error, cannot load font: 'Droid Sans Mono'
Or even:
tvale@~ % echo "Hello, world" | dzen2 -fn "Monospace" -p
dzen: error, cannot load font: 'Monospace'
Can anyone help me please? :s
Offline
dzen: error, cannot load font: 'Verdana-8'
I don't use a xorg.conf, but the Xorg.0.log show that /usr/share/fonts/TTF is there.
Offline
Well, that did it. Weird, maybe the community package doesn't support XFT?
Thank you!
Offline
Well I did, I changed the PKGBUILD of the community package.
My bad.
Offline
Hello,
I've got a problem with dzen. Aligning it to be perfectly exact. I'm outputting conky-cli to dzen, and it's behaviour is really weird. Well I've read somewhere one the forums, that ^p(_CENTER) put between elements you want on the edges of the screen does the trick, but for me it only puts some extra space inbetween. So I tried to do it with ^p(_LEFT) and ^p(_RIGHT), but ^p(_RIGHT) seems to move content too far to the right. It's obious - if the position of X is set to _RIGHT everything will be displayed after it, so over the edge of the bar. Is there any nice way to make stuff alight both left and right on one dzen bar? Doing ^p(-X) won't do the trick, cause when conky content changes dynamically it may not have enough space and dissapear over the edge of the screen.
I already have 3 dzen instances @ my xmonad (one with layouts/workspaces, one with date [didn't want to mess with multiplexer] and one in the bottom to display some other system monitors etc) so I'd rather not create another instance of dzen. Possible? What do you advise?
Offline
How can i make dzen appear on all my multiple monitors?
And someone know of a font with the Arch logo? or something i could use to make it red if i have updates to do and gray if im up to date/
Thanks and greetings.
Offline
YamiFrankc:
If you are using Xinerama use the -xs switch. http://dzen.geekmode.org/dwiki/doku.php … ption-list
For the font use Openlogos. http://aur.archlinux.org/packages.php?ID=17219
And here is a basic example of a script that does what you ask for:
# Set up at crontab that syncs your db regularly - like every 30 minutes: */30 * * * * pacman -Sy
paccheck=$(pacman -Qu | wc -l)
if [ $paccheck -gt 0 ]; then
echo "A" | dzen2 -fg red -fn openlogos-22 -p &
else
echo "A" | dzen2 -fn openlogos-22 -p &
fi
Use dzen2-svn from the aur. http://aur.archlinux.org/packages.php?ID=19926
Offline
Thanks Ashren.
Im using Conky-cli to all other things, but found a thing i cant solve. Seems like the colors i set up on my conky file don't go to to dzen.
TEXT
{$color red} ${mpd_elapsed}/${mpd_length} ${mpd_smart} [${mpd_status}] ${color }
When i output it to dzen i just get gray fg.
How can i color make it colorful?
Last edited by YamiFrankc (2009-12-18 19:26:30)
Thanks and greetings.
Offline
That is because dzen2 does not recognize the conky syntax. With conky-cli you are combining conky and dzen2 with different syntaxes using conky to create the output and dzen2 to render it. So in order for dzen2 to recognize the colors you want your example should be configured using dzen2's syntax for colors:
TEXT
^fg(red) ${mpd_elapsed}/${mpd_length} ${mpd_smart} [${mpd_status}]
Offline
just discovered dzen2 it rocks
is there any way to make the text scroll across like a news banner on tv?
thanks Markp1989
Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD
Offline
markp1989: Perhaps you could get some inspiration from this: http://dzen.geekmode.org/dwiki/doku.php … ittscanner script.
I think it will take some serious tinkering to acheive.
Edit: Found this script by Xyne; http://bbs.archlinux.org/viewtopic.php?id=53761 try using it with conky-cli and see if it works.
Last edited by Ashren (2009-12-28 22:11:37)
Offline
Hey everyone, i currently have a setup of Gnome + Openbox + PyTyle. You might ask why i installed so many things...it's because i want to emulate awesome3/xmonad but still have nautilus. I've tried installing nautilus on top of awesome3 and it just couldn't work well because it wouldn't mount and everytime i open it, it takes over awesome3's desktop. I also couldn't figure out how to theme awesome3 with beautiful because i didn't know where the config file is.
I was wondering how config dzen in my gnome + openbox setup to have a panel like awesome3's default panel that allows me to access different workspaces, shows the windows i have opened so i can click on them, and to also show the clock and such. I'm hoping someone can tell me where the config file is after i install dzen and how to load it. Thanks!
P.S. If anyone tells me to just install awesome3 and try nautilus/thunar again i don't want to because i like how i can still freely move windows around with openbox even when i have my windows all tiled up. I will definitely think of just installing Openbox + PyTyle with nautilus and dzen if i can figure out how to work with dzen.
Offline
Hi,
I also tried dmpipe without any succes. Here is what I am doing so if any of you had a set up for dmplex I would greatly appreciate. (by the way I am using zsh as shell)mkfifo dmpipe #tail -f dmpipe | dmplex | dzen2 -h 20 -x 1000 -ta r -fn '-*-liberation mono-*-r-*-*-10-*-*-*-*-*-*-*' -e '' & #"1 "$volume > dmpipe #"2 "$weather > dmpipe
This should work:
tail -f | dmplex | dzen2
echo "1" | $whatever > dmpipe
Offline
Hey everyone, a while ago i tried using xmonad and awesome and liked it a lot. But for personal reasons i decided to use openbox + gnome + pytyle instead and i love it. However, i miss the panel that awesome has and was wondering if dzen can be used to emulate that panel in openbox + gnome, or just openbox alone. I know how to install dzen, but i need help learning how to configure dzen from scratch. Help would really be appreciated.
Offline
The only real problem I have (other than running out of pixels) is that the script doesn't quit cleanly. To reload it I have to run "killall dzonky dzen2 inotail watchfile inotifywatch ;sleep 1; dzonky". If anybody has some suggestions to work around this, I'm all ears. Also, i get segfaults if I use scrolling and ^cs(), but i use $EVENTSCLEARABLE to get around that for now.
I realize this is a really old post, but I haven't seen an answer anywhere else yet. I dealt with a similar problem, albeit in xmobar. You could probably apply the same logic.
Anyway, I have a while loop running forever, spitting out updates when relevant, and waiting the rest of the time. Instead of using "while [ true ]" I set up a condition that checks if the script's parent is my xmobar. If xmobar dies, the loop breaks and the script ends. Incidentally, the script also checks that its command completed successfully by testing "$?", but that's just because it uses inotify-tools, which is not standard (at least in debian, which is my distro of choice (although Arch has better forums)).
Anyway, here's the script. I use it to update the volume in my xmobar. This doesn't use polling and it actually listens to volume changes from other users, so I'm pleased with it. The relevant line is the while loop:
#!/bin/sh
# Prints volume changes to stdout.
# Depends on inotify-tools package
SOUND_DEV="/dev/snd/controlC1"
volume() {
amixer -D default sget Master,0 \
| grep dB \
| head -n 1 \
| cut -f 7 -d " " \
| sed -e's/\[//g' -e 's/\]//g'
}
# loop only runs when inotify didn't fail (not present on all systems)
# and when parent process is xmobar. this _should_ ensure script quits after xmonad resets
while [ $? -eq 0 ] && [[ $(ps p $PPID | grep xmobar) ]];
do
volume
inotifywait $SOUND_DEV -e ACCESS -e CLOSE_WRITE > /dev/null 2>/dev/null
done
Offline