Score:0

After adding .sh file to Startup Applications, the .sh file will not invoke at startup

za flag

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 avatar
jp flag
Does this answer your question? [Startup script not executing](https://askubuntu.com/questions/1450604/startup-script-not-executing)
za flag
unfortunately, no
Pilot6 avatar
cn flag
Where the script is located? You need to add path to the script.
Score:0
in flag

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.)

za flag
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?
user10489 avatar
in flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.