Open this file in the text editor and add the following
#!/bin/bash
sleep 0.5
redshift -O 5000
Save the file and exit
Right click on the file -> Properties -> Additional -> Enable Mark as executable
While on the properties tab, mark the full path to the file (e.g: /home/username/nightlight.sh)
Now Open Session & Startups and create a new entry: Name: Night Light Command: /home/username/nightlight.sh (In the command field you need to put full path to the nightlight.sh as found from the file's properties tab)
Save it then Log out and Log back in to test
Make sure you have redshift installed as you have uninstalled it previously or you can replace the redshift command with xsct ones, if you prefer that one.
I am very proud to have created my first script with @littlekun's help! Perhaps I still need to learn how to do this so that I can customize more processes on the computer as I wish.
Is it also possible to execute the two commands “sleep 1” and “xsct 3500” one after the other without using a script directly under “autostart programs” in the “command” line?
What would the fully command to be entered be?
Alternatively, what should the command in the exec-line of the .desktop-file have been?
I am really interested to learn more about these different ways.
Is the whisker menue where you can edit the starter programs only a GUI for the .desktop-file, and the exec-line the same as the "command"-line?
The difference between "starter" and "autostart program" is still not quite clear to me. Do I need to create a starter first (a starter is a link/shortcut to start the program via the startmenue or the desktop, but it doesn't start automatically), and then I can add the starter to autostart?
There are few ways to run multiple commands one after another. Check the Command Lists section Here
Mostly used one is cmd1 && cmd2
In the .desktop files, If you are trying to execute multiple commands then in the exec line you should use like this:
sh -c 'cmd1 && cmd2'
Yes, they both are the same.
It's usually not necessary to create a starter in order to use it for the autostart program. Starter(App menu) is mostly used for launching GUI applications.
Thank you for this helpful information!
I tried it with
sh- c 'sleep 1 && xsct 3500'
and
sh- c 'sleep 1; xsct 3500'
in the autostart and they both work well.
Adding sh -c is absolutely necessary here.
That's the easiest way and neither a starter nor a script is neccessary for that.
@Aravisian
I haven't quite understood why you suggested changing the desktop file.
It does not start by itself at system startup. What role does it play?
Was the aim to add this file to the autostart? Or should it normally have started on its own?
Please forgive me for asking. This is not intended as a criticism of your suggestions! I am very glad that you all give such expert advice here in the forum!
I just can't really imagine what exactly I'm doing. I've never had anything to do with programmes that don't have a graphical user interface and had never worked with text editors before.