Conky

Hi,
vielleicht kennt der ein oder andere von euch das durchaus sinnvolle Tool: Conky.
Mit diesem lassen sich beliebige einfach erweiterbare Informationen auf dem Display anzeigen.

Ich möchte euch gerne meine Konfigurationen zeigen.

Was meine Conky-Config bis dato kann:

– ungelesene Mails checken
– unterscheiden ob eine Musikdatei wieder gegeben wird oder nicht
– die aktuellen Musikinformationen anzeigen (über Amarok)

Was sie noch so können soll:

– Facebook Informationen anzeigen (ungelesene Nachrichten, Freundeevents und Freundschaftseinladungen)
– Laptop-Batteriestatus anzeigen.
– es wird bestimmt bald noch mehr geben

 

conkyrc
[prettify class=“Bash“]
background yes
use_xft yes
xftfont HandelGotD:size=12
xftalpha 0.5
update_interval 0.1
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

double_buffer yes
draw_shades no
draw_outline yes
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color black
alignment top_right
gap_x 25
gap_y 25
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT
$stippled_hr
$alignc Information
$stippled_hr
Time: $alignr ${time %k:%M}
Date: $alignr ${time %d %B %y}
Uptime: $alignr $uptime
$stippled_hr
$alignc News
$stippled_hr
Mail:$alignr${execpi 20.0 python /home/blackboxcoder/.conky/Mail.py } $alignr${execpi 20.0 python /home/blackboxcoder/.conky/Mail2.py } $alignr${execpi 20.0 python /home/blackboxcoder/.conky/Mail3.py }
Facebook:
$stippled_hr
$alignc Now Playing
$stippled_hr${if_running amarok}
Artist:$alignr${execi 1.0 /home/blackboxcoder/.conky/amarok2 artist}
Title:$alignr${execi 1.0 /home/blackboxcoder/.conky/amarok2 title}
Length:$alignr${execi 1.0 /home/blackboxcoder/.conky/amarok2 time} / ${execi 1.0 /home/blackboxcoder/.conky/amarok2 totaltime}
${execibar 0.5 /home/blackboxcoder/.conky/amarok2 progress}
Album:$alignr${execi 1.0 /home/blackboxcoder/.conky/amarok2 album}${else}
no song is currently played!
$endif
[/prettify]
Mail.py
[prettify class=“Python“]
import imaplib

unread = 0
text = „Shown Name: “
password = ‚PassW0rd‘
mailserver = ‚imap.web.de‘
port = 993
mailbox = ‚INBOX‘

username = ‚Username@web.de‘
server = imaplib.IMAP4_SSL(mailserver,port)
server.login(username,password)
server.select(mailbox)
data = str(server.status(mailbox, ‚(MESSAGES UNSEEN)‘))
tokens = data.split()
unread += int(tokens[5].replace(‚)\‘])‘,“))

print text,unread
print

server.close()
server.logout()
[/prettify]
Amarok2
[prettify class=“Bash“]
#!/bin/bash
#fetch conky amarok2 information
#by Mjheagle8, edited by fireandfuel
#requires: amarok >= 2.0, qdbus

#You don’t need this, when conky tests whether amarok is running ( ${if_running amarok} … $endif ):
### [ $(pgrep amarok) ] || exit
###This just tests whether amarok is running and exits if it’s not.
#

case „$1“ in
version)
qdbus org.kde.amarok / Identity | cut -c 8-
;; # Also, with qdbus, it’s not necessary to call the full method interface.
# Just ‚Identity‘ here suffices.
artist)
qdbus org.kde.amarok /Player GetMetadata | grep artist: | tail -n 1 | cut -c 9-
;;
title)
qdbus org.kde.amarok /Player GetMetadata | grep title: | cut -c 8-
;;
album)
qdbus org.kde.amarok /Player GetMetadata | grep album: | cut -c 8-
;;
year)
qdbus org.kde.amarok /Player GetMetadata | grep year: | cut -c 7-
;;
genre)
qdbus org.kde.amarok /Player GetMetadata | grep genre: | cut -c 8-
;;
bitrate)
echo qdbus org.kde.amarok /Player GetMetadata | grep audio-bitrate: | cut -c 16-‚ Kb/s‘
;;
rating)
qdbus org.kde.amarok /Player GetMetadata | grep rating: | cut -c 9-
;;
type)
type=qdbus org.kde.amarok /Player GetMetadata | grep location:
echo ${type:(-3)} # Here we’re using bash string manipulation to pick off the last three characters.
;;
time)
pos=$((qdbus org.kde.amarok /Player PositionGet/1000)) # Here we divide by 1000 without using an intermediate variable.
posm=expr $pos / 60
poss=expr $pos \% 60
if (( $poss>9 ));then
echo „$posm:$poss“
else
echo „$posm:0$poss“
fi
;;
totaltime)
time=$((qdbus org.kde.amarok /Player GetMetadata | grep mtime: | cut -c 8-/1000)) # the Time is showed in format mm:ss, includes when s9 ));then
echo „$timem:$times“
else
echo „$timem:0$times“
fi
;;
progress)
pos=$((qdbus org.kde.amarok /Player PositionGet/10))
time=$((qdbus org.kde.amarok /Player GetMetadata | grep mtime: | cut -c 8-/1000))
echo $((pos/time))
;;
esac
[/prettify]
 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

CommentLuv