Saturday, May 17, 2014

Conky Update

PREVIOUSLY ON 'PEDANTIC PEDESTRIAN'... Although I said I'd arrived at a Conky design that I was happy with, there were still one or two things that needed 'solving'...


On the recommendation of a few folks over on the GooglePlus Linux Mint Community, I thought I'd give that Conky Manager a go. I was impressed with some of the 'readymade' themes that came bundled with it, even more so if you add the Deluxe Themes Pack. I enjoyed playing around with a few things for a day or two, although I concluded that there was nothing there that was quite my cup of tea.

The Conky Manager acts as (what amounts to) a WYSIWYG graphical interface for building your Conky. For me it felt much the same as using some Desktop Publishing or web design software, where you work from readymade templates. Some people are happy enough doing things this way, but they never venture far beyond the templates. Hence, a lot of pages (or, in this case, desktops) that all look rather too similar.

In the end, as a 'designer', I felt I'd got more of a sense of achievement having built my own Conky (almost) from scratch. Somehow, it seems to me a more 'Linux' way of doing things! Just as you will never really learn HTML or CSS by using a WYSIWYG editor, so you will never really learn how a Conky works until you get your hands a bit dirty...

However... The Conky Manager theme pack did provide me with a few useful commodities...

You recall that I was lamenting the fact that the original OpenLogos font did not having a character for Linux Mint (so I had to approximate something of my own, using Ubuntu Condensed)?

The ConkySymbols font, that came as part of one of the theme templates, does have Linux Mint logos! Hooray!

By exploring the .conkyrc files of one or two of the Conky Manager themes, I was also able to find scripts that show my Wi-Fi signal strength (something I'd been searching high and low for!) and, just for the sheer heck of it, the ID of the Wi-Fi router. I was also able to substitute some nicer looking icons for the 'Network' section of the Conky as a whole.

Here's that updated .conkyrc, then - just a few subtle differences since last time, but they're all differences I'd been striving for! :-


# Conky by http://jameshardy88.deviantart.com/art/Conky-JamesHardy88-122466724
# Modified by Umair - http://www.NoobsLab.com
# Further modified by ppMinty 2014

# Use Xft?
use_xft yes
xftfont Verdana:size=9
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 300 0
#maximum_width 300

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color 60cc90
default_shade_color black
#default_outline_color white
own_window_colour white

# 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
# same thing as passing -x at command line
gap_x 40
gap_y 30

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none

TEXT
${alignc}${time %A} ${time %e %B %G}

${color green}${font LCDMono:size=40} ${time %H:%M}${font}${color}
${voffset 4}${font ConkySymbols:size=30}u${font}${alignr}Linux Mint Debian Edition MATE 64-bit
${font StyleBats:size=15} ${font}Kernel: ${alignr}${kernel}
${font StyleBats:size=15} ${font}Hostname: ${alignr}${nodename}


SYSTEM MONITOR ${hr 1}
${font StyleBats:size=15} ${font}${alignr}Core 1: ${color white}${cpu cpu1}%${color} ${cpubar cpu1 8,110}
${font StyleBats:size=15} ${font}${alignr}Core 2: ${color white}${cpu cpu2}%${color} ${cpubar cpu2 8,110}
${font StyleBats:size=15}A${font} CPU: ${color white}${cpu}%${color} (@ ${color white}${freq}MHz${color}) ${alignr}${cpubar cpu0 8,110}
${font StyleBats:size=15}g${font} RAM: ${color white}$memperc%${color}, SWAP: ${color white}$swapperc%${color} ${alignr}${membar 8,110}
${font StyleBats:size=15}f${font} Hard Drive: ${alignr}${color white}${fs_free /home}${color} available (of ${color white}${fs_size /home}${color})
${font Webdings:size=15}~${font} Battery: ${color white}${battery_percent BAT1}%${color} ${alignr}${if_match ${battery_percent BAT1} <= 9}${color red}${battery_bar 8,110 BAT1}${color}${endif}${if_match ${battery_percent BAT1} >= 10}${if_match ${battery_percent BAT1} <=49}${color orange}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 50}${if_match ${battery_percent BAT1} <=79}${color yellow}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 80}${if_match ${battery_percent BAT1} <=99}${color green}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 100}${color white}${battery_bar 8,110 BAT1}${color}${endif}
${font StyleBats:size=15}q${font} Uptime: ${alignr}${color white}${uptime}${color}
${font StyleBats:size=15}k${font} Processes: ${alignr}${color white}$processes${color} (${color white}$running_processes${color} running)

