Adding personal startup scripts to ubuntu
Posted: 19/07/2011 Filed under: Nerdstuff | Tags: startup, u1, ubuntu Leave a comment »It’s really been a while since my last post but I decided to get this moving again. I regularly need to remember something and this blog still is a good place to write stuff down.
On this post I want to tell you how I make stuff happening while logging in. I just like it if I don’t have to start the cool stuff manually so scripting was the solution. Since I need the same programs on almost all my systems, synchronisation was needed. I could have putted the code in a repository but I decided to use the ubuntu-one service because it is already there.
I created a little script like this and added it to my $HOME/Ubuntu One/script folder. I made it executable and hoped for the best.
#!/bin/bash
# starting hamster-indicator
if test $(hostname) = 'wimsbuntu'
then
$HOME/src/hamster-indicator/hamster-appindicator/hamster-indicator \
2>&1 >/dev/null &
fi
# starting empathy-twitter-startus
STATUSDIR="$HOME/src/empathy-twitter-status"
test -d "$STATUSDIR" &# starting tomboy
/usr/bin/tomboy >/dev/null 2>&1 &
# starting desktopcouch
/usr/lib/desktopcouch/desktopcouch-get-port >/dev/null 2>&1 &
Unfortunately while syncing correctly the mode-bits where not set correctly so a little workaround was needed. My solution was pretty easy: I created a script in my $HOME/bin which starts the startup-script. It goes a little like this:
/bin/bash "$HOME/Ubuntu One/scripts/startup"
Making the script executable and adding the script to the startup manager finishes the job.
The only thing I’m missing is halting some programs on logout. I’ve been googling around but didn’t found a good answer. Anyone a suggestion?