You are not logged in.
Pages: 1
Hey, I was just wondering if anyone has come up with a way to display some irssi-information in your Conky?
I just figured it might be cool to have Conky display the last message said in irssi or a notification when you get highlighted. It just seems like Conky lacks such a feature by default and getting information out of irssi is kind of out of my league, even though it might be possible to do with some command (seems like you can do anything with a fitting command.)
It just seems amazing that Conky *gasp* lacks a feature!
On another note, maybe I'm not creative enough, but it seems like there is no easy way to implement this either:
I want to make my MPC: "$mpc_artist - $mpc_title [$mpc_elapsed / $mpc_duration]"-string something like just MPC: "not playing" when it's stopped. Since when stopped, it just shows " - [0:00 / 0:00]" it would be neater if it would just clean itself up.
Though, there doesn't seem to be a way to implement this without an if-condition, and the if_empty condition needs to have some interesting logic if it's doable at all (and I'd rather stay with Conky variables if possible, it would be somewhat easy to configure with a single script or exec.) How much more resource-demanding is it to use external commands anyway? The Conky documentation mentions that it's more resource intensive but that seems like a subjective term.
Offline
Well...
You could do it by having a script in irssi that outputs that to a file.
Conky could look for that file. If exists, echo and delete.
As for using an external command. It is probably more resource intensive, but really, we're probably talking about a few kb more max + the resources the command itself uses. So as long as you're not running big scripts, you should be fine. Probably stick to bash scripts.
Offline
I might work on something for you in a bit, but as for displaying when you get highlighted you could do that simply with something like 'cat /path/to/irc.log | tail | grep <username>' and output that through conky...
Maybe not the best solution, but it's a simple one off the top of my head.
Offline
This is an excerpt from my .conkyrc:
${execi 5 nice -n19 /home/filip/scripts/mpd.sh}${if_existing /tmp/mpd.tmp}${font glispbold}MPD: ${color0}$font${execi 2 cat /tmp/mpd.tmp}$color :: $endif
What it does is:
1. Run mpd.sh script (see below) which basically saves the current mpd status to /tmp/mpd.tmp file (if music is playing)
2. if_existing condition checks if the file /tmp/mpd.tmp exists (it only exists when music is playing or paused) -- if the file exists then mpd info is displayed, if it doesn't exist then the whole mpd section in conky doesn't appear at all
Here is the mpd.sh script that I use -- you'll notice that it also makes sure that the Arist/Title info is no longer than a certain number of characters (80), because my conky is a single horizontal line at the top of the screen:
#!/bin/bash
is_playing_music=$(mpc | grep -e ^\\[p[al][ua][sy][ei].*\\])
echo "$is_playing_music" | grep -qe ^\\[paused\\] && echo "paused" > /tmp/mpd.tmp && exit
if [ ! -n "$is_playing_music" ]; then
[ -f /tmp/mpd.tmp ] && rm -r /tmp/mpd.tmp && exit
else
disp=`mpc --format "%artist% ## %title%" | head -1`
if [ ${#disp} -gt 80 ]; then
echo "${disp:0:77}..." > /tmp/mpd.tmp
else
echo "${disp}" > /tmp/mpd.tmp
fi
fi
Offline
Nice script fwojciec, I might adapt that
Let me know if you make any intersting/fun improvements
Offline
Thanks guys
Offline
A rather old topic, but I would like to post my current solution.
.conkyrc
MPD ${hr 2}
${voffset 4}${font Webdings:size=14}U${font} Status: $alignr$mpd_status
${execpi 5 /home/riivo/scripts/mpd.awk}
mpd.awk
#!/bin/awk -f
BEGIN {
MPD_CMD = "mpc"; # mpd
MPD_CMD | getline;
MPD_CMD | getline;
mpd_state = $1;
close(MPD_CMD);
if ( mpd_state == "[playing]" )
print "${voffset 4}${font Webdings:size=14}4${font} Song: $alignr$mpd_artist\n${voffset 6}$alignr$mpd_title\n${voffset 8}$mpd_elapsed/$mpd_length $alignr${mpd_bar 8,120}";
else {
if ( mpd_state == "[paused]" )
print "${voffset 4}${font Webdings:size=14};${font} Song: $alignr$mpd_artist\n${voffset 6}$alignr$mpd_title\n${voffset 8}$mpd_elapsed/$mpd_length $alignr${mpd_bar 8,120}";
}
}
A way to make the strings in mpd.awk look nicer is welcomed.
Offline
Pages: 1