Highest CPU $alignr CPU% MEM%
${hr 1}
${color white}${top name 1}$alignr${top cpu 1} ${top mem 1}
${top name 2}$alignr${top cpu 2} ${top mem 2}
${top name 3}$alignr${top cpu 3} ${top mem 3}${color}


NETWORK ${hr 1}
${if_existing /proc/net/route wlan0}${voffset 4}${font ConkySymbols:size=10}d${font} Total Upload: ${alignr}${color white}${totalup wlan0}${color} ${upspeedgraph wlan0 8,110}
${voffset 4}${font ConkySymbols:size=10}e${font} Total Download: ${alignr}${color white}${totaldown wlan0}${color} ${downspeedgraph wlan0 8,110}
${voffset 4}${font ConkySymbols:size=10}I${font} Local IP Address: ${alignr}${addr wlan0}
${voffset 4}${font ConkySymbols:size=10}g${font} Wi-Fi ID: ${alignr}${wireless_essid wlan0}
${voffset 4}${font ConkySymbols:size=10}b${font} Signal Strength: ${alignr}${color white} ${wireless_link_qual_perc wlan0}%${color}
${else}${if_existing /proc/net/route eth1}
${voffset 4}${font ConkySymbols:size=10}d${font} Total Upload: ${alignr}${color white}${totalup eth1}${color} ${upspeedgraph eth1 8,110}
${voffset 4}${font ConkySymbols:size=10}e${font} Total Download: ${alignr}${color white}${totaldown eth1}${color} ${downspeedgraph eth1 8,110}
${voffset 4}${font ConkySymbols:size=10}I${font} Local IP Address: ${alignr}${addr eth1}
${voffset 4}${font ConkySymbols:size=10}g${font} Wi-Fi ID: ${alignr}${wireless_essid eth1}
${voffset 4}${font ConkySymbols:size=10}b${font} Signal Strength: ${alignr}${color white} ${wireless_link_qual_perc eth1}%${color}
${endif}
${else}${if_existing /proc/net/route eth0}
${voffset 4}${font ConkySymbols:size=10}d${font} Total Upload: ${alignr}${color white}${totalup eth0}${color} ${upspeedgraph eth0 8,110}
${voffset 4}${font ConkySymbols:size=10}e${font} Total Download: ${alignr}${color white}${totaldown eth0}${color} ${downspeedgraph eth0 8,110}
${voffset 4}${font ConkySymbols:size=10}I${font} Local IP Address: ${alignr}${addr eth0}
${voffset 4}${font ConkySymbols:size=10}g${font} Wi-Fi ID: ${alignr}${wireless_essid eth0}
${voffset 4}${font ConkySymbols:size=10}b${font} Signal Strength: ${alignr}${color white} ${wireless_link_qual_perc eth0}%${color}
${else}No network connection${endif}${endif}${endif}${hr 1}


That's not to say, of course, that there won't be any more changes, as I pick up an occasional tweak or handy hint from here and there...





Wednesday, May 7, 2014

More fun with a Linux desktop

Further explorations with the MATE desktop, including finally getting that Conky to be JUST as I wanted it (well almost...)

Since last I explored the possibilities of Conky (and other such esoteric matters) on these pages, my Lenovo laptop has had a slight change of scenery.

I'm sticking with Linux Mint and I still prefer the MATE desktop over the Cinnamon flavour, but now I've switched over to the Debian Edition (LMDE). This has its advantages and disadvantages, as you find with all things Linux.  

