blogable.eu

computer – mobile phone – life

Browsing Posts in ubuntu

And again, it’s Conky-time. After writing a small how-to and integrating Amrok 2 into this nice little piece of software, I decided to write yet another Conky post. This time about starting the programme automatically with each start of Ubuntu. This is done by creating a script, containing the following:

#!/bin/sh
sleep 25
conky

Name the script .conky_autostart and save it. To make it executable type chmod a+x .conky_autostart. That’s basically it. Now you can add this file to your Autostart and enjoy Conky every time you boot. The time value (25) can be reduced. I achieved best results with such a high number but others might be happy with 10 or even less. The value describes the delay with which Conky will start. If you use Beryl and encounter starting problems, increase the value until it works. Flickering during the use of Conky is a known issue and can be solved by editing your settings in the .conkrc file: double buffer = yes and own window = yes.

Continuing my Conky post series, I will introduce you to the integration of Amarok 2 into Conky. I prefer this option over the OSD (On Screen-Display for song information) any day. The reason is that the OSD will only appear at the beginning of a song and while it does that, it tends to be in the way. I’m aware that you can change the position, but I’m still not happy with that. Wherever it is, it will overlay your internet browser, image editor or similar. Not being able to check what song is curently playing (if you missed the start) and sometimes simply not wanting to see every song are other reasons for me to implement Amarok 2 into Conky. I repeatedly said Amarok 2, because the integration of Amarok 1 is a different story.

Read my Conky article if you still don’t know where to start with Conky. Otherwise copy and paste this into your .conkyrc file:

${color #000000}Music ${hr 1}
${color #BBB3B3} ${execi 10 ~/.conky/amarok artist}
${color #BBB3B3} ${execi 10 ~/.conky/amarok title}
${color #BBB3B3} ${execi 10 ~/.conky/amarok album}
${color #BBB3B3} ${execi 10 ~/.conky/amarok year}
${color #BBB3B3} ${execi 10 ~/.conky/amarok genre}

For further questions on this, visit this forum, where additional questions and ideas on my code are available. Afterall, this is just a basis you can build upon. :) After you integrated the above text, you will need to install qdbus which is available in the software packages.

Until now, this by itself will not work. As you can see in the above text, I referred to ./conky. This is the folder you will need to create a new document in, I called amarok. As far as I know you can change both folder- and filename, but it must be changed in the above text accordingly. Now you can copy and paste the following content into the just created file (yes we’re almost done ;) ):

#!/bin/bash
# based on: amaroK info display script by eirc <eirc.eirc@gmail.com>
# amarok2 info display script by fireandfuel <fireandfuel@hotmail.de>
#
# requirements: amaroK 2 (!)

case “$1″ in

# Now Playing Info
artist) qdbus org.kde.amarok /Player GetMetadata | grep artist ;;
title) qdbus org.kde.amarok /Player GetMetadata | grep title ;;
album) qdbus org.kde.amarok /Player GetMetadata | grep album ;;
year) qdbus org.kde.amarok /Player GetMetadata | grep year ;;
genre) qdbus org.kde.amarok /Player GetMetadata | grep genre ;;

esac

Once this file is saved, type the following command into your console: chmod u+x name_of_the_script. If the document (script) is placed elsewhere then your desktop, you will have to add the details about that into the command or change into the folder where the file is save and enter the command there. Restart Conky and enjoy Amarok 2 details on your desktop.

Conky is a really nice little programme when it comes to monitoring and displaying various system information on your desktop.

I’m a friend of tidy desktops, but need detailed information about my system, especially while using virtualisation software. This information should include my CPU and RAM usage as well as networking details. Conky does a great job with this, when set up correctly. While it isn’t a programme that shows off with it’s graphical user interface, simply because it has none, it’s easy on your resources.  Not having a GUI might sound annoying and like a lot of work at first, but it turns out to be not that big a problem at all.

Getting started:

To install Conky in Ubuntu type sudo apt-get install conky into your console or download the package and  compile it from source. Now create a texfile with an editor of your choice and name it .conkyrc. After pasting the following content, you can save it where you like. Keep in mind that you want to be able to find it quickly though, which is why I’m using the Home folder.

