You are not logged in.

#126 2008-02-04 00:42:57

sm4tik
Member
From: Finland, Jyväskylä
Registered: 2006-11-05
Posts: 248
Website

Re: dzen & xmobar Hacking Thread

peets wrote:

Probably the best way is to use two instances of dzen, each getting updated at different intervals.

If using two or more instances of dzen, I've found redbeard0531's script to be very useful. So whether you do it this or that way, it's all in this thread. But I also know it's not that obvious if just browsing through the pages wink

Offline

#127 2008-02-04 11:22:44

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: dzen & xmobar Hacking Thread

dax965 wrote:

How do I get different sleep timers for different things?  I want a 1 second timer on my eth0 monitor, and a 60 second timer on my Gmail notifier.

You can also use the multiplexer (dmplex) for this task.

Actually there are lots of ways to implement that functionality either in a polling or event based way...

Last edited by gotmor (2008-02-04 11:23:45)

Offline

#128 2008-02-06 18:46:20

Evanlec
Member
From: NH, USA
Registered: 2007-12-16
Posts: 141
Website

Re: dzen & xmobar Hacking Thread

sm4tik wrote:
peets wrote:

Probably the best way is to use two instances of dzen, each getting updated at different intervals.

If using two or more instances of dzen, I've found redbeard0531's script to be very useful. So whether you do it this or that way, it's all in this thread. But I also know it's not that obvious if just browsing through the pages wink

I've been trying out redbeards dzonky script...but i find that it has a memory leak. for example if i leave the script running overnight, i'll wake up to ram usage of 1.8GB out of 2GB total and X usually frozen.

not sure if you're experiencing this or not, i did modify his script a bit tho. so it may have been my fault.

Offline

#129 2008-02-06 21:39:16

buttons
Member
From: NJ, USA
Registered: 2007-08-04
Posts: 620

Re: dzen & xmobar Hacking Thread

Evanlec wrote:
sm4tik wrote:
peets wrote:

Probably the best way is to use two instances of dzen, each getting updated at different intervals.

If using two or more instances of dzen, I've found redbeard0531's script to be very useful. So whether you do it this or that way, it's all in this thread. But I also know it's not that obvious if just browsing through the pages wink

I've been trying out redbeards dzonky script...but i find that it has a memory leak. for example if i leave the script running overnight, i'll wake up to ram usage of 1.8GB out of 2GB total and X usually frozen.

not sure if you're experiencing this or not, i did modify his script a bit tho. so it may have been my fault.

That's a problem with dzen-svn.  It's a resource leak (using xrestop you can verify this yourself if you like).


Cthulhu For President!

Offline

#130 2008-02-07 00:43:18

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: dzen & xmobar Hacking Thread

buttons wrote:
Evanlec wrote:
sm4tik wrote:

If using two or more instances of dzen, I've found redbeard0531's script to be very useful. So whether you do it this or that way, it's all in this thread. But I also know it's not that obvious if just browsing through the pages wink

I've been trying out redbeards dzonky script...but i find that it has a memory leak. for example if i leave the script running overnight, i'll wake up to ram usage of 1.8GB out of 2GB total and X usually frozen.

not sure if you're experiencing this or not, i did modify his script a bit tho. so it may have been my fault.

That's a problem with dzen-svn.  It's a resource leak (using xrestop you can verify this yourself if you like).

Right, that was a problem with a particular SVN revision but it's fixed since several revisions.

Offline

#131 2008-02-07 07:16:49

Evanlec
Member
From: NH, USA
Registered: 2007-12-16
Posts: 141
Website

Re: dzen & xmobar Hacking Thread

alright cool...
having trouble building the latest dzen2-gadgets-svn package from AUR using yaourt:
my output:

http://pastebin.archlinux.org/26792

sed: -e expression #1, char 26: unterminated `s' command
Error: Makepkg was unable to build dzen2-gadgets-svn package.

not sure as i dont see any sed expressions in the PKGBUILD file.

