OS: Ubuntu 22.10
graphic card: nvidia
monitor: philips
Issue: how to change default gamma after X11 startup.
The gamma command I wish to invoke is either:
xgamma -rgamma 0.6 -ggamma 0.5 -bgamma 0.5
or
xrandr --output DP-0 --gamma 0.6:0.5:0.5
I want to set the gamma to default per above, when my user session starts.
I have attempted:
- To invoke a .sh file at startup by adding an entry to the "Startup Applications". This is unsuccessful: the .sh will not invoke. Adding a 10 second delay does nothing.
- Editing the file, xinitrc, to add the xgamma or xrandr commands. Also unsuccessful.
- Creating a .conf file in user/share/X11/xorg.conf.d Also unsuccessful. This caused my pc not to boot, requiring a recovery session as root, to remove the .conf file.
- Creating an .sh file on desktop, and invoking after user session starts. Successful, partly. But this is not default, and the system will over-ride the .sh command upon sleep and invoking other applications. Not the solution I am hoping to achieve.
Any help is sincerely appreciated. Thank you.
Update #1:
As suggested in the comments, I ran this command as a startup application:
sh -c '{ echo "started"; xgamma -rgamma 0.6 -ggamma 0.5 -bgamma 0.5; echo "$?"; echo "ended"; } > /home/user/startupapp.log 2>&1'
Here are the contents of the logs from cat ~/startupapp.log
... for the xgamma
command:
started
-> Red 1.000, Green 1.000, Blue 1.000
<- Red 0.600, Green 0.500, Blue 0.500
0
ended
And for the xrandr
command:
started
0
ended
After invoking the xgamma
command, though the log shows the change in gamma, the monitor remains at gamma values 1.00
.