Simple terminal command at startup.

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
Pawmaline

Simple terminal command at startup.

Post by Pawmaline »

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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel »

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?
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Pawmaline

Re: Simple terminal command at startup.

Post by Pawmaline »

Oh sorry, Linux Mint 19 Tara.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel »

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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: Simple terminal command at startup.

Post by rene »

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 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Simple terminal command at startup.

Post by catweazel »

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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Pawmaline

Re: Simple terminal command at startup.

Post by Pawmaline »

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

Re: Simple terminal command at startup.

Post by Pawmaline »

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!
Locked

Return to “Scripts & Bash”