Page 1 of 1

Re: New on the market / Fresh from the repos

Posted: Sun Aug 25, 2013 12:46 am
by pidsley
^ I think maybe dkeg saw a ghost pidsley post. I posted about "osd_cat" (from the xosd-bin package) a tiny utility I found that prints on the root window. I was looking for another way to display system status and an excuse to learn more awk.

Image

Read the osd_cat man page for more information.

Re: New on the market / Fresh from the repos

Posted: Sun Aug 25, 2013 1:07 am
by dkeg
Funny you found and brought this up. I posted a bit ago that I was playing around with displaying system into through dunst as a conky replacement. I lost that did but did recently start again. This seems similar. My awk and sed skills are weak so I need to work on it.

Both seem to do what initially was my goal, show it when I ask, otherwise don't bother me.

Edit ... Wanted to add, interesting we were working on the same thing simultaneously but though different avenues.

Re: New on the market / Fresh from the repos

Posted: Sun Aug 25, 2013 1:20 am
by pidsley
I thought about using dunst, but it requires that a notify daemon run in the background. Then I tried dmenu, and that works, but I like osd_cat even better. I bound the script to a key with xbindkeys, so I can display the status whenever I want, and the delay is adjustable. I also played with running it as a cron job, and that works too.

It is interesting that we were both trying to do the same thing. conky is bloat :) I think I probably read your post about doing this, but forgot about it.

awk is amazing. I don't know much, but I want to learn more.

Re: New on the market / Fresh from the repos

Posted: Sun Aug 25, 2013 1:37 am
by dkeg
haha, that is exactly what I did, keybound it, even the idea of cron jobbing or not.

very interesting point, you're right about the daemon running in the bg. I didn't like that, kind of defeating the purpose right.

okay, based on that, i'm gonna jump ship from dunst to osd_cat. I mean really, its all the same syntax, just piping through the cat instead.

Re: New on the market / Fresh from the repos

Posted: Sun Aug 25, 2013 2:10 am
by pidsley
Sweet! Please post whatever you get working. One thing about what I have -- it's specific to the machine I'm using (parsing the sensors output is different for each machine). I don't really care, because I want it to be simple.

HOWTO; osd_cat as conky replacement

Posted: Fri Nov 08, 2013 8:14 pm
by dkeg
been awhile, but revisited this today and got this version of osd_cat working quite well. My sed skills may be sloppy, but its working.

Code: Select all

#! /bin/bash

temp=$(cat /sys/class/thermal/thermal_zone0/temp | awk '{print $1/1000}') 
mem=$(free -m | grep buffers/cache | sed -e 's/[buffers/cache -+ :]//g' | sed 's/.\{4\}$//')
time=$(date | sed -e 's/EST 2013//g') 
batt=$(cat /sys/class/power_supply/BAT0/capacity)
mail=$($HOME/mail)

#OUTPUT=
$(echo -e $time '>>' m$mail b$batt r$mem t$temp | osd_cat -A center -o 2 -d 10 -c black)
scrot
osd.png
osd.png (14.27 KiB) Viewed 8116 times

Re: HOWTO; osd_cat as conky replacement

Posted: Fri Nov 08, 2013 9:23 pm
by pidsley
Nice work dkeg.

Re: HOWTO; osd_cat as conky replacement

Posted: Fri Nov 08, 2013 9:33 pm
by dkeg
thanks pids!

Re: HOWTO; osd_cat as conky replacement

Posted: Sat Nov 09, 2013 3:13 am
by dkeg
Pids, I was looking at your original post. Really interesting how we each did it so differently, getting to pretty much the same place. Something I can really appreciate.

Re: HOWTO; osd_cat as conky replacement

Posted: Sat Nov 09, 2013 6:30 am
by machinebacon
Really neat. I just would like to add something remotely related for all the root-window lovers - not worth to open an own thread for it:

1) xrootconsole - sends the STDOUT to the root window. It's not exactly a VT because you can not input there. I see it makes sense if you want to pipe the tail of /var/log or something like this onto the root window.

2) xmountains/xfireworks/xfishtank/xphoon - draws certain animations onto the root window

3) floatbg - changes the colour of the root window. Quite powerful, because you can limit the range of colors to be shown, the switching speed, etc.

