Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 12003  / 2 Years ago, sun, april 10, 2022, 7:21:27

I have some commends that I wish to be called right after login, including 'startx', and I thought rc.local seems a nice place for them, but the problem is that rc.local is run as root and I don't want that, obviously I can do something like this:



su username -c somecommend-here


But I am looking for a way to run the whole 'rc.local' as normal user, or perhaps there is a better place to put my code ?



PS. I am using Ubuntu-mini-remix 1104i386



Thanks


More From » startup

 Answers
1

The easiest way to launch a command when a user logs in is to create a .desktop file for the command and stick it in the ~/.config/autostart folder. What does the desktop file look like? Here is an example that retrieves the Ask Ubuntu home page with wget every time the user logs in:



[Desktop Entry] 
Name=Launch wget
Comment=Fetches the Ask Ubuntu home page.
Exec=wget http://askubuntu.com/

[#43184] Monday, April 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quivedge

Total Points: 223
Total Questions: 116
Total Answers: 124

Location: Slovenia
Member since Wed, Apr 6, 2022
2 Years ago
;