You are not logged in.

#1 2007-12-07 17:50:33

barebones
Member
Registered: 2006-04-30
Posts: 235

Problem with Awesome wm Statusbar

I recently got a laptop and I've been playing around with tiling wm's so I don't have to use the touch pad as much. I really like awesome, and I really like how awesome-client works. Originally I was using xdm as my login manager and my script that piped text into awesome-client worked great, but xdm wouldn't kill it when I logged out. This means that I'd have multiple sets of text being sent to the status bar if I logged in again and bad things would happen.

Since this sort of behavior (leaving stuff running) is kind of dangerous in general, I switched over to qingy. I've always liked qingy, although it's a little difficult to set up sometimes. I have it set up, and everything seems to be running ok, but now when I log in through qingy awesome-client doesn't work. Running my script I had before gives this error:

 error sending datagram: file does not exist

even running tests from the command line like:

 echo 0 setstatustext "hello world" | awesome-client

give the same error. Has anyone seen this behavior, or have any ideas how this might be fixed?

Offline

#2 2007-12-07 18:50:11

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Problem with Awesome wm Statusbar

I don't know about quigy but I know the problem you're describing about the status bar scripts not being killed on log out.  The trick is not to have a separate script for status bar stuff, but to have everything in a single script that's also used to start the awesome session (like .xinitrc) - that way when you log out all the status bar stuff gets shut down as well.  You might have to play with sleep command because the latest version of awesome (rc2) doesn't like when awesome-client is called before awesome itself is running, but that's a minor issue.  If you want I can post the script I use - but I'd have to do it later today because I'm not home at the moment.

Offline

#3 2007-12-08 17:23:52

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: Problem with Awesome wm Statusbar

Well, I have been starting all of them from one script (.xinitrc in the case of xdm), although I was starting the statusbar script prior to awesome. I'd rather not just figure out how to format the .xinitrc so that xdm kills it, I'd rather use a login manager that actually kills a users programs after logout since being able to leave stuff running like that is pretty dangerous (IE. it'd be trivial to just leave a keylogger running and catch passwords).  That being said I'd love to take a look at your script if you'll post it, I haven't had much luck starting stuff after awesome either. Thanks!

Offline

#4 2007-12-08 18:55:28

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Problem with Awesome wm Statusbar

I use GDM because it works nicely with multi-monitor setup, and when using this script everything gets killed properly after I end my awesome session.  I've never tried this with XDM.  Anyways, that's what the script looks like (sorry, it's a bit messy):

#!/bin/bash
# Run some applications
xsetroot -bg black
eval $(cat ~/.fehbg)
nvidia-settings -a InitialPixmapPlacement=2 &
export OOO_FORCE_DESKTOP="gnome"
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval `dbus-launch --sh-syntax --exit-with-session`
fi
numlockx&
#xcompmgr&
#trackerd&
thunar --daemon&
urxvtd -q -o -f &
trayer --margin 1 --edge top --align right --padding 10 --width 10 --height 52 --transparent true --alpha 100  --tint 1 --SetDockType false --SetPartialStrut false &
sleep 1

# Set status text
while true
do
    date=`date +"%A %Y.%m.%d %l:%M" | sed 's/  / /g'`
    mpc_lines=`mpc | wc -l`
    vol=`mpc | grep 'volume:' | sed -e 's/volume: //' -e 's/ .*//g'`
    mpc_text="stopped"
    if [[ $mpc_lines -gt 1 ]]; then
        song=`mpc | head -1`
        status=`mpc | grep '^\[' | sed -e 's/ .*//' -e 's/[^a-zA-Z]//g'`
        mpc_text="$song"
    fi
    sleep 5
    echo "0 setstatustext MPD [$mpc_text] :: [$date]"
done | awesome-client&
while true
do
    used=`free -mo | grep '^Mem:' | awk '{print $3}'`
    buffers=`free -mo | grep '^Mem:' | awk '{print $6}'`
    cached=`free -mo | grep '^Mem:' | awk '{print $7}'`
    mem=`echo "$used-$buffers-$cached" | bc`
    temp1=`echo $(($(cat /sys/bus/pci/drivers/k8temp/0000\:00\:18.3/temp1_input) / 1000))C`
    temp2=`echo $(($(cat /sys/bus/pci/drivers/k8temp/0000\:00\:18.3/temp3_input) / 1000))C`
    load=`uptime | sed 's/.*: //g; s/,//g'`
    sleep 5
    echo "1 setstatustext MEM [$mem MB] :: TEMPS [$temp1 / $temp2] :: LOAD [$load]"
done | awesome-client&

# Run awesome
awesome

I'm not a coder so I'm sure there are more efficient ways of doing this - it seems to work fine though.  The fact that awesome-client is called twice is because I use two monitors with different status info.  Also, in the while true/done loop it is important to have sleep before echo - that way awesome-client waits until awesome is started and everything works fine.

Offline

Board footer

Powered by FluxBB