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
-Guest-
 
Posts: n/a
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
-Guest-
 
Posts: n/a
Default

no one?
Reply With Quote
  #3   (View Single Post)  
Old 9th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
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
-Guest-
 
Posts: n/a
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.
Reply With Quote
  #5   (View Single Post)  
Old 10th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
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
-Guest-
 
Posts: n/a
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.
Reply With Quote
  #7   (View Single Post)  
Old 16th August 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
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 09:47 AM.


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