Simple terminal command at startup.

Forum rules
Before you post please read how to get help
Post Reply
User avatar
Pawmaline
Level 1
Level 1
Posts: 11
Joined: Fri Sep 28, 2018 7:52 am

Simple terminal command at startup.

Post by Pawmaline » Fri Oct 26, 2018 5:19 am

I use Mint Xfce, still a complete newbie freshly liberated forever from microsoft, and loving it.

I found this little program called SCT and I use to maually set my screen's color warmth to what value feels best to my eyes, but in the morning at startup the bright screen frazzles my brain before I get a chance to enter the command.

All I need is for the terminal command SCT 2000 to run at startup. I've no idea how to do this though.

User avatar
catweazel
Level 17
Level 17
Posts: 7770
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel » Fri Oct 26, 2018 5:26 am

Pawmaline wrote:
Fri Oct 26, 2018 5:19 am
All I need is for the terminal command SCT 2000 to run at startup. I've no idea how to do this though.
What version of Mint?
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
Pawmaline
Level 1
Level 1
Posts: 11
Joined: Fri Sep 28, 2018 7:52 am

Re: Simple terminal command at startup.

Post by Pawmaline » Fri Oct 26, 2018 7:51 am

Oh sorry, Linux Mint 19 Tara.

User avatar
catweazel
Level 17
Level 17
Posts: 7770
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel » Fri Oct 26, 2018 7:53 am

Pawmaline wrote:
Fri Oct 26, 2018 7:51 am
Oh sorry, Linux Mint 19 Tara.
viewtopic.php?f=42&t=275464

That describes the correct way to do it.

Cheers.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

rene
Level 8
Level 8
Posts: 2348
Joined: Sun Mar 27, 2016 6:58 pm

Re: Simple terminal command at startup.

Post by rene » Fri Oct 26, 2018 8:19 pm

Catweazel's suggestion will unfortunately not work; sct is an X application, needs to hence wait for the X server to be up before launching: you'd want to use the desktop environment's startup-application support for something like this.

However, another issue here is that Mint 19 in fact comes with default screen colour temperature management in the form of the "Redshift" program which you will find under Accessories in your menu. It's normally run in daemon mode --- "as a service" in Windowsesque terminology --- and changes redshift-level depending on time of day (and optionally in fact latitude and longitude) but if you insist, a one-shot mode similar to sct is also available. I.e., try redshift -O 2000 from the command line.

If you'd like to use Redshift in its normal daemon mode: its default colour temperatures are 5500K and 3700K for respectively day- and night-time, which you can configure by creating a file ~/.config/redshift.conf (i.e., a file "redshift.conf" inside of the ".config" directory in your home: use Ctrl-H in the file-manager to show dot-files and directories) containing e.g.

Code: Select all

[redshift]
temp-day=4000
temp-night=2000
See man redshift from a terminal for information on what's configurable. When you start Redshift from the menu's once and click its tray icon (the bulb) you find to have the option to have it autostart right there; this is the standard way that Redshift is used on Mint. If you however for some reason insist on one-shot mode you will need to use Menu -> Settings -> Session and Startup -> Application Autostart and manually add a new startup item: Add -> (Name: Redshift One-Shot, Command: redshift -O 2000) -> OK.

Of course, if you are for some reason hell-bent on sct, latter manual startup addition works for it as well, but I'd advise using the on Mint standard available tool redshift.

User avatar
catweazel
Level 17
Level 17
Posts: 7770
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel » Fri Oct 26, 2018 9:03 pm

rene wrote:
Fri Oct 26, 2018 8:19 pm
Catweazel's suggestion will unfortunately not work; sct is an X application
Aarrrgh. Thanks for picking that up, rene. My apologies to the OP.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
Pawmaline
Level 1
Level 1
Posts: 11
Joined: Fri Sep 28, 2018 7:52 am

Re: Simple terminal command at startup.

Post by Pawmaline » Sat Oct 27, 2018 12:30 pm

Thanks, I will try using Redshift again. I appreciate all the answers. :)

User avatar
Pawmaline
Level 1
Level 1
Posts: 11
Joined: Fri Sep 28, 2018 7:52 am

Re: Simple terminal command at startup.

Post by Pawmaline » Sat Oct 27, 2018 10:55 pm

rene wrote:
Fri Oct 26, 2018 8:19 pm
If you'd like to use Redshift in its normal daemon mode: its default colour temperatures are 5500K and 3700K for respectively day- and night-time, which you can configure by creating a file ~/.config/redshift.conf (i.e., a file "redshift.conf" inside of the ".config" directory in your home: use Ctrl-H in the file-manager to show dot-files and directories) containing e.g.

Code: Select all

[redshift]
temp-day=4000
temp-night=2000
See man redshift from a terminal for information on what's configurable. When you start Redshift from the menu's once and click its tray icon (the bulb) you find to have the option to have it autostart right there; this is the standard way that Redshift is used on Mint.
Your instructions were crystal clear and worked great! Finally no more brain frazzlement and no more manual setting required - much appreciated friend!

Post Reply

Return to “Scripts & Bash”