0

Ubuntu 22.10

The text of the script file (gamma.sh) I wish to invoke at boot/reboot is as follows:

xgamma -gamma 0.6 

In terminal, the script can be invoked without difficulties by command: ./gamma.sh

The .sh file properties are set to execute as program.

PROBLEM...

I opened Startup Applications. Added ./gamma.sh

Result... Upon boot/reboot, the gamma.sh will not start.

QUESTION: How to invoke the gamma.sh on boot/reboot?

thank you.

Raffa
  • 32,237
rob grune
  • 1,068

1 Answers1

0

It looks like you are trying to create a shell script.

The first line of a script must list the interpreter of the script, which must start with a / . Subsequent lines can then be commands, for example xgamma.

for example

#!/bin/sh
xgamma -gamma 0.6

Once you have done that, you have to make the script executable: chmod +x gamma.sh

It is possible to take some shortcuts and leave out some of these pieces, but for best results, use the above.

Next, you have to find an appropriate way to start this script. You probably should not start it at boot, as xgamma needs the X11 server to be running and it needs access permissions to use the X server, neither of which is the case at boot.

Instead, you may want to run this as part of the display server login banner initialization, or more likely, part of the user login session. (Or maybe both.)

user10489
  • 4,051
  • Thanks for reply and ideas. I forgot about the X11 enviro. Edits to .sh made per your suggestion: operational per terminal command. Now, I need to determine how to invoke the .sh when starting the user session, post X11. Any ideas? – rob grune Feb 07 '23 at 08:14
  • Post another question asking about where to add commands to change X11 either during the login banner if that's what you want, or at the start of the user session. – user10489 Feb 07 '23 at 12:24