PDA

View Full Version : [ubuntu] Install a program at startup?



newbie2210
May 28th, 2011, 12:59 PM
I want to install the following command as a program and get it on startup.
cd Desktop/
sudo lkl -l -k keymaps/us_km -o log.file

and running it since the computer starts up until it's shut down.
How can I do it?
I have Ubuntu 10.14

sag0th
May 28th, 2011, 02:27 PM
Create executable file with content:



#!/bin/sh
cd ~/Desktop
sudo lkl -l -k keymaps/us_km -o log.file &

and place it in some directory included in your PATH (lets say /usr/bin). Then use:
System -> Preferences -> Startup Applications
to run it at start up.

newbie2210
May 28th, 2011, 03:02 PM
Create executable file with content:



#!/bin/sh
cd ~/Desktop
sudo lkl -l -k keymaps/us_km -o log.file & and place it in some directory included in your PATH (lets say /usr/bin). Then use:
System -> Preferences -> Startup Applications
to run it at start up.

How do I exactly place it on the directory that I want?

sag0th
May 28th, 2011, 05:24 PM
cut/paste??? :shock:

if you want to move it in /usr/bin just:

sudo mv <your-file> /usr/bin/

in console.........

rvchari
May 28th, 2011, 05:31 PM
a small doubt and sorry to jump in...

does he have to give the path cd /home/USERNAME/Desktop instead of ~/Desktop ? i presume you advised to move it to /usr/bin. if the batch file has to be pointed to the particular user desktop then do we have to do what i said or will it take care of that ?

sag0th
May 28th, 2011, 08:50 PM
~/Desktop
/home/$USERNAME/Desktop
/home/`whoami`/Desktop

are equal and the result depends on the user that executes the script.

If user is sag0th and the file is located only on rvchari's Desktop the path must be hardcoded /home/rvchari/Desktop