Last edited by Evanlec (2008-02-07 07:17:06)

Offline

#132 2008-02-08 11:53:55

Don-DiZzLe
Member
From: Nederland
Registered: 2007-03-31
Posts: 233

Re: dzen & xmobar Hacking Thread

Maybe u could try compiling it without yaourt, it works fine for me.

Offline

#133 2008-02-08 12:54:12

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: dzen & xmobar Hacking Thread

tch wrote:

Hey guys, can I have a little bit of help ? I dont understand how the menuexec thing is working. I am trying to do a wallpaper change script, not like change my wallpaper a lot, just thought it may be useful for someone.

# background changer script

. ~/.dzen2/dzen.conf

# direcory with images
DIR='/home/tch/images'
COUNT=`ls -l $DIR | wc -l`
COUNT=`expr $COUNT - 1`
# commad to set the background
SETBG="feh --bg-scale $DIR/"

# menu title
echo "V" > file

for i in $(ls $DIR); do
    echo $i >> file
done

dzen2 -fn $FONT -x 800 -y 0 -tw 30 -ta c -sa l -w 400 -p -l $COUNT -m < file -e "entertitle=uncollapse;leaveslave=collapse"

Can someone explain how to execute a command ( SETBG ) with the selected menu option as an argument ? I hope it is clear.

Sure:

#!/bin/sh
# background changer script

# direcory with images
DIR='/home/tch/images'
COUNT=$(expr `ls $DIR | wc -l` - 1) && [ $COUNT -gt 30 ] && COUNT=30                                                                                  

(echo V;
 for i in $(ls $DIR); do
     echo $i
 done 
) \
| dzen2 -x 800 -ta c -sa l -tw 30 -w 400 -p -l $COUNT -m \
  -e 'entertitle=uncollapse;leaveslave=collapse;button4=scrollup;button5=scrolldown;button1=menuprint;button3=exit' \
| while read FNAME; do feh --bg-scale "$FNAME"; done

HTH, Rob.

Last edited by gotmor (2008-02-08 13:06:50)

Offline

#134 2008-02-08 17:44:55

tch
Member
From: Slovakia
Registered: 2007-10-07
Posts: 31

Re: dzen & xmobar Hacking Thread

Thanks for the reply, it works

Offline

#135 2008-02-11 06:08:36

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: dzen & xmobar Hacking Thread

Do you pronounce dzen using one syllable or two ("D-Zen")?

Offline

#136 2008-02-11 10:10:18

Evanlec
Member
From: NH, USA
Registered: 2007-12-16
Posts: 141
Website

Re: dzen & xmobar Hacking Thread

gotmor wrote:
buttons wrote:
Evanlec wrote:

I've been trying out redbeards dzonky script...but i find that it has a memory leak. for example if i leave the script running overnight, i'll wake up to ram usage of 1.8GB out of 2GB total and X usually frozen.

not sure if you're experiencing this or not, i did modify his script a bit tho. so it may have been my fault.

That's a problem with dzen-svn.  It's a resource leak (using xrestop you can verify this yourself if you like).

Right, that was a problem with a particular SVN revision but it's fixed since several revisions.

Alright i got the newer svn version running and the memory leak seems to be fixed. thx for the infos smile

Offline

#137 2008-02-11 10:10:23

Don-DiZzLe
Member
From: Nederland
Registered: 2007-03-31
Posts: 233

Re: dzen & xmobar Hacking Thread

The volumeter from the wiki doesn't work right anymore with the latest dzen.

Offline

#138 2008-02-11 12:00:30

jonkristian
Member
From: Norway
Registered: 2007-03-09
Posts: 101
Website

Re: dzen & xmobar Hacking Thread

The weather script, very interesting, but is this feature through weather.com only for us. residents?
I've registered but I can't seem to find the correct customer ID/KEY...

quarks wrote:

Thought I'd share my dzen config I have so far.

http://goox.net/joost/screenshots/dzen.png

Requires mocp and Rob's weather script.

#!/bin/zsh
#
# Dzen statusbar, compiled from various sources
# Requires weather.com key and mocp
##################################################################

# Configuration
##################################################################
# Dzen's font
DZENFNT="-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*"
# Dzen's background colour
DZENBG='#000000'
# Dzen's forground colour
DZENFG='#999999'
# Dzen's X position
DZENX=780
# Dzen's Y posit
DZENY=1
# Dzen's width
DZENWIDTH=2000
# Dzen's alignment (l=left c=center r=right)
DZENALIGN=l
# Gauge background colour
GAUGEBG='#323232'
# Gauge foreground colour
GAUGEFG='#8ba574'
# Path to your Dzen icons
ICONPATH=/home/quarks/dzen/dzen_bitmaps
# Network interface
INTERFACE=eth0
# Sound device for volume control
SNDDEVICE=Master
# Date formating
DATE_FORMAT='%A, %d.%m.%Y %H:%M:%S'
# What tiem zones to use
TIME_ZONES=(Australia/Sydney America/Los_Angeles America/New_York)
# Path to weather script
WEATHER_FORECASTER=/home/quarks/dzen/dzenWeather.pl
# Main loop interval in seconds
SLEEP=1

# Function calling intervals in seconds
DATEIVAL=20
GTIMEIVAL=60
CPUTEMPIVAL=60
MUSICIVAL=2
VOLUMEIVAL=1
# Update weather every 30 minutes
WEATHERIVAL=1800
##################################################################


# Time and date 
##################################################################
DATE_FORMAT='%A, %d.%m.%Y %H:%M:%S'

fdate() {
    date +${DATE_FORMAT}
}
##################################################################


# Global time
##################################################################
fgtime() {
    local i

    for i in $TIME_ZONES
        { print -n "${i:t}:" $(TZ=$i date +'%H:%M')' ' }
}
##################################################################

# CPU use
##################################################################
fcpu() {
   gcpubar -c 5 -i 0.1 -fg $GAUGEFG -bg $GAUGEBG -h 7 -w 70 | tail -1
}
##################################################################


# CPU temp   
##################################################################
fcputemp() {
   print -n ${(@)$(</proc/acpi/thermal_zone/THRM/temperature)[2,3]}
}
##################################################################


# HD partitions used and free space
##################################################################
fhd() {
   # Todo
}
##################################################################

# Network
##################################################################

# Here we remember the previous rx/tx counts
RXB=`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`
TXB=`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`


# MOCP song info and control
##################################################################
fmusic() {
   artist=`mocp -i | grep 'Artist' | cut -c 8-`
   songtitle=`mocp -i | grep 'SongTitle' | cut -c 11-`
   totaltime=`mocp -i | grep 'TotalTime' | cut -c 12-`
   currenttime=`mocp -i | grep 'CurrentTime' | cut -c 14-`
   state=`mocp -i | grep 'State' | cut -c 8-`
   print -n "$(echo $artist -$songtitle [)$(echo $currenttime/$totaltime] [)$(echo $state])"
}

# For Creative Audigy 2 ZS
fvolume() {
    percentage=`amixer sget Master | sed -ne 's/^.*Mono: .*\[\([0-9]*\)%\].*$/\1/p'`
    # print -n "$(echo $percentage | gdbar -fg $GAUGEFG -bg $GAUGEBG -h 7 -w 60)"

if [[ $percentage == 100 ]]
then
    print -n "$(echo $percentage | gdbar -fg '#319845' -bg $GAUGEBG -h 7 -w 60)" # Volume full
elif [[ $percentage -gt 50 ]]
then
    print -n "$(echo $percentage | gdbar -fg '#7CA655' -bg $GAUGEBG -h 7 -w 60)" # Volume half to full
elif [[ $percentage -gt 25 ]]
then
    print -n "$(echo $percentage | gdbar -fg $GAUGEFG -bg $GAUGEBG -h 7 -w 60)" # Volume quarter to half 
elif [[ $percentage -lt 26 ]]
then
    print -n "$(echo $percentage | gdbar -fg '#888E82' -bg $GAUGEBG -h 7 -w 60)" # Volume low to quarter
fi

}