Pro: Instead of feeling the need to completely replace your Linux Mint installation every time there a new version (you say you're not going to do this, but you always end up wanting to try new things in Linuxland!), with Debian the updates are 'rolling' - that is to say a few simple scripts typed into the terminal window and you're dragged screaming up to date without having to remove anything or back up the old stuff first (in theory!).  

Con: because it skips over the Ubuntu way of doing things and doesn't use Personal Package Archive repositories for your update manager to get its data from, all those cool Ubuntu add-ons that you would 'ppa' before (like the noobslab.com themes that I explored on my previous bloggy project here) are no longer so easily accessible or compatible (There are 'ways', of course...)

The Conky

When I last blogged about customizing my Conky, I mentioned that there were a couple of things that I hadn't quite got right at the time, plus there were also some additional features that I wanted to include, but hadn't figured out yet. Well, I'm getting there!

These included adding some script that would make the battery indicator change colour according to the state of the power supply. So if the lappy is powered via the mains adaptor, then the bar stays white. When I find myself relying on batteries, then the colour will change from green to yellow to orange and finally to red just as it's about to give up the ghost. I must admit, I've never let it go any lower than green (except in 'tests' for this project), but it's nice to know that it finally does what I wanted.

I've also trimmed some of my previous Conky's text - some of the network/wi-fi stuff was a tad redundant (Really, I'd be satisfied with just an indicator that tells me the strength of the wi-fi connection, if anyone knows how to do this?). I didn't see why the swapfile needed a whole line of its own as it so rarely gets accessed by the system, if at all.

For obscure reasons of my own that are now lost among the ancients, I wanted to make the clock look more like an LCD digital display. I downloaded a bunch of free fonts until I settled on one that looked the part - LCDMono, it's called. There's a wee bit of trial and error involved in getting the clock to centre on the column like that, because the ${alignc} command seemed to push it off the edge of the screen everytime. I used some manual spacing instead. Conky's approach to typographical correctness leaves a lot to be desired! Oh, for good old CSS!

Having chosen a tasteful new background wallpaper that I could comfortably live with, I wanted to colour-coordinate the Conky to match. (Ah! now you've got me... I can't remember where this wallpaper originally came from! I have a hunch it was part of a previous Noobslab collection?). I'm on more familiar territory here, since with Conky scripts you can specify colours as hexadecimal values, the same as you do in HTML or CSS. I used my favourite Firefox color-picker plug-in Rainbow to get the exact shade of green I wanted to match. Most of the 'active' information on the display is in white, apart from the 'glowing' green digital clock and the aforementioned, colour-shifting battery bar... Anyway, here's my .conkyrc script in its entirety...


# Conky by http://jameshardy88.deviantart.com/art/Conky-JamesHardy88-122466724
# Modified by Umair - http://www.NoobsLab.com
# Further modified by ppMinty 2014

# Use Xft?
use_xft yes
xftfont Verdana:size=9
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 300 0
#maximum_width 300

# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_margin 5
# border width
border_width 1

# Default colors and also border colors
default_color 60cc90
default_shade_color black
#default_outline_color white
own_window_colour white

# 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
# same thing as passing -x at command line
gap_x 40
gap_y 30

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none

TEXT
${alignc}${time %A} ${time %e %B %G}

${color green}${font LCDMono:size=40} ${time %H:%M}${font}${color}

${hr 1}
${font Ubuntu Condensed:size=16}linux mint${font}${alignr}Debian Edition MATE 64-bit
${font StyleBats:size=15} ${font}Kernel: ${alignr}${kernel}
${font StyleBats:size=15} ${font}Hostname: ${alignr}${nodename}

SYSTEM MONITOR ${hr 1}
${font StyleBats:size=15} ${font}${alignr}Core 1: ${color white}${cpu cpu1}%${color} ${cpubar cpu1 8,110}
${font StyleBats:size=15} ${font}${alignr}Core 2: ${color white}${cpu cpu2}%${color} ${cpubar cpu2 8,110}
${font StyleBats:size=15}A${font} CPU: ${color white}${cpu}%${color} (@ ${color white}${freq}MHz${color}) ${alignr}${cpubar cpu0 8,110}
${font StyleBats:size=15}g${font} RAM: ${color white}$memperc%${color}, SWAP: ${color white}$swapperc%${color} ${alignr}${membar 8,110}
${font StyleBats:size=15}f${font} HARD DRIVE: ${alignr}${color white}${fs_free /home}${color} available (of ${color white}${fs_size /home}${color})
${font Webdings:size=15}~${font} BATTERY: ${color white}${battery_percent BAT1}%${color} ${alignr}${if_match ${battery_percent BAT1} <= 9}${color red}${battery_bar 8,110 BAT1}${color}${endif}${if_match ${battery_percent BAT1} >= 10}${if_match ${battery_percent BAT1} <=49}${color orange}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 50}${if_match ${battery_percent BAT1} <=79}${color yellow}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 80}${if_match ${battery_percent BAT1} <=99}${color green}${battery_bar 8,110 BAT1}${color}${endif}${endif}${if_match ${battery_percent BAT1} >= 100}${color white}${battery_bar 8,110 BAT1}${color}${endif}
${font StyleBats:size=15}q${font} Uptime: ${alignr}${color white}${uptime}${color}
${font StyleBats:size=15}k${font} Processes: ${alignr}${color white}$processes${color} (${color white}$running_processes${color} running)

