Warning: be sure to test your startup scripts manually in a Terminal session (Ctrl-Alt-T in Easy Mode) before following either of the methods below. If your script prevents the graphical desktop from starting properly, your machine may enter an endless boot loop, requiring you to resort to using the Rescue Console.,
Open a Terminal (Ctrl-Alt-T in Easy Mode).
If /home/user/.icewm does not exist, create it. (check for it by “ls -a /home/user”; create it with “mkdir /home/user/.icewm)
In that folder, create a file called startup (“touch startup”).
Make it executable now, before you forget (“chmod 0755 startup”).
Edit it and insert your commands, ensuring that the 1st line is ”#!/bin/sh” (“nano /home/user/.icewm/startup”). If your command requires X, you may need to add the
sleep command to allow the window manager to start up before your command is run. For example, If you want to enable keyboard repeat mode, your /home/user/,icewm/starup script should look something as follows:
#!/bin/sh
sleep 8
# wait 8 seconds before executing xset command.
# increase sleep time to greater than 8 seconds
# if necessary.
/usr/bin/xset r
Now, make a copy of /usr/bin/startsimple.sh (“sudo cp /usr/bin/startsimple.sh /usr/bin/startsimple.sh.orig”)
Open the file with nano editor in super-user mode (“sudo nano /usr/bin/startsimple.sh”)
Look for the following line: ”/opt/xandros/bin/AsusLauncher &”
Insert the following code just above it, then save and reboot.
if [ -x /home/user/.icewm/startup ]; then
#we have a start up file to execute
/home/user/.icewm/startup &
fi
If you don't feel comfortable with editing /usr/bin/startsimple.sh, another alternative is to make use of /usr/sbin/services.sh, which refers to a file called /etc/fastservices (doesn't exist by default). You can create or edit this file to add services to the bootup process, one line per service.
Also, some forum members have suggested running rc.local with /etc/fastservices.
sudo echo "rc.local" > /etc/fastservices
Then you can add the command to run your favourite script to /etc/rc.local, which will be run at the end of the system startup process.
Open a text editor as root (EX: kdesu kwrite )
Write your script. Ensure that the first line of the script is: #!/bin/sh (otherwise it will be opened in the Text Editor).
Save the script to /home/user/.kde/Autostart/
Give the script execute permission (chmod 0755 /home/user/.kde/Autostart/example.sh)
Reboot
Save the script to /home/YourUserName/ExampleName.sh ( the first line of the script must be #!/bin/sh )
Give the script execute permission chmod 0755 /home/YourUserName/ExampleName.sh
Select from your main menu: Applications –> Settings –> Autostarted Applications
Click Add
Name the application e.g.: Example Script
Describe the application e.g.: This is my example script, that makes an example of every user on bootup!
Command: enter the path to the script: i.e.: /home/YourUserName/ExampleName.sh (Or use the button for the file chooser to find the script.)
Click OK
Make sure that the new entry in the Autostarted Applications dialog is checked.
Click Close
Reboot
Save the script to /home/YourUserName/ExampleName.sh ( the first line of the script must be #!/bin/sh )
Give the script execute permission chmod 0755 /home/YourUserName/ExampleName.sh
Select from your main menu: System –> Preferences –> Sessions
Select Startup Programs tab if it is not already selected.
Click New
Name the application e.g.: Example Script
Command: enter the path to the script: i.e.: /home/YourUserName/ExampleName.sh (Or use the Browse… button for the file chooser to find the script.)
Click OK
Make sure that the new entry in the Startup Programs tab of the Sessions dialog is checked.
Click Close
Reboot
As root, save the script to /etc/ExampleName.sh ( the first line of the script must be #!/bin/sh )
Still as root, give the script execute permission chmod 0755 /etc/ExampleName.sh
Edit /etc/rc.local (again, as root) and add the full path to your script above the exit 0 line (place a nice comment above the edit, explaining the command to your older self – any line that starts with a # is a comment)
# This is my example script, that makes an example of every user on bootup!
/etc/ExampleName.sh
exit 0
Save the script to /home/YourUserName/ExampleName.sh ( the first line of the script must be #!/bin/sh )
Give the script execute permission chmod 0755 /home/YourUserName/ExampleName.sh
Select from your main menu: Preferences –> Startup Applications
Select Startup Programs tab if it is not already selected.
Click Add
Name the application e.g.: Example Script
Command: enter the path to the script: i.e.: /home/YourUserName/ExampleName.sh (Or use the Browse… button for the file chooser to find the script.)
Click Add
Make sure that the new entry in the Startup Programs tab of the Sessions dialog is checked.
Click Close
Reboot
All users, not just the current user, will be affected by the script.
- If your script requires X, you can add the lines of the script to the bottom of the /etc/gdm/Init/Default script, right before 'exit 0'. Or call it from the Default script. This is the way to add xmodmap changes to all users.