# Command to toggle pause/unpause
TOGGLE="mocp -G"
# Command to increase the volume
CI="amixer -c0 sset Master 2dB+ >/dev/null"
# Command to decrease the volume
CD="amixer -c0 sset Master 2dB- >/dev/null"
##################################################################


# Weather script
##################################################################
fweather() {
   $WEATHER_FORECASTER
   }
##################################################################  



# Main function
##################################################################

DATECOUNTER=0;GTIMECOUNTER=0;CPUTEMPCOUNTER=0;MUSICCOUNTER=0;WEATHERCOUNTER=0;VOLUMECOUNTER=0

# Execute everything once
PDATE=$(fdate)
PGTIME=$(fgtime)
PCPU=$(fcpu)
PCPUTEMP=$(fcputemp)
PHD=$(fhd)
PVOLUME=$(fvolume)
PMUSIC=$(fmusic)
PWEATHER=$(fweather)

# Main loop
while :; do

PCPU=$(fcpu)
PHD=$(fhd)

   if [ $DATECOUNTER -ge $DATEIVAL ]; then
     PDATE=$(fdate)
     DATECOUNTER=0
   fi

   if [ $GTIMECOUNTER -ge $GTIMEIVAL ]; then
     PGTIME=$(fgtime)
     GTIMECOUNTER=0
   fi

   if [ $CPUTEMPCOUNTER -ge $CPUTEMPIVAL ]; then
     PCPUTEMP=$(fcputemp)
     CPUTEMPCOUNTER=0
   fi

   if [ $MUSICCOUNTER -ge $MUSICIVAL ]; then
     PMUSIC=$(fmusic)
     MUSICCOUNTER=0
   fi

   if [ $VOLUMECOUNTER -ge $VOLUMEIVAL ]; then
     PVOLUME=$(fvolume)
     VOLUMECOUNTER=0
   fi

   if [ $WEATHERCOUNTER -ge $WEATHERIVAL ]; then
     PWEATHER=$(fweather)
     WEATHERCOUNTER=0
   fi

    # Get new rx/tx counts
    RXBN=`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`
    TXBN=`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`

    # Calculate the rates
    # format the values to 4 digit fields
    RXR=$(printf "%4d\n" $(echo "($RXBN - $RXB) / 1024/${SLEEP}" | bc))
    TXR=$(printf "%4d\n" $(echo "($TXBN - $TXB) / 1024/${SLEEP}" | bc))

    # Print out 
    echo "| ^fg(#80AA83)^p(0)^i(${ICONPATH}/load.xbm) ^fg()${PCPU} | ^fg(#80AA83)^i(${ICONPATH}/temp.xbm)^fg()${PCPUTEMP}° | ${INTERFACE}:^fg(white)${RXR}kB/s^fg(#80AA83)^p(0)^i(${ICONPATH}/arr_down.xbm)^fg(white)${TXR}kB/s^fg(orange3)^p(0)^i(${ICONPATH}/arr_up.xbm)^fg() | ^fg()${PGTIME}| ^fg(#FFFFFF)${PDATE}   ^fg()Eindhoven: ^fg()${PWEATHER} | ^fg(#80AA83)^p(0)^i(${ICONPATH}/volume.xbm)^fg()${PVOLUME} | ^fg(#80AA83)^p(0)^i(${ICONPATH}/music.xbm)^fg()${PMUSIC}"

    # Reset old rates
    RXB=$RXBN; TXB=$TXBN

   DATECOUNTER=$((DATECOUNTER+1))
   GTIMECOUNTER=$((GTIMECOUNTER+1))
   CPUTEMPCOUNTER=$((CPUTEMPCOUNTER+1))
   WEATHERCOUNTER=$((WEATHERCOUNTER+1))
   MUSICCOUNTER=$((MUSICCOUNTER+1))
   VOLUMECOUNTER=$((VOLUMECOUNTER+1))

sleep $SLEEP

# Pass it to dzen
done | dzen2 -bg $DZENBG -fg $DZENFG -x $DZENX -y $DZENY -ta $DZENALIGN -h 16 -p -e "button2=exec:$TOGGLE;button4=exec:$CI;button5=exec:$CD" -fn $DZENFNT

Screenshot:
http://goox.net/joost/screenshots/deskt … -thumb.png


PROCRASTINATION
is like masturbation...it's good in the beginning, but in the end, you realize
you've just fkd yourself

Offline

#139 2008-02-14 18:58:01

Evanlec
Member
From: NH, USA
Registered: 2007-12-16
Posts: 141
Website

Re: dzen & xmobar Hacking Thread

Yea I'm using the weather.com script thingy, but how do I change it to English units ? Farenheight specifically.
seems to be all in Celcius

Offline

#140 2008-03-17 21:21:16

wyvern
Member
From: 'Old' Scottish/English border.
Registered: 2008-01-06
Posts: 70

Re: dzen & xmobar Hacking Thread

Okay, here's another embarrassed-newbie-at-the-scripting-of-dzen2 problem.

Well, I was okay; had a nice setup using conky | dzen2, but then I *had* to go and try my hand at dmplexing everything...

What am I doing wrong here? I start the following script running in the background, and in my .xinitrc I have 'tail -f /home/sapphire/.dzenpipe | dmplex | dzen2 -e 'entertitle=uncollapse;leavetitle=collapse' -x '0' -h '18' -ta l -bg '#000000' -fg '#ffffff' -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-*-*' -u &'

#!/bin/sh
MOC='/home/sapphire/.moc/stats | fold -w60 -s'
TITLE='/home/sapphire/.moc/stats2 | fold -w40 -s'

echo "1 `conky &`" > /home/sapphire/.dzenpipe
echo "2 (echo '^tw()^fg(#a6b38d)^i(/home/sapphire/.dzen/xbm2/mpd.xbm)^fg(ffffff)^fn(-*-fixed-*-*-*-*-10-*-*-*-*-*-*-*)^p(5)`$TITLE`'; while true; do echo '^p(5) ^l(2)`$MOC`'; sleep 20; done)" > /home/sapphire/.dzenpipe

And yes, I have made the appropriate pipe tongue

All I get is the dzen bar running, no output to it at all. In the console I tested it from conky is also running, but not outputting to the 'bar.

It's something blindingly simple, (probably all in the syntax), but I am at a loss here roll All help is appreciated.

Offline

#141 2008-03-17 21:34:26

redbeard0531
Member
Registered: 2007-12-28
Posts: 12

Re: dzen & xmobar Hacking Thread

the echo lines wont work as intended. to get the effect you want insert this awk command into your pipeline, replacing 1 with the number you want prefixed to each line.

 <in_command> | awk '{print "1", $0}' | <out_command>

example:

conky | awk '{print "1", $0}' > /home/sapphire/.dzenpipe &

Last edited by redbeard0531 (2008-03-17 21:36:19)

Offline

#142 2008-03-17 22:27:08

wyvern
Member
From: 'Old' Scottish/English border.
Registered: 2008-01-06
Posts: 70

Re: dzen & xmobar Hacking Thread

redbeard0531 wrote:
conky | awk '{print "1", $0}' > /home/sapphire/.dzenpipe &

Ah... I tried this exactly, commenting out the other lines to see if worked at all. It doesn't.