Highest CPU $alignr CPU% MEM%
${hr 1}
${color white}${top name 1}$alignr${top cpu 1} ${top mem 1}
${top name 2}$alignr${top cpu 2} ${top mem 2}
${top name 3}$alignr${top cpu 3} ${top mem 3}${color}

NETWORK ${hr 1}
${if_existing /proc/net/route wlan0}${voffset 4}${font PizzaDude Bullets:size=12}N${font} Total Upload: ${alignr}${color white}${totalup wlan0}${color} ${upspeedgraph wlan0 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}T${font} Total Download: ${alignr}${color white}${totaldown wlan0}${color} ${downspeedgraph wlan0 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}a${font} Local IP: ${alignr}${addr wlan0}
${else}${if_existing /proc/net/route eth1}
${voffset 4}${font PizzaDude Bullets:size=12}N${font} Total Upload: ${alignr}${color white}${totalup eth1}${color} ${upspeedgraph eth1 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}T${font} Total Download: ${alignr}${color white}${totaldown eth1}${color} ${downspeedgraph eth1 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}a${font} Local IP: ${alignr}${addr eth1}
${endif}
${else}${if_existing /proc/net/route eth0}
${voffset 4}${font PizzaDude Bullets:size=12}N${font} Total Upload: ${alignr}${color white}${totalup eth0}${color} ${upspeedgraph eth0 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}T${font} Total Download: ${alignr}${color white}${totaldown eth0}${color} ${downspeedgraph eth0 8,110}
${voffset 4}${font PizzaDude Bullets:size=12}a${font} Local IP: ${alignr}${addr eth0}
${else}No network connection${endif}${endif}${endif}${hr 1}


The Panel

Once again I've created a 'shiny' background texture for the panel bar that is more interesting to look at than the flat off-white one that is MATE's default. I previously experimented with various 'tints of colour', but here I've gone for something more 'silver'-looking, which matches the big silver MintMenu. I've now gone back to using that 'advanced' menu option instead of the simplified version I was using previously - although I still can't for the life of me understand why anyone would want a search function there on the menu itself. Still, horses for courses! I know of at least one Brazilian gentleman who is doing wonderful things with 'configurable' menus that seem to do everything, but they're not for me.

I tweaked some of the colour settings for the menu (the tool-tips, the section headings) to match my scheme, but mostly I left it alone this time. In a previous installation, I'd had a 'disaster' when I tried to customize the icons. Having the aluminium-look panel bar means that the minimized window tile thingies no longer clash or stick out like a sore thumb. You can see that I'm still obstinately sticking to a 'classic' Windows-type layout ("other layouts are available") with the bar at the bottom of the screen, a "start menu" in the bottom left where it belongs and the barest minimum of desktop icons, as is my long-established wont.



The Sources

Conky Hardy
http://www.noobslab.com/2012/07/install-conky-hardy-in-ubuntulinux.html
for LMDE, follow "wget Installation Method", scroll down to where it says "For Gnome Classic, Mate, and other:" and read on... This, of course, is the original Conky Hardy before I got my hands on it! You will need to install it first, then replace the .conkyrc script with one like mine.

Wallpaper
http://www.noobslab.com/2013/06/zoncolor-themes-and-icons-package-for.html
Here we go! I found it! This page contains loads of other zonColor themes (icons, colour schemes, etc etc). You might recall that I used some zonColor icons for my King Crimson-themed project last time. The wallpaper I'm using now is part of a collection called zonColor Wallpapers (not surprisingly!). Scroll down this page to where it says "Download zonColor Wallpapers" and save the ZIP file.

Fonts used in Conky
I've used standard Linux fonts that come with any distro - most of the text is set in Verdana, which is part of the Microsoft Windows Core Fonts set. If you don't have that already, then you can add it with sudo apt-get install ttf-mscorefonts-installer. (DejaVu Sans is a pretty good match though). I typeset the words 'linux mint' in Ubuntu Condensed - because the symbols font OpenLogos has characters for all the other Linux distros but, sadly, not Mint. I had to 'make my own'. It's not a bad approximation. All the other little icons are either from StyleBats, Webdings or PizzaDude Bullets. The font used for the glowing green digital clock is LCDMono, which is part of this collection:
http://www.dafont.com/lcd-lcd-mono.font
When you add any fonts to your system, remember to run sudo fc-cache -fv to complete the installation.