So I have this script that changes the resolution of on of my monitors that works and that I was able to run on login by adding it in settings»Applications»Startup. The only problem is that I need it to run on start up so that the resolution changes before the os actually gets to the login screen because the login screen doesnt display on my other monitor because the monitor the script is made for is actually seen as primary (I assume it is because it is connected to DVI. How would I go about to do that? I am on Juno, can give more info if needed.
1 Answer
There are a couple of ways to do this. You can either create a cron job or add your script to /etc/rc.d/rc.local
.
This site has more information:
https://www.tecmint.com/auto-execute-linux-scripts-during-reboot-or-startup/
UPDATE: After talking with Tin jus, it appears there's no rc.d/rc.local directory in elementary OS. According to the tecmint link, the /etc/rc.d/rc.local
method
is valid even for systemd-based distributions.
A third method is running a startup script in systemd. More information can be found here:
https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux
-
Thx for the reply, I have tried with a cron job and it didnt work that way, I will try with rc local and come back with the results.– Tin jusCommented Nov 21, 2018 at 18:33
-
Just tried the rc.local method and there is no such directory in elementary os– Tin jusCommented Nov 21, 2018 at 18:45
-
I updated my answer. After more searching, it looks like the systemd method should work. The tecmint link said that the
rc.d/rc.local
method "is valid even for systemd-based distributions."– PaulCommented Nov 21, 2018 at 19:08