DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st August 2009
asemisldkfj's Avatar
asemisldkfj asemisldkfj is offline
Fdisk Soldier
 
Join Date: Aug 2008
Posts: 50
Thanked 1 Time in 1 Post
Default dwm status bar won't display apm output

this works fine running it from an xterm with dwm already running. mixerctl, apm, and date output all show up as expected.

Code:
xsetroot -name "volume: $(mixerctl -n outputs.master | sed 's/^[0-9]*,//g') | battery: $(apm -l)% | $(date "+%A, %B %e, %Y %r")"
however, if I put the same command in my .xsession file, the apm output disappears and all I see is "battery: %".

Code:
while true
do
xsetroot -name "volume: $(mixerctl -n outputs.master | sed 's/^[0-9]*,//g') | battery: $(apm -l)% | $(date "+%A, %B %e, %Y %r")"
done &
xbindkeys &
dwm
I can't figure out why the output of apm would disappear or be blank like that. maybe it has something to do with the environment that the .xsession script is run in or something. that's all I can think of. does anyone have any ideas?

I found this thread from the dwm mailing lists but it wasn't much help: http://www.mail-archive.com/dwm@suck.../msg02452.html
Reply With Quote
  #2   (View Single Post)  
Old 8th August 2009
asemisldkfj's Avatar
asemisldkfj asemisldkfj is offline
Fdisk Soldier
 
Join Date: Aug 2008
Posts: 50
Thanked 1 Time in 1 Post
Default

no one?
__________________
chat.taucher.net #bsd
Reply With Quote
  #3   (View Single Post)  
Old 9th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,066
Thanked 198 Times in 156 Posts
Default

I installed dwm and I have the same problem. Using xinit and ~/.xinitrc works fine though ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 9th August 2009
asemisldkfj's Avatar
asemisldkfj asemisldkfj is offline
Fdisk Soldier
 
Join Date: Aug 2008
Posts: 50
Thanked 1 Time in 1 Post
Default

thanks for the info, Carpetsmoker. I'll read up on xsession and xinitrc a little bit more and see if I can figure this out.
__________________
chat.taucher.net #bsd
Reply With Quote
  #5   (View Single Post)  
Old 10th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,066
Thanked 198 Times in 156 Posts
Default

I couldn't sleep and I looked at your problem a bit.

The issue is that apm lives in /usr/sbin/, by default this isn't in the PATH with xsession.
Using a full path solves the issue.
*Waits for asem to slap his forehead and shout do'h*

Guess you can also use set/export but I keep forgetting how to use that (Die hard csh user).

As a sidenote, I had some problems while testing with 10 different while loopsrunning in the background, so if you CTRL-ALT-BS or something like that remember to manually kill the sh instance running in the background.

Isn't there a better way do this with dwm?
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 16th August 2009
asemisldkfj's Avatar
asemisldkfj asemisldkfj is offline
Fdisk Soldier
 
Join Date: Aug 2008
Posts: 50
Thanked 1 Time in 1 Post
Default

thanks for the solution, Carpetsmoker . I ran whereis on mixerctl and the other stuff in the status bar, and at least one other thing was in /usr/bin, so I figured /usr/sbin would be in PATH if /urs/bin was. it's always those stupid assumptions that get me! also, I guess my initial suspicion was right in that it has to do with the environment that xsession runs in, because /usr/sbin is indeed in my user's and root's PATHs. must be whatever user xsession or xdm runs as.

you can do meta+shift+q to quit dwm, IIRC.
__________________
chat.taucher.net #bsd
Reply With Quote
  #7   (View Single Post)  
Old 16th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,066
Thanked 198 Times in 156 Posts
Default

Quote:
you can do meta+shift+q to quit dwm, IIRC.
That won't stop the while loop, because that's forked.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
strange dmesg output gosha OpenBSD General 4 11th March 2009 01:10 PM
Digital sound output Zodox FreeBSD General 5 12th November 2008 02:21 PM
Odd font display TerryP Feedback and Suggestions 4 2nd November 2008 11:22 AM
C and file input/output 18Googol2 Programming 3 20th August 2008 04:02 PM
strange security run output deadeyes FreeBSD Security 5 2nd July 2008 04:51 PM


All times are GMT. The time now is 08:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick