Adding a startup application
Tofloor
poster avatar
nikos
deepin
2019-04-12 10:21
Author
Hello everyone. I used the xgamma -gamma 0.80 terminal command to adjust the gamma of my monitor, but I have to rewrite it every time I turn on my computer. Is there a way to set it permanently as a startup application? Thank you.
Reply Favorite View the author
All Replies
WENWEN
deepin
2019-04-12 17:00
#1
Reply View the author
aida
deepin
2019-04-12 17:46
#2
Add the xgamma -gamma 0.80  command to ~/.xinitrc

Reply View the author
oui
deepin
2019-04-13 11:24
#3
https://bbs.deepin.org/post/176684
Add the xgamma -gamma 0.80  command to ~/.xinitrc

Hi
I did try to use ~/.xinitrc (to set my right keyboard map (see pls https://bbs.deepin.org/post/176702#page%3D1), did not work, after that only to copy ~/.xinitrc to ~/xinitrc only to see if it works, ... but no effect at all! Is that the right / best file to start startup applications?
Reply View the author
deepinuser17
deepin
2019-04-13 20:13
#4
本帖最后由 deepinuser17 于 2019-4-13 12:14 编辑

Here is what you can do.

1. Create a shell script, say, /usr/local/sbin/set_gama.sh, which includes the command:

$ sudo vi  /usr/local/sbin/set_gama.sh
  1. #!/bin/sh

  2. /usr/bin/xgamma -gamma 0.80
Copy the Code


$ sudo chmod +x /usr/local/sbin/set_gamma.sh

2. Create a startup service file, /etc/systemd/system/xgamma.service

$ sudo vi /etc/systemd/system/xgamma.service
  1. [Unit]
  2. Description=Set Display Brightness
  3. After=graphical.target

  4. [Service]
  5. Type=simple
  6. ExecStart=/usr/local/sbin/set_gamma.sh

  7. [Install]
  8. WantedBy=graphical.target
Copy the Code


$ sudo systemctl daemon-reload
$ sudo systemctl enable xgamma.service

Next time, when your machine reboots, the startup service will run the script and set the gamma value.
Reply View the author
oui
deepin
2019-04-14 00:09
#5
Very interesting message, thank you very much deepinuser17! I did try if it would help concerning my problem (start a keyboard definition available through «setxkbmap»  but not offered in the deepin panel) exposed in https://bbs.deepin.org/post/176702#page%3D1

it doesn't work (it is no deception for me as set the keyboard is a startup command, yes, but only after the start of, in our case, xorg itself. I only did try "if, perhaps,..").

and I don't find some «xorg startup command» in Deepin :-(( (the only one way would be to renonce to use the deepin desktop and to prefer the old and poor jwm (/etc/jwm/system.jwmrc has  a field «startup command» in Deepin but jwm itself doesn't work properly as soon you add a background picture using jwm itself, as jwm doesn't need some external program like feh to do that: using the background, a terrible error happens: the Menu selector appearing on the desk hitting on the mouse keys never disappear so that in minutes your desktop is completely covered with that smudge. With only the grey background, jwm goes, but the Debian menu ignore a lot of applications... It is also not really good or you have a lot of work to enter manually all those applications into the /etc/jwm/system.jwmrc ...)
Reply View the author