To give you an impression of what Conky is capable of, copy and paste this into the just created document:

# set to yes if you want Conky to be forked in the background
background yes
use_xft yes
xftfont HandelGotD:size=9
xftalpha 0.5
update_interval 4.0
total_run_times 0
own_window no
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 5
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default colour grey
default_shade_color grey
default_outline_color grey
alignment bottom_right
gap_x 12
gap_y 48
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT

${color #000000}Time & Date ${hr 1}
${color #BBB3B3}${time %k:%M:%S}
${color #BBB3B3}${Time %A, %m.%d.%Y}

${color #000000}System ${hr 1}
${color #BBB3B3}Uptime $alignr $uptime
${color #BBB3B3}Power $alignr $acpiacadapter
${color #BBB3B3}Battery $alignr $battery
${color #BBB3B3}Temperature $alignr $acpitemp°C
${color #BBB3B3}CPU $alignr ${cpu cpu0}%
${color #BBB3B3}$cpubar $alignr
${color #BBB3B3}Ram $alignc $mem / $memmax $alignr $memperc%
${color #BBB3B3}$membar $alignr

${color #000000}Processes ${hr 1}
${color #BBB3B3}$processes processes ($running_processes running)
${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}
${top name 4} $alignr ${top cpu 4} ${top mem 4}
${top name 5} $alignr ${top cpu 5} ${top mem 5}

${color #000000}Network ${hr 1}
${color #BBB3B3}Traffic ${time %B}:                ${color #BBB3B3}Down:  ${execi 300 vnstat -m | grep “`LC_ALL=C date +”%b ‘%y”`” | awk ‘{print $3 $4}’} $alignr
${color #BBB3B3}Up:  ${execi 300 vnstat -m | grep “`LC_ALL=C date +”%b ‘%y”`” | awk ‘{print $6 $7}’} $alignr
${color #BBB3B3}Inbound $alignr ${downspeed eth0} kb/s
${color #BBB3B3}${downspeedgraph eth0} $alignr
${color #BBB3B3}Outbound $alignr ${upspeed eth0} kb/s
${color #BBB3B3}${upspeedgraph eth0}

In addition to that, you would have to install vnstat if you would like to see information about your traffic and internet speed.

To start, type conky in your console. When you make changes to the .conkyrc file and you would like to see whether it works and/or looks the way you want, type killall -SIGUSR1 conky. This will restart Conky directly with your changes.

To find out more about Conky, check the documentary on settings or read forums such as Ubuntu Forums. Especially this is a good start in my opinion, as you can understand the different commands by looking at the screenshots and comparing the provided code.

# set to yes if you want Conky to be forked in the background
background yes
use_xft yes
xftfont HandelGotD:size=9
xftalpha 0.5
update_interval 4.0
total_run_times 0
own_window no
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 5
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default colour grey
default_shade_color grey
default_outline_color grey
alignment bottom_right
gap_x 12
gap_y 48
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT

${color #000000}Time & Date ${hr 1}
${color #BBB3B3}${time %k:%M:%S}
${color #BBB3B3}${Time %A, %m.%d.%Y}

${color #000000}System ${hr 1}
${color #BBB3B3}Uptime $alignr $uptime
${color #BBB3B3}Power $alignr $acpiacadapter
${color #BBB3B3}Battery $alignr $battery
${color #BBB3B3}Temperature $alignr $acpitemp°C
${color #BBB3B3}CPU $alignr ${cpu cpu0}%
${color #BBB3B3}$cpubar $alignr
${color #BBB3B3}Ram $alignc $mem / $memmax $alignr $memperc%
${color #BBB3B3}$membar $alignr

${color #000000}Processes ${hr 1}
${color #BBB3B3}$processes processes ($running_processes running)
${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}
${top name 4} $alignr ${top cpu 4} ${top mem 4}
${top name 5} $alignr ${top cpu 5} ${top mem 5}

${color #000000}Network ${hr 1}
${color #BBB3B3}Traffic ${time %B}:                ${color #BBB3B3}Down:  ${execi 300 vnstat -m | grep “`LC_ALL=C date +”%b ‘%y”`” | awk ‘{print $3 $4}’} $alignr
${color #BBB3B3}Up:  ${execi 300 vnstat -m | grep “`LC_ALL=C date +”%b ‘%y”`” | awk ‘{print $6 $7}’} $alignr
${color #BBB3B3}Inbound $alignr ${downspeed eth0} kb/s
${color #BBB3B3}${downspeedgraph eth0} $alignr
${color #BBB3B3}Outbound $alignr ${upspeed eth0} kb/s
${color #BBB3B3}${upspeedgraph eth0}

${color #000000}Music ${hr 1}
${color #BBB3B3} ${execi 10 ~/.conky/amarok artist}
${color #BBB3B3} ${execi 10 ~/.conky/amarok title}
${color #BBB3B3} ${execi 10 ~/.conky/amarok album}
${color #BBB3B3} ${execi 10 ~/.conky/amarok year}
${color #BBB3B3} ${execi 10 ~/.conky/amarok genre}

Mac’s operating systems look stunning. No doubt about that. But what if you have a computer and no Mac? Well, if you’re using Ubuntu, you can check out Damien’s post at MakeTechEasier. This easy to follow step-by-step process provides you with all information necessary to achieve that look.

If you’re new to Ubuntu or don’t want to hassle through a guide for an afternoon, then Mac4Lin is probably the right option for you.

Dropbox allows you to store and sync files online wherever you are. This is especially useful when you find yourself working at different computer and don’t want to run around with a USB stick.

A document you’re working on, let’s say a thesis or homework, will be available wherever you are. Next to that, you will never have to worry about whether or not you’re editing the right version of your file. Confusing different versions of a document certainly cost me some time. :( Anyway. Understanding that synced files which are also saved online (good if your computer suddenly doesn’t start anymore for example) are a nice thing, let me show you how it works.

Getting started:

Visit Dropbox and download the software for your system (Windows, Mac and Linux are supported). Actually there’s no need to download as you can use a web interface, but for the ease of use I recommend you install the software.

Installation:

Windows: Run the freshly downloaded installation file. If you have a special folder for software on your harddisk you can choose that now. Otherwise simply click next. Once installed you can decide whether you want to use an already existing account or create a new one. If you have an account, enter your login details. If you’re new to Dropbox, you will have to enter the necessary details to open up a new account. After agreeing to the terms and conditions you can choose the size you desire. Be aware though that only the 2 GB version is free of charge. Skipping the tour, you can now decide where to put the folder for your Dropbox on your harddisk. Standard is your My Files folder. Finish and open your Dropbox.

Linux (Ubuntu): I will update this soon.

Usage:

Copy or move files and folder to your new My Dropbox folder. A blue symbol signals the automatically started syncing process while a green arrow confirms the successful syncronisation. Now you can enjoy your synced files wherever you are.

Sharing:

To share a picture, a spreadsheet or another file with friends who don’t have a Dropbox account, you have to copy or move your file to the Public folder. There, click with the right mouse button on the file you would like to share, choose the Dropbox submenu and select Copy public link. Paste this link in your next email for example to allow your friends to view or download the file.

Sharing a folder is another story and requires a Dropbox account. Create, copy/paste or move the folder you would like to share to your My Dropbox folder, right click and choose Share this folder from the Dropbox submenu. Login to your account and enter the email address from the user you would like to exchange your files with. After he/she accepted the invitation to share the folder, every change made will be visible for both. By repeating this process many users can access and share files.

Keep in mind that deleting or changing a file will effect all the people you’re sharing with, so you might want to keep a backup to yourself.

Update: Dropbox now changes the undo feature, which will not keep the files stored unlimited anymore, but 30days (free account). After that, files/folders will be deleted from history.

Something else that grabbed my attention was the announced free Iphone app that will be released in near future and I’m sure looking forward to get my hands on that.