Running script at startup when using i3wm

13,133

Solution 1

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.

Solution 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

Share:
13,133

Related videos on Youtube

Adam Selker
Author by

Adam Selker

Updated on September 18, 2022

Comments

  • Adam Selker
    Adam Selker over 1 year

    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?

  • ASCIIbetical
    ASCIIbetical over 10 years
    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 ^ ?