Results 1 to 2 of 2

Thread: Where to keep startup script?

  1. #1
    Join Date
    Jun 2011
    Beans
    304

    Where to keep startup script?

    I have a script which I want to start as the computer starts. Do I keep it in ~/.config/autostart/ or in /etc/xdg/autostart. Also do I need to make a .desktop file or I can simply place the script there? Also what if I want script to run with sudo command and to open a terminal and run in there. Thanks for your help.

  2. #2
    Join Date
    May 2008
    Location
    /tmp/USA
    Beans
    117

    Re: Where to keep startup script?

    I can't answer all of that, but I think the easiest way to get a startup program running is to use the "startup applications" program -- I'm not sure what the cmd line name for it is, but if you type the above into the search bar it should pop up. The program will generate a .desktop file for you.

    I'm not totally sure what to do to get root privileges, but my guess is putting the .desktop file that Startup Applications generated into /etc/xdg/autostart would be a good first step.

    If you want to check if the script is being run as root, you can use the command
    Code:
    whoami
    which will come out as "root" if you've got the right privileges. You can output that to a file
    Code:
    whoami > ~/sanity_check
    , use an if statement, etc
    Experience is what you get when you didn't get what you wanted -Randy Pausch

    Shameless Plug: wpa_supplicant Configuration Manager

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •