już dzień po ostatnim konfigu rozgrzebałem go na nowo i zarzucam kolejną wersję
część główna wzbogacona jedynie o czcionki obrazkowe, poważne zmiany w obsłudze amaroka - dodałem wyświetlanie okładki aktualnie granego utworu oraz obsługę statusu odtwarzacza (gra/pauza/stop jako czcionka obrazkowa)
screen:
.conkyrc:
Kod: Zaznacz cały
# Create own window instead of using desktop (required in nautilus)
background yes
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer yes
use_xft yes
font ProggyTinyTTSZ:size=12
# Update interval in seconds
update_interval 2.0
# Minimum size of text area
minimum_size 200 5
maximum_width 220
# Draw shades?
draw_shades no
# Text stuff
draw_outline yes # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 9
# border width
border_width 10
# Default colors and also border colors, grey90 == #e5e5e5
default_color 7d976d
color1 b7823d
color2 b4da9d
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 10
gap_y 40
top_name_width 11
# stuff after 'TEXT' will be formatted on screen
TEXT
${goto 105}${color1}${font M47_FIRE WIRE:size=20}${time %H:%M:%S}
${goto 125}${font M47_FIRE WIRE:size=14}${time %x}$color$font
${voffset 5}${alignr}Pn Wt Sr Cz Pt So Ni
${voffset -10}${execpi 600 DJS=`date +%_d` ; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignr} /' | sed /" $DJS "/s/" $DJS "/" "'${color white}'"$DJS"'${color}'" "/}
${voffset -15}${color1}${font openlogos:size=14}u${voffset -5}$font ${font M47_FIRE WIRE:size=10}system${hr 2}$font$color
$sysname, $kernel on $machine
${font wingdings:size=14}-$font ${voffset -5}mails ${color white}${execi 600 ~/.conky/gmail2}$color$alignr${voffset -5}${font poky:size=12}a${voffset -5}${font}uptime $alignr$uptime
${voffset -3}${font poky:size=14}R$font ${voffset -5}${execi 10 ~/.conky/batt stat} $color2${execi 10 ~/.conky/batt perc}$color$alignr${execi 30 ~/.conky/batt time}
${voffset -10}${color1}${font poky:size=14}N${voffset -5}$font ${font M47_FIRE WIRE:size=10}gpu${hr 2}$font$color
freq ${color white}${nvidia gpufreq}${color} MHz temp ${color white}${nvidia temp}${color}`C${alignr}mem ${color white}${nvidia memfreq}${color} MHz
${color1}${voffset -10}${font poky:size=14}M${voffset -5}$font ${font M47_FIRE WIRE:size=10}cpu${hr 2}$font$color
${alignc}Load: ${loadavg}
${color white}${exec sensors -u | awk '$1 ~ /input/ { print $2 }' | head -1}${color}`C ${color white}${freq 1}${color}MHz${alignr}${color white}${exec sensors -u | awk '$1 ~ /input/ { print $2 }' | tail -1}${color}`C ${color white}${freq 1}${color}MHz
$color${cpubar cpu1 5,100}$alignr${cpubar cpu2 5,100}
$color${cpugraph cpu1 20,100 000000 55aa55}$alignr$color${cpugraph cpu2 20,100 000000 55aa55}
top CPU CPU% top MEM MEM${color white}
${top name 1} ${top cpu 1} ${top_mem name 1} ${top_mem mem_res 1}${color2}
${top name 2} ${top cpu 2} ${top_mem name 2} ${top_mem mem_res 2}${color}
${top name 3} ${top cpu 3} ${top_mem name 3} ${top_mem mem_res 3}
${top name 4} ${top cpu 4} ${top_mem name 4} ${top_mem mem_res 4}
${color}total running:${alignr}${color white}$running_processes$color of ${color white}$processes
${color1}${voffset -10}${font poky:size=14}H${voffset -5}$font ${font M47_FIRE WIRE:size=10}memory/disk${hr 2}$font$color
${color}${membar 12}
${voffset -18}$alignc${color white}RAM ${memperc}% ($mem)
${color}${swapbar 12}
${voffset -18}$alignc${color white}Swap ${swapperc}% ($swap)$color
${voffset 3}Root ${fs_free /}$alignr${fs_bar 6,130 /}$color
C:\ ${fs_free /media/c}$alignr${fs_bar 6,130 /media/c}$color
D:\ ${fs_free /media/d}$alignr${fs_bar 6,130 /media/d}$color
${if_mounted /media/QzkBook}Extr ${fs_free /media/QzkBook}$alignr${fs_bar 6,130 /media/QzkBook}$color${endif}
${color1}${voffset -10}${font poky:size=14}Y${voffset -5}$font ${font M47_FIRE WIRE:size=10}network$font (${wireless_essid wlan0})${hr 2}$color
${addr wlan0} $alignr${execi 30 ~/.conky/exip}
${color white}${downspeedf wlan0}${color}kB/s$alignr${color white}${upspeedf wlan0}${color}kB/s
${voffset -20}${font pizzadude bullets:size=16}T${goto 220}N${font}
${downspeedgraph wlan0 15,100 000000 880000}$alignr${upspeedgraph wlan0 15,100 000000 008800}$color${voffset -5}
${goto 110}session${goto 20}${color white}${totaldown wlan0}$alignr${color white}${totalup wlan0}$color
${goto 115}today${goto 20}$color2${execi 60 vnstat | grep "today" | awk '{print $2 $3}'}$alignr${execi 60 vnstat | grep "today" | awk '{print $5 $6}'}$color
${goto 105}yesterday${goto 20}$color2${execi 600 vnstat | grep "yesterday" | awk '{print $2 $3}'}$alignr${execi 60 vnstat | grep "yesterday" | awk '{print $5 $6}'}$color
${goto 105}last week${goto 20}$color2${execi 600 vnstat -w | grep "days" | awk '{print $4 $5}'}$alignr${execi 60 vnstat -w | grep "days" | awk '{print $7 $8}'}$color
${goto 102}this month${goto 20}$color2${execi 600 vnstat -m | grep "`date +"'%y"`" | tail -1 | awk '{print $3 $4}'}$alignr${execi 60 vnstat -m | grep "`date +"'%y"`" | tail -1 | awk '{print $6 $7}'}$color
${color}Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count} ${alignr}Total: ${tcp_portmon 1 65535 count}
${voffset -10}${color1}${font Buttons and Switches JL:size=14}${exec ~/.conky/amarok stat}${voffset -8}$font ${font M47_FIRE WIRE:size=10}now playing${hr 2}$font
${if_running amarokapp}${color white}${exec ~/.conky/amarok title}
$color2${exec ~/.conky/amarok album}$alignr
${exec ~/.conky/amarok artist}
$color${exec ~/.conky/amarok count}
${exec ~/.conky/amarok time}
${image ~/.conky/cover -p 120,612 -s 100x100 -n}$color1${execbar ~/.conky/amarok prog}
${else}${color}
${alignc}[Amarok not running]
$color1${hr 2}${endif}
standardowy skrypt gmail przerobiony żeby tylko wyświetlał cyferkę:
Kod: Zaznacz cały
#!/bin/bash
gmail_login="login"
gmail_password="hasło"
dane="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - https://${gmail_login}:${gmail_password}@mail.google.com/mail/feed/atom --no-check-certificate | grep 'fullcount' | sed -e 's/.*<fullcount>//;s/<\/fullcount>.*//' 2>/dev/null)"
if [ -z "$dane" ]; then
echo "ERR"
else
echo $dane
fi
oraz odpicowany skrypt amaroka:
Kod: Zaznacz cały
#!/bin/bash
stat="$(dcop amarok player status 2> /dev/null)"
if [ "${#stat}" -eq 0 ]; then
stat='g'
if [ "$(ls -lh ~/.conky/cover | awk '{print $5}')" != "985" ]; then
cp ~/.conky/blank.gif ~/.conky/cover; fi
elif [ $stat -eq 0 ]; then
stat='d';
elif [ $stat -eq 1 ]; then
stat='f'
else stat='a'; fi
case $1 in
stat) echo $stat;;
title)tmp="$(dcop amarok player title)"
echo $tmp | fold -s -w 20 | head -3
if [ -z "$tmp" ]; then echo " "; fi
if [ ${#tmp} -le 40 ]; then echo " "; fi
if [ ${#tmp} -le 20 ]; then echo " "; fi;;
artist) if [ $stat == 'd' ]; then
echo "Stopped"; echo " "; else
tmp="$(dcop amarok player artist)"
echo $tmp | fold -s -w 20 | head -2
if [ ${#tmp} -le 20 ]; then echo " "; fi
fi;;
album) if [ $stat != 'd' ]; then
tmp="$(dcop amarok player album)"
echo $tmp | fold -s -w 20 | head -2
if [ ${#tmp} -le 20 ]; then echo " "; fi
else echo " "
fi;;
time) if [ $stat != 'd' ]; then
echo "$(dcop amarok player currentTime) / $(dcop amarok player totalTime)"
else echo " "; fi;;
count) if [ $stat != 'd' ]; then
cnt="$(dcop amarok player trackPlayCounter)"
if [ $cnt -eq 0 ]; then echo "Never played"
elif [ $cnt -eq 1 ]; then echo "Played once"
elif [ $cnt -eq 2 ]; then echo "Played twice"
else echo "Played $cnt times"
fi
else echo " "
fi;;
prog) if [ $stat != 'd' ]; then
atime=$(dcop amarok player trackCurrentTime)
ttime=$(dcop amarok player trackTotalTime)
echo $((atime*100/ttime))
if [ $atime -le 4 ]; then
cp "$(dcop amarok player coverImage)" ~/.conky/cover
fi
else echo " "
fi;;
esac
Użyte czcionki to:
proggy tiny - tekst
m47_fire wire - nagłówki
pizzadude bullets - strzałki
openlogos - logo ubuntu
wingdings - znaczek skrzynki
buttons and switches JL - znaczki play/pause/stop
poky - wszelkie inne logosy
wszystki czcionki darmowe, do wyguglania w 10 sekund; jedynie wingdings trzeba sobie przekopiować od starego znajomego windowsa