How do I run this script at startup? [sorted]

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
blue_sky

How do I run this script at startup? [sorted]

Post by blue_sky »

I would like to run this script at startup to configure my dual monitor setup in Mint maya. The script works great but I lose the setting of my primary monitor on reboot.

Code: Select all

xrandr --output DVI-0 --primary
What is the easiest way to do it? Please keep it simple, I'm not that bright.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Z-Xylon

Re: How do I run this script at startup?

Post by Z-Xylon »

In the Cinnamon Menu, look for Startup Applications. When the startup applications dialog comes up, click on add and where it says command, click on browse and look for the script in the popup file browser. Then give the new startup application a name, and an optional comment and click on add. This should make the script startup automatically when Mint starts.
However, make sure that the script is an executable, by running this in the terminal:

Code: Select all

chmod +x <path-to-file>
obviously replacing <path-to-file> with the actual path to the file.

Hopefully that helped :D
Last edited by xenopeek on Fri Dec 14, 2012 12:40 pm, edited 1 time in total.
Reason: Removed sudo from the command; sudo is not needed for files you own.
blue_sky

Re: How do I run this script at startup?

Post by blue_sky »

^Works like a charm! Thanks!
Locked

Return to “Scripts & Bash”