Am I just being incredibly dense at this point, or is there something more I should be doing? (And if I don't reply today, I've gone to get some much-needed sleep - can you tell I'm tired?) big_smile

Thanks again for your help.

Offline

#143 2008-04-08 12:40:40

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: dzen & xmobar Hacking Thread

Hey.

Due to massive spam attacks I had to move the dzen wiki to an engine that allows better authentication.

The new Wiki can be found here:
http://dzen.geekmode.org/dwiki/doku.php

Have fun, Rob.

Offline

#144 2008-04-17 01:09:07

brncmp
Member
Registered: 2008-02-29
Posts: 21

Re: dzen & xmobar Hacking Thread

Hello,

I trying to use conky-cli with dzen2 and I'm having problems.

I want to use some of the wireless variables that conky has but they seem not to work in the cli version.

I notice when compiling cli (what i presume) wireless support is not compiled in.  If this is true how can be turned on?

The variables that I want to use are wireless_link_qual and wireless_essid.

Thanks,
brncmp

Offline

#145 2008-04-17 03:59:03

semdornus
Member
From: Tokyo
Registered: 2007-08-07
Posts: 47

Re: dzen & xmobar Hacking Thread

brncmp wrote:

I notice when compiling cli (what i presume) wireless support is not compiled in.  If this is true how can be turned on?

Add wireless_tools to the depends line. depends=('glib2', 'wireless_tools')
And add --enable-wlan to the configure line. Update the md5sum: makepkg -g >> PKGBUILD and then recompile.

Offline

#146 2008-04-17 04:06:20

semdornus
Member
From: Tokyo
Registered: 2007-08-07
Posts: 47

Re: dzen & xmobar Hacking Thread

I don't use it myself, but I stumbled across a Twitter client for dzen (written in Haskell) and I thought people might like to know. smile
dtwitzen with short description in (broken) English can be found on this page: http://eof.jp/dtwitzen/
For those who read Japanese; a small blog post from the author describing it here: http://d.hatena.ne.jp/smly/20080304

Offline

#147 2008-04-17 11:19:48

brncmp
Member
Registered: 2008-02-29
Posts: 21

Re: dzen & xmobar Hacking Thread

THANKS semdornus,

That works great, just what I  wanted.  How did you know to use --enable-wlan?  I couldn't find that argument any where.

anyway thanks again,

brncmp

Offline

#148 2008-04-18 01:04:50

semdornus
Member
From: Tokyo
Registered: 2007-08-07
Posts: 47

Re: dzen & xmobar Hacking Thread

brncmp wrote:

How did you know to use --enable-wlan?  I couldn't find that argument any where.

You can (usually) find out all the available options of a program, after you've downloaded and extracted the source,
by doing "./configure --help" in that directory. (Sometimes you have to run autogen.sh first).

Of course you can also take a look at the PKGBUILD of the official package or use a Google query.

Offline

#149 2008-06-20 05:02:52

scj
Member
From: Sweden
Registered: 2007-09-23
Posts: 158

Re: dzen & xmobar Hacking Thread

I've run into some trouble with dmplex and I was wondering if anyone could give me some advice. I realized that the only use I really had for a tray is pidgin message notification and I figured that I might as well use dmplex and pidgin to do it. I found this plugin that seems to do what I want, more or less. I made these modifications to be able to specify what and where to write it. Problem is, my dzen bar goes completly crazy as soon as I enable the plugin and start sending stuff to the fifo pipe. Could someone give me some pointers on what I am doing wrong and why dmplex gets confused by the pidgin plugin.

Offline

#150 2008-06-21 12:01:12

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: dzen & xmobar Hacking Thread

scj wrote:

I've run into some trouble with dmplex and I was wondering if anyone could give me some advice. I realized that the only use I really had for a tray is pidgin message notification and I figured that I might as well use dmplex and pidgin to do it. I found this plugin that seems to do what I want, more or less. I made these modifications to be able to specify what and where to write it. Problem is, my dzen bar goes completly crazy as soon as I enable the plugin and start sending stuff to the fifo pipe. Could someone give me some pointers on what I am doing wrong and why dmplex gets confused by the pidgin plugin.

Can you provide some sample input that you feed to dmplex?

Offline

Board footer

Powered by FluxBB