4) xloadimage - similar to feh, can display images on either the root window or into an X window. Nothing pretty and fancy, and I am unsure if it has any advantages over feh, or xsetroot.

Re: HOWTO; osd_cat as conky replacement

Posted: Sat Nov 09, 2013 9:32 am
by wuxmedia
nice OCD catting 8P
I remember xmountains from a BBQ installer, once. 8)

Re: HOWTO; osd_cat as conky replacement

Posted: Sun Dec 15, 2013 1:28 pm
by dkeg
circling back to this thread. Posted a scrot including latest version of the cat. Posting another here for completeness.

piping typical conky items: date, time, memory, cpu, volume, mail count, battery, temperature, and currently playing. For both mail and mocp I call out to external scripts. I set it up with a keybind and delay it 10s so I have time to read it.

It also populates 'on top' of other windows and panels. So say in hlwm, if I am using the default bar, instead of piping conky through dzen, I keybind osd_cat and it will overlay on the bar.
2013-12-15--1387109698_1366x768_scrot.png

Re: HOWTO; osd_cat as conky replacement

Posted: Wed Feb 12, 2014 1:07 pm
by GekkoP
Trying this osd_cat today, really nice trick.

Re: HOWTO; osd_cat as conky replacement

Posted: Wed Feb 12, 2014 4:17 pm
by machinebacon
osd volume bar, gets input (for example from xbindkeys) as 'osd_vol +' 'osd_vol -' and 'osd_vol t'

/usr/local/bin/osd_vol (remember chmod a+x)

Code: Select all

#!/bin/bash
case $1 in
+)
       amixer set PCM 2dB+
       ;;
-)
       amixer set PCM 2dB-
       ;;
t)
       amixer set Master toggle -q
       ;;
*)
       exit 
       ;;
esac
VOLUME=`amixer get PCM | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`
osd_cat --colour=Green --shadow 1 \
--pos bottom --align center --offset 80 --delay=1 -b percentage -P $VOLUME -T Volume

Re: HOWTO; osd_cat as conky replacement

Posted: Sun Feb 23, 2014 2:36 pm
by machinebacon
RSS feed to osd_cat:

Code: Select all

curl -s "http://www.tagesschau.de/xml/rss2" | sed -n '/<title>/{ s/[^>]*>\([^<]*\).*/\1/; p; }' | osd_cat -l 10 -c white
works also fine for xrootconsole -geometry 140x30 or so.

HOW TO: osd_cat as conky alternative

Posted: Sun Feb 23, 2014 2:58 pm
by dkeg
^ nice one!

Re: HOWTO; osd_cat as conky replacement

Posted: Sun Feb 23, 2014 3:05 pm
by machinebacon
^ unfortunately most American RSS feeds use the same service (feedburner or whatever it is), and they render <titles> and <items> differently, so you have to find some other provider, maybe from your local newspaper :)

Re: HOWTO; osd_cat as conky replacement

Posted: Sun Feb 23, 2014 3:10 pm
by dkeg
right, makes sense. fwiw, also can pipe through your now playing cmus'er, moc'er. For me did with seperate script, same i use for the other conky alternatives.

Re: HOWTO; osd_cat as conky replacement

Posted: Sun Feb 23, 2014 3:19 pm
by machinebacon
actually I got to RSS feeds when looking at xrootconsole's colored output version, piping top (!) through ccze into it... so for some larger shit with colors, xrootconsole is the peanut. osd_cat is perfect for few-liners.

Re: HOW TO: osd_cat as conky alternative

Posted: Sat Jul 05, 2014 2:58 am
by pidsley
Some of us on IRC were talking about osd_vol, and it didn't work for me because I need to adjust the Master channel (instead of PCM), so here it is working for that (as always, there might be a better way):

Code: Select all

#!/bin/bash
case $1 in
+)
       amixer set Master 2dB+ ;;
-)
       amixer set Master 2dB- ;;
t)
       amixer set Master toggle -q ;;
*)
       exit;;
esac
VOLUME=$(amixer get Master | awk -F'[][]' '/Mono:/ {sub(/%/, ""); print $2; exit}')
osd_cat --colour=Green --shadow 1 --pos bottom --align center --offset 80 --delay=1 -b percentage -P $VOLUME -T Volume
The awk might need some tweaking if your volume bar doesn't work; please let me know, and provide the output from "amixer" so I can modify the script accordingly.