Unable to run my script to run at startup (SOLVED)

I am trying to run my script at startup to fix my screen tearing. The full script is:

#!/bin/bash
nvidia-settings --assign CurrentMetaMode=“DFP-1:nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }”

Anyway, I can run it via the terminal by running sh /home/startUp/killScrnTear.sh, but I can’t figure out how to add it to my startup applications and have it work. I have tried the following as the commands in startup applications: sh /home/startUp/killScrnTear.sh, /home/startUp/killScrnTear.sh, and killScrnTear.sh. None of these seem to work after a restart. I am on a laptop with both intel and nvidia graphics. The only way this works is if I run this script from the terminal when connected to an external monitor. This script works great from the terminal, but any other way I have tried doesn’t seem to work. This script doesn’t fix my screen tearing on the laptop screen, I still get the horizontal wrinkle when scrolling fast on webpages and in videos when I am running NVidia Graphics. Suggestions on how to get this script to run from startup applications or fix this screen tearing once and for all would be great. Thanks in advance.

Hi @m63k, I always suggest a universal startup file - perhaps a delay will help. If it runs ok in a terminal, say 5 seconds after booting, this should act the same.

1 Like

You beat me to that one @Bill_MI :slight_smile:

I actually run one command at startup by adding it directly to Startup Applications Preferences.

This makes my display look better.

I run startup scripts at login with

/bin/bash /home/username/scriptname.sh

Always worked for me.

Shouldn’t the first line be #!/bin/bash?