09 January 2012

42. Installing gnome-shell extensions and icon theme on debian


FOR GNOME/GNOME-SHELL 3.4 see this as well: http://verahill.blogspot.com.au/2012/06/gnome-34-frippery-extensions-in-debian.html

Here are a few quick fixes to make Gnome 3/gnome-shell work and look a bit better:

An example of my desktop as it looks today (April 201) is shown below:
My desktop, in response to a comment below..

And here a rough indication of what is done with the gnome-shell extensions below:
From top left, clockwise: applications menu, panel favourites (with faenza icons), move-clock, bottom panel and static workspaces. The information on the right hand side is done via conky.


Index:
1. gnome-shell extensions
2. Getting maximize, minimize and close back
3. prettier icon theme --faenza
4. Using conky instead of gnome applets to monitor computer


1. gnome-shell extensions
NOTE: download the .tgz file to your home folder e.g. /home/me/ or the files won't go to the right place on tar -xvf

The Gnome-shell Frippery extensions ("for grumpy old sticks in the mud") are what you're looking for: http://intgat.tigress.co.uk/rmy/extensions/index.html

a) For gnome/gnome-shell 3.0:
In /home/me/
wget http://intgat.tigress.co.uk/rmy/extensions/gnome-shell-frippery-0.2.8.tgz
tar -xvf gnome-shell-frippery-0.2.8.tgz

That's it! The extensions will only be installed for the user doing the untar-ing.

b) For gnome-shell 3.2:
UPDATE: 1/2/2012 -- Wheezy upgraded to gnome-shell 3.2.2.1 on 31/1/2012. Here's how to get a useful desktop environment again:

Either:
Use iceweasel/firefox, and visit the following pages:
https://extensions.gnome.org/extension/13/applications-menu/
https://extensions.gnome.org/extension/3/bottom-panel/
https://extensions.gnome.org/extension/12/static-workspaces/
https://extensions.gnome.org/extension/2/move-clock/
https://extensions.gnome.org/extension/4/panel-favorites/
https://extensions.gnome.org/extension/14/shut-down-menu/

All of the frippery extensions are listed here:
https://extensions.gnome.org/accounts/profile/rmyorston

Install the extensions by settting on the slider icon to ON.


OR:
In /home/me/ (replacing 'me' with your username)

wget http://intgat.tigress.co.uk/rmy/extensions/gnome-shell-frippery-0.3.6.tgz
tar -xvf gnome-shell-frippery-0.3.6.tgz

IF the shell extensions don't show up -- make sure that they are in /home/me/.local/share/gnome-shell/extensions/ -- if not you may want to extract and put the files there manually.

Either way, once you installed using firefox or in the terminal:
Log in and out of gnome-shell -- alt+f2 + r only enabled the applications-menu, bottom-panel and static workspaces, but the other extensions wouldn't work. This is based on a case of installing the extensions immediately after dist-upgrading to install gnome-shell v 3.2.2.1

You can now open gnome-tweak-tool (install it as shown below under "2. Getting max/min/close back") -- in the gnome-shell activities/launchers window or whatever they call it it shows up as Advanced Settings or start it using alt+f2 or terminal (gnome-tweak-tool). Click on Shell Extensions, and enable everything.

OR open firefox/iceweasel and go to https://extensions.gnome.org/local/ to enable/disable extensions.


Note:
The extensions.gnome.org versions of Frippery's Shutdown menu, move clock and panel favourites wouldn't work with 3.2 on a first try, nor would the extensions downloaded by wget and untared -- logging in and out of gnome-shell solved that.

Trying to find something on the extensions.gnome.org website is at the moment hopeless - hopefully they'll implement a useful search function soon.




2. Getting maximize, minimize and close back
Install gnome-tweak-tool
sudo apt-get install gnome-tweak-tool

Start it. Go to Shell. Under 'arrangement of buttons on title bar' select all.




3. prettier icon theme --faenza
I've never been a fan of the default icon themes for gnome. I used the linux lex icons (http://linuxlex.cz/en/?option=com_phocadownload&view=file&id=2:linuxlex-8-icon-theme&Itemid=350) for gnome 2.x/compiz

