How to add a script in Startup Applications to all accounts?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

How to add a script in Startup Applications to all accounts?

Postby Dirkoir on Sat Aug 23, 2014 5:48 pm

Hi, all:

I have a script ("xset s off") which prevents a laptop from freezing when going into (or coming out of?) idle induced suspend mode. When I added it to the "Startup Applications" it ended up installed only in my primary user account. How can I install it so it works in all user accounts on this machine -- other than manually installing the same script over and over in each account like a mule? (a mule with hands;-)

Thanks. :-)
Dirkoir
Level 3
Level 3
 
Posts: 108
Joined: Wed Jul 30, 2014 12:43 pm

Linux Mint is funded by ads and donations.
 

Re: How to add a script in Startup Applications to all accou

Postby Spearmint2 on Sat Aug 23, 2014 11:55 pm

I can guess. Put it in a root owned folder like bin, lib, or sbin and add it to the startup programs list.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
User avatar
Spearmint2
Level 10
Level 10
 
Posts: 3312
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How to add a script in Startup Applications to all accou

Postby Dirkoir on Tue Aug 26, 2014 3:02 pm

I think, noob that I am, I need a little elaboration. *sheepish grin*
Dirkoir
Level 3
Level 3
 
Posts: 108
Joined: Wed Jul 30, 2014 12:43 pm

Re: How to add a script in Startup Applications to all accou

Postby Spearmint2 on Tue Aug 26, 2014 3:15 pm

If you have an executable file or script you want all to have access to, don't have it under /home folder.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
User avatar
Spearmint2
Level 10
Level 10
 
Posts: 3312
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How to add a script in Startup Applications to all accou

Postby eanfrid on Tue Aug 26, 2014 6:32 pm

Put it in the /etc/xdg/autostart folder. This is the system-wide equivalent to every user autostart folder (~/.config/autostart). The user autostart folder is the one populated with .desktop files when you add/edit something with "Preferences/Startup applications".
Main desktop: Debian GNU/Linux Wheezy 64bit - MATE 1.8.1
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox
User avatar
eanfrid
Level 7
Level 7
 
Posts: 1871
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: How to add a script in Startup Applications to all accou

Postby Spearmint2 on Tue Aug 26, 2014 6:37 pm

somewhere near paris
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
User avatar
Spearmint2
Level 10
Level 10
 
Posts: 3312
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How to add a script in Startup Applications to all accou

Postby Dirkoir on Thu Aug 28, 2014 2:59 pm

Thanks, eanfrid! :-) Following your lead, I browsed to /home/dirkoir/.config/autostart where I found a single file named: xset.desktop

Looking inside the file, it contained:
Code: Select all
[Desktop Entry]
Type=Application
Exec=xset s off
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Prevent Screen Blanking
Name=Prevent Screen Blanking
Comment[en_US]=Hopefully I can leave laptop unattended now.
Comment=Hopefully I can leave laptop unattended now.
X-GNOME-Autostart-Delay=0

That would seem to be the script. Neat! :-) Now, if I copy it to /etc/xdg/autostart, I will also need to change it's owner and group privileges from dirkoir to root, right?

(Afterwards, I suppose I can and should delete my own personal dirkoir-only autostart script which would now be redundant. Too bad the GUI tool only works on a per-user basis. If it weren't restricted that way, the GUI tool would make global adjustments easier to find and manage.)
Dirkoir
Level 3
Level 3
 
Posts: 108
Joined: Wed Jul 30, 2014 12:43 pm

Re: How to add a script in Startup Applications to all accou

Postby altair4 on Thu Aug 28, 2014 3:33 pm

Now, if I copy it to /etc/xdg/autostart, I will also need to change it's owner and group privileges from dirkoir to root, right?

Nope. The reason it's "nope" is because you can't copy it to /etc/xdg/autostart as dirkoir.

You need to do this as sudo:
Code: Select all
sudo cp /home/dirkoir/.config/autostart/xset.desktop /etc/xdg/autostart

When you do that you copy as root and the file will save with root as owner automatically.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6151
Joined: Tue Feb 03, 2009 10:27 am

Re: How to add a script in Startup Applications to all accou

Postby Dirkoir on Thu Aug 28, 2014 7:45 pm

Haha, the thought had recently occurred to me, too. (guess, I must be learning) :D

I guess, I could do it via the GUI, too: gksu nemo
Dirkoir
Level 3
Level 3
 
Posts: 108
Joined: Wed Jul 30, 2014 12:43 pm

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot] and 17 guests