OpenSUSE 13: Install conky

This article will describe installinig conky which is a system monitor tool running as desktop widget.

1 Install conky

Install conky package.

$ sudo zypper -n in conky

2 ${HOME}/.conkyrc

${HOME}/.conkyrc is config file for conky.config and conky.text. You can also use /etc/conky/conky.conf.

  • CPU core number is started from 1 (cpu0 means average of cores). Add entry of ${cpu cpuN} for your cpu cores.
  • The following command treats eth0 as network interface name. Change your network interface name of ifconfig.
$ cat <<EOF > ~/.conkyrc
use_spacer left
pad_percents 3
background false
double_buffer true
font DejaVu Sans Mono:size=10
use_xft true
alignment top_right
gap_x 10
gap_y 40
own_window_argb_visual true
own_window_argb_value 100
own_window_type panel
own_window true
update_interval 5.0

TEXT

\${color orange}Hostname: \${color}\${nodename}
\${color orange}Kernel:   \${color}\${sysname} \${kernel} on \${machine}
\${color orange}Uptime:   \${color}\${uptime}
\${hr}
\${color orange}CPU:\${color} \${freq_g} GHz
\${color orange}1:\${color} \${cpu cpu1}% \${cpubar cpu1}
\${cpugraph}
\${color orange}Name              PID   CPU%   MEM%
\${color lightgrey} \${top name 1} \${top pid 1} \${top cpu 1} \${top mem 1}
\${color lightgrey} \${top name 2} \${top pid 2} \${top cpu 2} \${top mem 2}
\${color lightgrey} \${top name 3} \${top pid 3} \${top cpu 3} \${top mem 3}
\${color lightgrey} \${top name 4} \${top pid 4} \${top cpu 4} \${top mem 4}
\${color orange}Load average: \${color}\${loadavg}
\${color orange}Processes: \${color}\${processes} \
\${color orange}Running:\${color} \${running_processes}
\${hr}
\${color orange}RAM:  \${color}\${mem}/\${memmax}
\${memperc}% \${membar 4}
\${color orange}Swap: \${color}\${swap}/\${swapmax}
\${swapperc}% \${swapbar 4}
\${memgraph}
\${hr}
\${color orange}/ \${color}\${fs_used /}/\${fs_size /} \${fs_bar 6 /}
\${hr}
\${color orange}IP:   \${color}\${addr eth0}
\${color orange}Up:   \${color}\${upspeed eth0}
\${color orange}Down: \${color}\${downspeed eth0}
EOF

3 Autostart

Make conky to be start automatically on login. You can use gnome-display-properties instead of the following command.

$ mkdir -p ~/.config/autostart
$ cat <<EOF > ~/.config/autostart/conky.desktop
[Desktop Entry]
Type=Application
Exec=/usr/bin/conky
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=conky
Comment=
EOF

Reboot machine.

$ sudo reboot

4 Execution result

The conky widget is displayed on desktop.

0001_conky.png

5 Script for installing conky

The following script will install conky.

#!/bin/sh

NETWORK_INTERFACE=eth0

sudo zypper -n in conky

cat <<EOF > ~/.conkyrc
use_spacer left
pad_percents 3
background false
double_buffer true
font DejaVu Sans Mono:size=10
use_xft true
alignment top_right
gap_x 10
gap_y 40
own_window_argb_visual true
own_window_argb_value 100
own_window_type panel
own_window true
update_interval 5.0

TEXT

\${color orange}Hostname: \${color}\${nodename}
\${color orange}Kernel:   \${color}\${sysname} \${kernel} on \${machine}
\${color orange}Uptime:   \${color}\${uptime}
\${hr}
\${color orange}CPU:\${color} \${freq_g} GHz
\${color orange}1:\${color} \${cpu cpu1}% \${cpubar cpu1}
\${cpugraph}
\${color orange}Name              PID   CPU%   MEM%
\${color lightgrey} \${top name 1} \${top pid 1} \${top cpu 1} \${top mem 1}
\${color lightgrey} \${top name 2} \${top pid 2} \${top cpu 2} \${top mem 2}
\${color lightgrey} \${top name 3} \${top pid 3} \${top cpu 3} \${top mem 3}
\${color lightgrey} \${top name 4} \${top pid 4} \${top cpu 4} \${top mem 4}
\${color orange}Load average: \${color}\${loadavg}
\${color orange}Processes: \${color}\${processes} \
\${color orange}Running:\${color} \${running_processes}
\${hr}
\${color orange}RAM:  \${color}\${mem}/\${memmax}
\${memperc}% \${membar 4}
\${color orange}Swap: \${color}\${swap}/\${swapmax}
\${swapperc}% \${swapbar 4}
\${memgraph}
\${hr}
\${color orange}/ \${color}\${fs_used /}/\${fs_size /} \${fs_bar 6 /}
\${hr}
\${color orange}IP:   \${color}\${addr ${NETWORK_INTERFACE}}
\${color orange}Up:   \${color}\${upspeed ${NETWORK_INTERFACE}}
\${color orange}Down: \${color}\${downspeed ${NETWORK_INTERFACE}}
EOF

mkdir -p ~/.config/autostart
cat <<EOF > ~/.config/autostart/conky.desktop
[Desktop Entry]
Type=Application
Exec=/usr/bin/conky
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=conky
Comment=
EOF

sudo reboot