Gentoo running notify-osd

View Comments // Written on Jul 30, 2009 // Info

notify osd gentoo Gentoo running notify osdI really liked the new Ubuntu notification system so I decided to install it on Gentoo too.

At first I found this overlay but it’s not updated and fails to download packages. Then I decided to compile it myself and found the process terribly easy… Here’re my steps

Download

Notify-osd is hosted on launchpad , and got lots of releases. I found that latest ones failed to compile on my environment so I chose the 0.9.12.

cd /opt/
sudo wget http://launchpad.net/notify-osd/0.9/0.9.12/+download/notify-osd-0.9.12.tar.gz
sudo tar xvf notify-osd-0.9.12.tar.gz
sudo rm -f notify-osd-0.9.12.tar.gz
sudo mv notify-osd-0.9.12/ notify-osd/
sudo chown -R ${USER}:${USER} notify-osd/
cd  notify-osd/

Installation

I preferred not installing on common folders but keeping everything under /opt instead. So no make install this time.

./configure
make

Quick Test

To check everything went fine let’s try killing the common daemon and use the new one instead.

killall notification-daemon 
/opt/notify-osd/src/notify-osd

I got a bunch of glib warning but I didn’t care so much. Now let’s try a notification (you might need to emerge x11-libs/libnotify if you don’t have it):

notify-send 'hello gentoo'

There it is! A cool black bubble on the top-right of the screen…

hellogentoo Gentoo running notify osd

System start

Obviously as I wanted to install it I don’t want to start it manually so let’s do something to make everything automatic on gnome start. This blog was my source for this step.

First of all let’s create the script needed to kill the notification daemon and start the new one.

touch /opt/notify-osd/startup.sh
chmod +x /opt/notify-osd/startup.sh
$EDITOR /opt/notify-osd/startup.sh

Paste these lines inside the file

#!/bin/bash
killall notification-daemon
sleep 1
/opt/notify-osd/src/notify-osd

Now let’s create the startup script. On Gnome they live under .config/autostart/ on every user’s home. So…

$EDITOR ~/.config/autostart/notify-osd.desktop

And paste following code

[Desktop Entry]
Type=Application
Name=notify-osd
Exec=/opt/notify-osd/startup.sh
Icon=system-run
Comment=
X-GNOME-Autostart-enabled=true

Ok I’m done! Next X reboot we got our brand new notification daemon up&running

Finishes

I had some bad visual effects with Evolution and mail-notification panel applet, opening gtk dialogs instead of using the notificaitons.

I disabled Evolution messages (kept the icon) just setting it from Edit -> plugins -> Notifications. Disabled everything but show icon.

Mail notification can use the new notifications but has to be set up from gconf-editor. Navigate in apps -> mail notification -> popups -> double click on actions and delete all.

Manage Chromium SSL certificates on Gentoo

View Comments // Written on Jul 23, 2009 // Open Source

gentoo chrome ssl Manage Chromium SSL certificates on Gentoo Just a quick reference to spread that it’s recently been possible to manage SSL certificates trought NSS Shared DB.

Management has not been enabled via gui yet, but it is possible to use nss tools to install and manage certs.

On GoogleGoogleGoogle code dedicated page there were useful generic instructions for linuxlinuxlinux but we (gentooist) got different commands to launch and a different way to install required nss tools. I added our purple way to do everything to google wiki but I’ll explain it better here.

First of all our nss tools are not installed via a different package but through an use flag of nss package. So to install them we need to add to our /etc/portage/package.use the following line

dev-libs/nss utils

Then we can follow google instructions having the watchfulness of putting nss before every command. So for example

certutil -d sql:$HOME/.pki/nssdb -L

becomes

nsscertutil -d sql:$HOME/.pki/nssdb -L

If you need to add pfx (pkcs12) certs you should use nsspk12util like following examples shows

nsspk12util -d sql:$HOME/.pki/nssdb -i 

Change Adobe Air apps default browser

View Comments // Written on Jul 07, 2009 // Open Source

Adobe Air BrowserI’m currently using Adobe Air just for Twitter clients, Seesmic and TweetDeckTweetDeckTweetDeck. I noticed that the browser used to open links was not the gnome default one (Epiphany in my case) but FirefoxFirefoxFirefox. After looking for firefox string into the apps folder I tried looking for it on the adobe air installation directory and… yes that was there.

Unfortunately it’s compiled in a .so files and as I couldn’t recompile it I decided using mighty vim to do the dirty trick.

First of all, to avoid segmentation faults errors the file have to remain of the same bytes of the original one => as firefox is composed by 7 chars I had to replace it with a 7 chars executable.  I then created a symlink called browser (7 digits) pointing to my epiphany binary

ln -s /usr/bin/epiphany /usr/local/bin/browser

Then I opened the .so file with vim ( in my case adobe air was installed on /opt/air , but this may vary depending on your installation method)

vim /opt/air/runtimes/air/linux/Adobe\ AIR/Versions/1.0/libCore.so

On vim I went to line 15500 doing

:15500

then looked for ‘firefox‘ and replaced it with ‘browser‘.
If you can’t find ‘firefox’ at line 15500 it’s probably due to a different sdk version. Try at line 16104 as suggested in the comments.
Closed and saved with

:wq

I then restarted the app and the links were being opened with epiphany. Using the symlink makes it very easy to switch from one browser to an other one. For example I switched from epiphany to Google ChromeChromeChrome just doing

