2

I can't for the life of me get scripts to run at startup. I have a script called "startup.sh" in my home directory. I have tried (at least) the following ways to get it to run at startup:

  • Adding it to .profile
  • Adding it to .bashrc
  • Adding a run command to i3's config in /etc (I use i3)
  • Adding it to Xsession and xinitrc (I think, will retry)
  • Adding it to /etc/rc.local
  • Adding it to init.d

The only thing that worked was Unity's Startup Applications menu, which doesn't work with i3.

Any ideas?

1

3 Answers 3

2

Run sudo command (just in case) without asking for password command line:

echo YOUR_PASSWORD | sudo -S YOUR_COMMAND

Put command lines in /etc/rc.local:

sudo -H gedit /etc/rc.local

Imformation sources:

Stack Overflow: How to Run a Shell Script at Startup

2

Ah, found it. I was editing /etc/.i3/config, which is the config for the root user. I should have been using /home/foo/.i3/config. Putting my commands in the latter solved it.

0
  • From Dash search startup applications. enter image description here
  • click on add button
  • click on browse button
    enter image description here
  • select the script you want to run on startup
  • give an appropriate name
1
  • I guess @adity patil OP clearly said "The only thing that worked was Unity's "startup applications" menu, which doesn't work with i3." So, can you define your point in writing this ^ ? Jan 1, 2014 at 9:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .