[SOLVED] How do I make commands execute at startup?

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
bigrand
Level 1
Level 1
Posts: 8
Joined: Tue Aug 09, 2022 5:49 pm

[SOLVED] How do I make commands execute at startup?

Post by bigrand »

I'm running Linux Mint XFCE and would like a command to run when I log in.

I attempted to add it to "Session and Startup," but it did not save it. I came from Pop! OS, where you can do it using the application and it works, but I'm not sure how to make it work here.
Last edited by LockBot on Thu Feb 09, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pjotr
Level 24
Level 24
Posts: 20129
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How do I make commands execute at startup?

Post by Pjotr »

What command?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
bigrand
Level 1
Level 1
Posts: 8
Joined: Tue Aug 09, 2022 5:49 pm

Re: How do I make commands execute at startup?

Post by bigrand »

Code: Select all

xset led named "Scroll Lock"
This is to activate the led lights of my keyboard
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: How do I make commands execute at startup?

Post by trytip »

it's how it's done in any desktop you go through session and startup settings or startup applications in cinnamon. but if that didn't save you can open .config/autostart create your file name scroll_lock.desktop and use one of the .destop entries as an example for yours.

Code: Select all

[Desktop Entry]
Type=Application
Exec=xset led named "Scroll Lock"
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=LED Scroll Lock
Comment[en_US]=This is to activate the led lights of my keyboard.
X-GNOME-Autostart-Delay=5
but the command may be wrong which is why it didn't save. does the command work in Terminal?
Image
rickNS
Level 9
Level 9
Posts: 2975
Joined: Tue Jan 25, 2011 11:59 pm

Re: How do I make commands execute at startup?

Post by rickNS »

bigrand wrote: Tue Aug 09, 2022 5:58 pm
I attempted to add it to "Session and Startup," but it did not save it.
It worked (saved) for me, so could it be as simple as you forgot to click "OK"?
Also it seems custom startup items go on the bottom of the list, instead of being inserted in alphabetical order (as they would in MATE for instance).
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
bigrand
Level 1
Level 1
Posts: 8
Joined: Tue Aug 09, 2022 5:49 pm

Re: How do I make commands execute at startup?

Post by bigrand »

It worked. Now it works. I'm not sure why, but I had to restore a Timeshift backup because I encountered an error when trying to log out, so I'm not sure what happened, but it now works fine.
Locked

Return to “Beginner Questions”