rm /usr/local/bin/browser && ln -s /opt/chrome/google-chrome /usr/local/bin/browser

Update: ubuntu users

In the comments, Victor gave some good advices for Ubuntu users.

Update: more abstraction

In the comments, mjg reported how to improve abstraction using x-www-browser

Update: default browser on Gnome Environments

In the comments, saidimu pointed out how to preserve your default browser preferences in Ubuntu

Google Chrome natively running on Gentoo Linux

View Comments // Written on Jun 05, 2009 // Open Source

This is just a quick & (very) dirty trick to run Google ChromeChromeChrome on linuxlinuxlinux using a precompiled debian package instead of compiling the enormous source tarball.

Step 1. Download the Deb

Get your browser to Developer Download page for Linux x86 and accept GoogleGoogleGoogle Terms of service.

Step 2. Unpack the unpackable

Open a terminal emulator and cd to your download directory ( mine is Desktop )

cd ~/Desktop
mv google-chrome-unstable_current_i386.deb /tmp
cd /tmp
ar x google-chrome-unstable_current_i386.deb
tar xvf data.tar.gz
sudo cp opt/google/chrome /opt/ -r
sudo ln -s /google/chrome/chrome /usr/bin/

Step 3. Link some libs

Chrome requires some libs which I didn’t find in my gentoo portage tree. Probably I could update nss and nspr but I prefer using stable ebuilds so I decided to manually link some missing libs…

ln -s /usr/lib/nss/libnss3.so.12 /usr/lib/libnss3.so.1d
ln -s /usr/lib/nss/libnssutil3.so.12 /usr/lib/libnssutil3.so.1d
ln -s /usr/lib/nss/libsmime3.so.12 /usr/lib/libsmime3.so.1d
ln -s /usr/lib/nss/libssl3.so.12 /usr/lib/libssl3.so.1d
ln -s /usr/lib/nspr/libplds4.so.7 /usr/lib/libplds4.so.0d
ln -s /usr/lib/nspr/libplc4.so.7 /usr/lib/libplc4.so.0d
ln -s /usr/lib/nspr/libnspr4.so.7 /usr/lib/libnspr4.so.0d

Step 4. Run it

If you want to simply launch it you just need to run chrome from anywhere.
If you want to create a launcher you can use chrome as command and choose an icon from /opt/chrome/

This is just a pre-release and many features are missing. Anyway I’m quite happy about having the possibility to try out Google Chrome without compiling it (it would be a cpu suicide I believe) and I noticed that it seems incredibly fast on launching. Maybe it’s because not all features have been built in, but it’s impressive in any case!

Here’s a screen I made from my Gentoo Box

Google chrome on Gentoo

Bash Completition on Gentoo

View Comments // Written on Dec 03, 2008 // Open Source

Here’s how to get a personalized and satisfactory completion on Gentoo installations..

Fisrt of all you need an use flag set widely in your system so that every software you are going to emerge (or re-emerge) if is capable will be added to your completition choices. To do so just open our magic make.conf with your favourite editor (I use vim, you can use emacs, nano, pico…i don’t really care about wars)
# vim /etc/make.conf
then find the USE variable and add inside it the string
bash-completion
Now you have the option to re-emerge all previously installed programs that have bash-completition USE flag. To do so just do
# emerge -a --newuse world
Right now you got the correct completitions available but to use them you need to install the bash completition ebuild so…
# emerge -avtD app-shells/bash-completion app-shells/gentoo-bashcomp
After emerging the ELOG will tell you to add a string to your .bashrc to enable it. So for each user you want to enable bash completition just edit their own .bashrc.
$ vim ~/.bashrc
Obviously you can do it for root account too (for emerge f.e.)
# vim /root/.bashrc
Right now you got it configured but no program is really affecting your bash shell. To do so I suggest you to use eselect (if you don’t have it just emerge it).

Fist of all use eselect to list all your available programs
# eselect bashcomp list
Then just choose wisely the programs you would like to add and insert them using their ID (the number beetween squares [] ).
# eselect bashcomp enable 1

Done! I usually like adding just a few completition like the emerge one (called gentoo, it adds other completitions then emerge alone) , subversion and git…

asdBG on Gtk-Apps and Gnome Files

View Comments // Written on Nov 26, 2008 // Open Source

I submitted asdGB to the two most used gnome apps websites. You can find my work on the following links

Gtk Apps

Gnome Files

Gentoo Autounmask Loop Bug

View Comments // Written on Nov 19, 2008 // Open Source

I noticed that even upgrading to latest version of autounmask (0.21 on my portage tree) I got the same loop bug of the previous versions.

Exactly like for the previous version the problem regards an infinite loop generating when unmasking a package and it’s caused by not understanding the PortageXS function getArch(). To avoid the problem and using this wonderful tool without PortageXS it’s possible to manually set the arch on the bin file.

Just open it with your favorite editor as Root
su
vim /usr/bin/autounmask

Then find this line
my $arch = $pxs->getArch();
comment it and add this other
my $arch = 'amd64';
obviously replacing amd64 with your arch.

An apple a day…

View Comments // Written on Oct 15, 2008 // Others

#!bin bash
apple=`emerge --sync && layman -S && update-eix && emerge -D world && revdep-rebuild`
An $apple a day keeps the doctor away