In my opinion the blockier icons in faenza work better with gnome3/gnome-shell than the fancy linux lex icons.

So...
Install the gnome-tweak-tool
sudo apt-get install gnome-tweak-tool

To get faenza
mkdir ~/tmp
cd ~/tmp
wget http://www.deviantart.com/download/173323228/faenza_icons_by_tiheum-d2v6x24.zip
unzip faenza_icons_by_tiheum-d2v6x24.zip
./INSTALL
cd ~/.icons
mkdir faenza
mv * faenza/

Now start gnome-tweak-tool. Under Interface  --> Icon Theme -- select faenza
Do alt+f2 and type r, hit enter to restart.


4. Using conky instead of gnome applets to monitor computer
conky is a lot more flexible and capable than any single gnome-applet. But then conky doesn't sit quietly on a panel but is instead overlaid on top of you desktop.

To install
sudo apt-get install conky

Edit configuration file
sudo vim /etc/conky/conky.conf

Here's a sample conky.conf
-------------------------

alignment top_right
double_buffer yes
background yes
border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=12
gap_x 20
gap_y 60
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
own_window yes
own_window_class Conky
own_window_type desktop
own_window_transparent yes
stippled_borders 0
update_interval 1.5
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no

TEXT 
${execi 60 acpi |gawk '{print $3,$4,$5}'|sed 's/\,/\t/g'}
${addr eth0}/${addr wlan0}
$hr
${color grey}Uptime:$color $uptime
CPU:$alignc $cpu%
$alignc $color ${cpugraph 15,200 ffff00 ff0000 -l -t}  
RAM:$alignc $mem/$memmax
$alignc$color ${memgraph 15,200 ffff00 ff0000 -t}
I/O:$alignc $diskio_read/$diskio_write
$alignc$color ${diskiograph 15,200 ffff00 ff0000 -t}
${color grey}Frequency (in GHz):$color
${freq_g 1} ${freq_g freq_g2}
$color CPU: $alignr${acpitemp}°C 
$color Fan(rpm): $alignr${execi 1.5 sensors|grep fan1|cut -c12-18} 
#${color grey}CPU Usage: ${cpubar 10,100 ffffff ff0000 -l -t} $cpu%
${cpugraph cpu1 15,100 ffff00 ff0000 -t} ${cpugraph cpu2 15,100 ffff00 ff0000 -t}
$hr
${color grey}File systems:
 / $color${fs_used /}/${fs_size /}
 /home $color${fs_used /home}/${fs_size /home}
${color grey}eth0 ${color red} ${upspeed eth0}/${color green} ${downspeed eth0} ${color grey}
${color grey} ${upspeedgraph eth0 15,100 550000 ff0000 -l -t} ${color grey} ${downspeedgraph eth0 15,100 0000ff 00ff00 -l -t} ${color grey}
${color grey}wlan0 ${color red} ${upspeed wlan0}/${color green} ${downspeed wlan0} ${color grey}
${color grey} ${upspeedgraph wlan0 15,100 550000 ff0000 -l -t} ${color grey} ${downspeedgraph wlan0 15,100 0000ff 00ff00 -l -t} ${color grey}
$hr
${color grey}Name CPU%   MEM%
${color} ${top name 1} ${top cpu 1} ${top mem 1}
${color} ${top name 2} ${top cpu 2} ${top mem 2}
${color} ${top name 3} ${top cpu 3} ${top mem 3}
$hr
${font Arial:bold:size=12}${color Tan1}WORLD TIME ${color DarkSlateGray}

$font${color}San Francisco ${execi 60 ping -c 1 berkeley.edu | grep icmp_req |gawk '{print $8}'| cut -c6- } ms$alignr${tztime America/Los_Angeles %H:%M}


$font${color}Melbourne ${execi 60 ping -c 1 rmit.edu.au | grep icmp_req |gawk '{print $8}'| cut -c6- } ms$alignr${tztime Australia/Melbourne %H:%M}



-----

You can get more information about available objects here: http://conky.sourceforge.net/variables.html

To make conky start up every time you start your computer, start gnome-session-properties, and add conky. That works most of the time but is the old gnome 2.3 way of doing things. Here's a post on gnome-shell specifically and how to add start-up applications: http://linuxandfriends.com/2011/06/01/how-to-add-startup-programs-in-gnome-3/

08 January 2012

41. Chinese character and input support on debian testing

Update: You should also install support for gtk and gtk3:
sudo apt-get install ibus-gtk3 ibus-gtk
in order to be able to use it with e.g. thunderbird.

Original post:
Here's how to set up Chinese (simplified) support in Gnome 3 /gnome-shell and the terminal (bash).

First install the fonts:
sudo apt-get install fonts-arphic-*

Next. add Chinese via locales:
sudo dpkg-reconfigure locales

Select
zh_CN.UTF-8

(For traditional characters choose zh_HK, zh_SG or zh_TW)

As default language English is probably a good idea
In my case it's en_AU.UTF-8

Edit ~/.bashrc and add the following lines:
LANGUAGE=zh_CN.UTF-8
LANG=zh_CN.UTF-8

Run
source .bashrc

Install ibus:
sudo apt-get install ibus-pinyin 
This pulls another 18 packages with it

Start ibus-daemon in terminal
An icon in the notification tray still appear
Right-click, choose Preferences (P)
Click on the second tab (input methods)
Select an input method -> Chinese -> Pinyin

You should now be able to choose between regular (latin) input and Chinese characters using Ctrl+Space.

To make ibus-daemon start with gnome, run
gnome-session-properties
and add
ibus-daemon

And you're more or less done.

Sogou is a popular pinyin database on the Windows platform -- but afaik it's not available for Linux. On Linux, it seems that the ibus-pinyin-db-open-phrase database is the default ibus database used to guess what characters you intend to type, but you can also install and select either ibus-googlepinyin or ibus-pinyin-db-android. After installation you need to select the database by going to preferences in the ibus daemon and selecting it as input method. Not being Chinese I can't tell whether sogou, google pinyin and android pinyin are comparable.

Sogou does however work with Google Chrome/Chromium on linux -- go to Preferences/Extensions -- Get More Extensions, and install the Sogou Cloud Pinyin Extension for Chrome.


04 January 2012

40. Getting started with GNUCash

I've both recently relocated and started my own research group, so keeping track of money has become important -- it's difficult to get an overview of your economy in the beginning in a new country, and you better keep track of your research grants because the University WIL screw it up.

As someone with nil background in finance getting to grips with GnuCash has taken some time.

I've got two databases -- one for my personal finances, and one for my grants. I'll only show how to set up a database for personal finances here.

For most of the steps there isn't much to say...
Choose the simplest type of account -- Checkbook.

You now have four main types of accounts: Assets, Equity, Expenses and Income. The assets accounts has a sub-account called  Checking Account.


Double-click on the Checking account, put the current amount of money in your account under Deposit, and select Equity:Opening Balance under Transfer.


You now have money to spend.

Time to customise the set-up. Create an new account -- select placeholder, income and New Top Level Account. We're calling it John Doe.

(You'll find that only top level accounts can be all types of accounts. Some accounts can only be income/expenses, while other types (e.g. Bank) can't be either of those.)

 Next, create a series of accounts and select either income or expenses depending on type:


 If you have cash in your wallet you can put that cash as the opening balance of a cash account under current assets -- put the current amount of money in your account under Deposit, and select Equity:Opening Balance under Transfer. Make main expenses and income accounts under your name. Add specific sub-accounts.

Note how it says Imbalance: 3,000 (the amount added to income/salary). Transfer that money (income/salary) to your checking account:


 Then you get:

 We can move money from the checking account to cash (i.e. ATM withdrawal), pay by cash etc.

Here's the double-entry aspect of GnuCash -- every transaction shows up twice:

Here's another overview of the accounts:


Anyway, at this point it's fairly easy to start exploring and setting up more complex accounts.








Essentially, GnuCash SEEMS to be powerful, but for some reason I can't bring myself to read the documentation. Maybe it's the way it's written, maybe it's the topic at hand (few scientists relish the dirty world of money...or so we like to think), or maybe it's just me. Regardless, it's a piece of software you SHOULD learn how to use if you need to keep track of spending -- as most scientists do.