Mint Serena 64 bit using the Mate desktop environment. Most of the following scripts will run on this machine, although some have only been tested with the Gnome desktop. Extra software requirements can be met by the Ubuntu and safe PPA repositories. Scripts may be re-written or added to from time to time, the date serves as the version number. Syntax highlighting on these pages is provided by GVim's "Convert to HTML" option.

Conky With PSAD.

# Conky configuration script.
# Filename: .conkyrc3
# Version: 090712
# Author: robz
# This config will give you a horizontal layout with a screen aspect ratio of
# 16:9 sized for 1920 x 1080 pixels resolution monitor.
# You'll need the lm-sensors psad & hddtemp packages from the repositories - 
# sudo apt-get install lm-sensors psad hddtemp - follow the setup procedures in
# the man pages, you'll also need my rhythmbox-progbar script see below.
# The hard drive names and locations will probably need to be changed to suit
# your PC as will the lm-sensors cpu and motherboard temperatue names, and maybe
# the name of your network interface as well :)
# The call to the port scan attack detector (psad) will require user read/write
# access to /var/log/psad/top_attackers, do this in a terminal with:
# "sudo chmod 660 /var/log/psad/top_attackers"
# To start, in a terminal - conky -d -c "path to conkyrc3"
# Or as a startup application - conky -d -p15 -c "path to conkyrc3"
# OK here - we - go!

# Locale, fonts and font sizes.
use_xft yes
xftfont Droid Sans:size=9
override_utf8_locale yes

# Conky performance
update_interval 2
total_run_times 0
double_buffer yes
no_buffers yes
net_avg_samples 2
text_buffer_size 1024
top_name_width 10

# Execute it in its own window
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Font colors
default_color 666666 # mid grey

# Header colors
color0 FFFF66 # pale yellow

# Minimum dimensions
minimum_size 1700 0
default_bar_size 100 10
default_graph_size 100 10

# Conky positioning, roughly centred.
alignment bottom_left
gap_x 130
gap_y 5

