Tags

, , ,

I noticed that I could not monitor my internet connection speed even with its Task Manager (lxtask). After googling around, I found that this is not supported by Lubuntu desktop&windows manager i.e. LXDE. And in LXDE forum, somebody suggested to configure Conky instead.

1)  Install and Configure Conky.

Using Synaptic Package Manager, search and install conky. Once installed, give it a try. Open your terminal and enter conky. You will notice that a simple stats with a black background is now visible on your desktop. Now, it is time to customize conky. Save the following file to a .conkyrc and place it into your home folder e.g. /home/john if your username is john. I will give you a simple conky to start with an assumption you also have 2 CPU as mine.


background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

TEXT
${font sans-serif:bold:size=8}$sysname $kernel $alignr $machine
CPU1: ${cpu cpu0}% ${cpubar cpu0}
CPU2: ${cpu cpu1}% ${cpubar cpu1}

${font sans-serif:bold:size=8}MEMORY ${hr 2}
${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
$membar
SWAP $alignc ${swap} / ${swapmax} $alignr ${swapperc}%
${swapbar}

${font sans-serif:bold:size=8}NETWORK ${hr 2}
Down:${downspeed ppp0}/s $alignr total: ${totaldown ppp0}
Up:${upspeed ppp0}/s $alignr total: ${totalup ppp0}

you may change the ppp0 above to eth0 (if you are using wired connection), or wlan0 (if you are using wireless connection).

You may find lots of available .conkyrc available in the www. This is one of the examples.

http://www.techdrivein.com/2011/02/6-awesome-conky-configs-that-just-works.html

You already have the task manager displaying the summary of your PC, but there is 1 little problem. PCManFM which is the desktop manager interferes with your conky in drawing the desktop such that if you left-click an area on desktop outside of your conky window, your conky taskbar will disappear.  There is no use killing PCManFM process from Task Manager (lxtask) as the PCManFM process will simply be respawn.  You need to have root privilege to change the autostart file to disable PCManFM from managing your desktop which is explained in the next step.

2)  Disable PCManFM from managing your desktop.

Open your terminal.

 sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart 

Comment the @pcmanfm by putting an exclamation mark in front e.g:

!@pcmanfm --desktop --profile lubuntu

If you notice, the @ is actually the one causing the pcmanfm to be respawn if you killed pcmanfm process.

If you reboot now, you will be left with blank desktop (without wallpaper). Don’t worry. For now, just prepare some images you’d like to use as your wallpaper. You may download 1 or 2 wallpapers from http://interfacelift.com or any other websites.

3)  Install feh for managing your wallpapers. 

Open your Synaptic Package Manager. Search feh. Then install it.

Create folder .wallpaper in your $HOME directory (should be /home/your-username). Copy all your wallpapers into this directory.

Right-click one of the pictures. Open using feh. Select File -> Background -> Set Scaled. Now see your desktop. Your wallpaper should be visible.

Create folder .bin in your $HOME directory, go to that directory, and create a file named wallpaper.sh.

Open with leafpad. Then input the following code:


#!/bin/bash

shopt -s nullglob

cd ~/.wallpaper

while true; do
 files=()
 for i in *.jpg *.png; do
 [[ -f $i ]] && files+=("$i")
 done
 range=${#files[@]}

((range)) && feh --bg-scale "${files[RANDOM % range]}"

sleep 1m
done

Fyi, I obtained the source code above from https://wiki.archlinux.org/index.php/Feh#Random_background_image.

Right-click wallpaper.sh. Properties -> Permission -> tick Make the file executable -> OK.

Then double-left-click wallpaper.sh. You should see the wallpaper  in your desktop randomized every 1 minute.

Run your terminal. Then execute conky. You should see the stats of your computer on the upper right corner.

3)  Autostart your Conky and wallpaper.sh

Go to your $HOME/.config/autostart directory. If the autostart folder does not exist, create it.

In the autostart directory. Create conky.desktop file with the following content:


[Desktop Entry]
Type=Application
Exec=conky

Then create wallpaper.desktop with the following content:


[Desktop Entry]
Type=Application
Exec=/home/your-username/.bin/wallpaper.sh
Terminal=false

Don’t forget to replace your-username with your own username.

Then reboot your pc. Your wallpaper and conky stats should be displayed now.

Abu Sarah Fauzi

Advertisements