2

I need to start a command on startup. I want to run this command:

xgamma -gamma 0.70

I have used Startup Applications but it doesn't work. I have put the command in the Startup Applications:

Startup application

pomsky
  • 68,507
  • yes sorry i have put the same command in the start up i will take another screenshot of how it looks thanks and what is this command do echo $XDG_SESSION_TYPE. – – Silver-Coder Dec 22 '18 at 01:38
  • 1
    It tells us if you are running X or Wayland. See man echo. – user535733 Dec 22 '18 at 03:32
  • x11. – it give me this what is the different can you tell me please i'm new ubuntu user – Silver-Coder Dec 22 '18 at 04:06
  • 1
    Comments are not intended for conversation, but to help you improve your question. AskUbuntu's format is Question/Answer, not discussion. If you wish to discuss side issues ("say, what does this mean?"), then consider opening a thread at our sibling site http://ubuntuforums.org, which IS converstional, and does have threads that wander. – user535733 Dec 22 '18 at 05:32
  • ok can you please help me on just run this command on startup thanks – Silver-Coder Dec 22 '18 at 06:15

2 Answers2

3

Thanks, pomsky I have found a way to make it after doing these steps

  1. Create a new text file, say set-xgamma.sh somewhere
  2. add the following lines to the file:

    #!/bin/bash
    sleep 7 
    xgamma -gamma 0.70
    

    and save the file.

  3. Make the script executable.

  4. use this command crontab -e
  5. put @reboot sh $HOME/set-gamma.sh & there with your file path
  6. save it by clicking ctrl+o then ctrl+x to exit and it works :)
pomsky
  • 68,507
2
  1. Create a shell script for the command. Create a new text file, say set-xgamma.sh somewhere and add the following lines to the file:

    #!/bin/bash
    xgamma -gamma 0.70
    

    and save the file.

  2. Make the script executable (refer to this).
  3. In Startup Applications, while editing the program, click Browse... next to the 'Command' textbox and select the set-xgamma.sh file you just created.
pomsky
  • 68,507