########### Stuff after "TEXT" will appear onscreen ###########################
#
TEXT
${goto 15}${font Ubuntu:style=Bold:size=20}${color0}ubuntu ${font}\
${kernel}${font Droid Sans:size=10}\
${goto 256}Memory & Disks:\
${goto 560}Network:\
${goto 785}PSAD - Top Attackers:\
${goto 960}Temperatures:\
${goto 1130}Top Processes:\
${goto 1330}Activity:\
${goto 1530}Music:${font}${color}${voffset 5}
#
########### End of headings line ##############################################
#
${goto 15}${if_match ${cpu cpu0} > 50}CPU: Grafting!${goto 100}${color red}\
${cpubar cpu0}${color}  ${cpu cpu0}%${else}CPU Average:${goto 100}\
${cpubar cpu0}  ${cpu cpu0}%${endif}\
${goto 256}Flash SSD:${goto 330}${fs_used /}\
${goto 380}${fs_bar /}  ${fs_size /}\
${goto 560}Upspeed:\
${goto 635}${upspeedgraph ppp0 10,100 B7B2AD 0099FF}  ${upspeed ppp0}\
${goto 785}${execi 60 echo $(PSAD="/var/log/psad/top_attackers";\
grep -v "^#" "$PSAD" | sort -rnk3 -o "$PSAD"; awk 'NR==1 {print $1}' "$PSAD")}\
${goto 910}${execi 60 echo $(\
awk 'NR==1 {print $3}' "/var/log/psad/top_attackers")}\
${goto 960}CPU Temp:\
${goto 1070}${execi 10 echo $(sensors | grep -m 1 'CPUTIN:' | cut -c16-17)°C}\
${goto 1130}${top name 1}${goto 1220}${top pid 1}${goto 1260}${top cpu 1}%\
${goto 1330}Processes:${goto 1425}${running_processes}  Running\
${goto 1530}${if_running rhythmbox}Rhythmbox Now Playing:\
${else}Put Some Music On Rob!${endif}
#
########### End of first line #################################################
#
${goto 15}${if_match ${cpu cpu1} > 70}Core 1: on fire!${goto 100}${color red}\
${cpubar cpu1}${color}  ${cpu cpu1}%${else}Core 1:${goto 100}\
${cpubar cpu1}  ${cpu cpu1}%${endif}\
${goto 256}Archive:${goto 330}${fs_used /media/Archive}\
${goto 380}${fs_bar /media/Archive}  ${fs_size /media/Archive}\
${goto 560}Downspeed:\
${goto 635}${downspeedgraph ppp0 10,100 B7B2AD FF0000}  ${downspeed ppp0}\
${goto 785}${execi 60 echo $(\
awk 'NR==2 {print $1}' "/var/log/psad/top_attackers")}\
${goto 910}${execi 60 echo $(\
awk 'NR==2 {print $3}' "/var/log/psad/top_attackers")}\
${goto 960}Motherboard:\
${goto 1070}${execi 30 echo $(sensors | grep -m 1 'SYSTIN:' | cut -c16-17)°C}\
${goto 1130}${top name 2}${goto 1220}${top pid 2}${goto 1260}${top cpu 2}%\
${goto 1330}Load Average: ${goto 1425}${loadavg}\
${goto 1530}${if_running rhythmbox}\
${exec rhythmbox-client --print-playing-format %tt}${endif}
#
########### End of second line ################################################
#
${goto 15}${if_match ${cpu cpu2} > 70}Core 2: on fire!${goto 100}${color red}\
${cpubar cpu2}${color}  ${cpu cpu2}%${else}Core 2:${goto 100}\
${cpubar cpu2}  ${cpu cpu2}%${endif}\
${goto 256}Backup:${goto 330}${fs_used /media/Backup}\
${goto 380}${fs_bar /media/Backup}  ${fs_size /media/Backup}\
${goto 560}Totals:${goto 635}${totalup ppp0}  -  ${totaldown ppp0}${font}\
${goto 785}${execi 60 echo $(\
awk 'NR==3, NF && !/#/ {print $1}' "/var/log/psad/top_attackers")}\
${goto 910}${execi 60 echo $(\
awk 'NR==3 {print $3}' "/var/log/psad/top_attackers")}\
${goto 960}Archive 1TB Drive:\
${goto 1070}${execi 60 nc localhost 7634 | cut -c81-82}°C\
${goto 1130}${top name 3}${goto 1220}${top pid 3}${goto 1260}${top cpu 3}%\
${goto 1330}Flash SDD I/O:${goto 1425}${diskio /dev/sda}/s\
${goto 1530}${if_running rhythmbox}By: \
${exec rhythmbox-client --print-playing-format %aa}${endif}
#
########### End of third line #################################################
#
${goto 15}${if_match ${cpu cpu3} > 70}Core 3: on fire!${goto 100}${color red}\
${cpubar cpu3}${color}  ${cpu cpu3}%${else}Core 3:${goto 100}\
${cpubar cpu3}  ${cpu cpu3}%${endif}\
${goto 256}Ram:${goto 330}${memmax}${goto 380}${membar 10,100}  $memperc%\
${goto 560}Today:${goto 635}${execi 120 vnstat -i ppp0 | \
awk '/today/{print $8 $9}'}\
${goto 785}${execi 60 echo $(\
awk 'NR==4 {print $1}' "/var/log/psad/top_attackers")}\
${goto 910}${execi 60 echo $(\
awk 'NR==4 {print $3}' "/var/log/psad/top_attackers")}\
${goto 960}Backup 1TB Drive:\
${goto 1070}${execi 60 nc localhost 7634 | cut -c53-54}°C\
${goto 1130}${top name 4} ${goto 1220}${top pid 4}${goto 1260}${top cpu 4}%\
${goto 1330}Archive I/O:${goto 1425}${diskio /dev/sdc}/s\
${goto 1530}${if_running rhythmbox}From: \
${alignc}${exec rhythmbox-client --print-playing-format %at}${endif}
#
########### End of forth line #################################################
#
${goto 15}${if_match ${cpu cpu4} > 70}Core 4: on fire!${goto 100}${color red}\
${cpubar cpu4}${color}  ${cpu cpu4}%${else}Core 4:${goto 100}\
${cpubar cpu4}  ${cpu cpu4}%${endif}\
${goto 256}Swap:${goto 330}${swapmax}\
${goto 380}${swapbar 10,100}  ${swapperc}%\
${goto 560}Month:${goto 635}${execi 120 vnstat -m -i ppp0| \
awk '/'$(date +"%b")'/{print $9 $10}'}\
${goto 785}${execi 60 echo $(\
awk 'NR==5 {print $1}' "/var/log/psad/top_attackers")}\
${goto 910}${execi 60 echo $(\
awk 'NR==5 {print $3}' "/var/log/psad/top_attackers")}\
${goto 960}Graphics Card:${goto 1070}${nvidia temp}°C\
${goto 1130}${top name 5}${goto 1220}${top pid 5}${goto 1260}${top cpu 5}%\
${goto 1330}Backup I/O:${goto 1425}${diskio /dev/sdb}/s\
${goto 1530}${if_running rhythmbox}\
${execbar /home/robz1/Scripts/conky_scripts/rhythmbox-progbar}${endif}
#
########### End of fifth line and this configuration ##########################
#



Progress Bar Script.

#!/bin/bash
# Filename: rhythmbox-progbar
# Author: robz
# Version: 060412
# Provide data for Conky to draw a progress bar for Rhythmbox music player.
# Update for Ubuntu 12.04 beta
# Now at this present date (see Version:) the call to "rhythmbox-client" for
# song duration doesn't appear to work anymore, you get a "divide by zero"
# error, so, to avoid the APOCALYPSE! use this instead.

DUR=$(qdbus org.mpris.MediaPlayer2.rhythmbox \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
org.mpris.MediaPlayer2.Player Metadata | awk '/length/ {print $2/1000000}')
POS=$(qdbus org.mpris.MediaPlayer2.rhythmbox \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
org.mpris.MediaPlayer2.Player Position)/1000000

echo $(echo "100*$POS/$DUR" | bc)                       # Convert to percent.


Desktop Screenshot.


No comments: