I am on Mint XFCE and Redshift is just so inconsistent and I have tried its forks, also inconsistent. So instead I have been using sct in the terminal to adjust the temperature, and have set a command that resets it back to normal every time that I log on. However, I was wondering if there is a way to make it so that “sct 2750” runs every day at 10 pm or during a specific period of time.

Edit: I figured out the solution which was to create a crontab with the following line in it: 0 22 * * * env DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority /usr/bin/sct 2750

  • @[email protected]
    link
    fedilink
    English
    221 year ago

    Which is a lot more difficult in every aspect than just throwing a single line on crontab and calling it a day.

    • 0xtero
      link
      fedilink
      121 year ago

      a lot more difficult in every aspect

      Perfect summary of systemd

    • 𝘋𝘪𝘳𝘬
      link
      fedilink
      English
      21 year ago

      At the same time you get a lot more benefits doing so. You also don’t need to install additional software just to run a background task every X time units.

      And if you need to learn something, just learn the current state if the art.

      • Maestro
        link
        fedilink
        31 year ago

        I don’t know any distro that ships without cron installed out of the box. Maybe some bare bones minimal distro but I assume that OP isn’t using that or he would not need to ask this question.

    • @Synthead
      link
      English
      2
      edit-2
      1 year ago

      I don’t agree with this statement, personally. People who aren’t familiar with cron will see magic numbers and magic characters. It’s also possible to have friction getting the environment set up correctly for the program being called by cron.

      systemd timers use exact phrases in its configuration like “daily.” You can also name the timer, start and stop the timer, view logs specifically for that timer, etc. Plus, it just calls a service file, which again is much simpler than other options like System V. You can run multiple commands in order, set an environment, use a user, jail the commands, etc.

      Any of these things done “the old way” have been obscure and difficult. When was the last time you thought about a runlevel? The timer configs aren’t one-liners, but it’s because it’s packed loads of features and it’s human-readable. Plus, anything you do surrounding the cron job is also obscure, in my opinion.

      Plus, cron jobs, if you choose to use them, are performed by systemd compatibility code, anyway.