HOW TO: osd_cat as conky alternative

Forum rules
Share your brain ;)
pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: New on the market / Fresh from the repos

Unread post by pidsley » Sun Aug 25, 2013 12:46 am

^ 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.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: New on the market / Fresh from the repos

Unread post by dkeg » Sun Aug 25, 2013 1:07 am

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.

Work hard; Complain less

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: New on the market / Fresh from the repos

Unread post by pidsley » Sun Aug 25, 2013 1:20 am

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.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: New on the market / Fresh from the repos

Unread post by dkeg » Sun Aug 25, 2013 1:37 am

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.

Work hard; Complain less

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: New on the market / Fresh from the repos

Unread post by pidsley » Sun Aug 25, 2013 2:10 am

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.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

HOWTO; osd_cat as conky replacement

Unread post by dkeg » Fri Nov 08, 2013 8:14 pm

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 7949 times

Work hard; Complain less

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: HOWTO; osd_cat as conky replacement

Unread post by pidsley » Fri Nov 08, 2013 9:23 pm

Nice work dkeg.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: HOWTO; osd_cat as conky replacement

Unread post by dkeg » Fri Nov 08, 2013 9:33 pm

thanks pids!

Work hard; Complain less

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: HOWTO; osd_cat as conky replacement

Unread post by dkeg » Sat Nov 09, 2013 3:13 am

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.

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by machinebacon » Sat Nov 09, 2013 6:30 am

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.
..gnutella..

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by wuxmedia » Sat Nov 09, 2013 9:32 am

nice OCD catting 8P
I remember xmountains from a BBQ installer, once. 8)
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: HOWTO; osd_cat as conky replacement

Unread post by dkeg » Sun Dec 15, 2013 1:28 pm

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

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: HOWTO; osd_cat as conky replacement

Unread post by GekkoP » Wed Feb 12, 2014 1:07 pm

Trying this osd_cat today, really nice trick.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by machinebacon » Wed Feb 12, 2014 4:17 pm

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
..gnutella..

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by machinebacon » Sun Feb 23, 2014 2:36 pm

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.
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

HOW TO: osd_cat as conky alternative

Unread post by dkeg » Sun Feb 23, 2014 2:58 pm

^ nice one!

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by machinebacon » Sun Feb 23, 2014 3:05 pm

^ 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 :)
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: HOWTO; osd_cat as conky replacement

Unread post by dkeg » Sun Feb 23, 2014 3:10 pm

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.

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO; osd_cat as conky replacement

Unread post by machinebacon » Sun Feb 23, 2014 3:19 pm

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.
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: HOW TO: osd_cat as conky alternative

Unread post by pidsley » Sat Jul 05, 2014 2:58 am

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.

Post Reply