0

How do I create a startup command permanent on every cycle restart ? As previously having brightness reset when set at power saving mode to turn off the monitor.

  • 18.04 64bits 5.4.0-42-generic
  • Desktop Nvidia 440 driver

I found out xset dpms 600 900 1800 works on turning off the monitor display but I wanted it to run at startup which i do no need to type manually on the terminal.

I tried adding xset dpms 600 900 1800 to the bottom of home/.profile but it didn't work.

Further testing and by adding an extra line to run terminal by adding

xset dpms 600 900 1800
gnome-terminal

at the terminal startup checking the xset -q xset dpms was not set Standby: 0 Suspend: 0 Off: 0 while it should be Standby: 600 Suspend: 900 Off: 1800

The weird scenario is when manually launch a terminal without typing anything , the command of xset dpms 600 900 1800 active.

What would it be the reason ? .profile with command 'xset dpms 600 900 1800' Not trigger on startup but when I launch terminal manually it trigger the command.

If anyone could explain the reason ? or a better way to run the command on startup rather running on .profile ?

ubusr
  • 11

1 Answers1

0

The X Server, which listens for the xset command, starts after login.

Place the command in a script, and put the script in your ~/.config/autostart/ directory. It will run every time the X Server is started for your account.

user535733
  • 62,253
  • I paste the script `#!/bin/bash

    Turn off Monitor

    xset dpms 900 1200 1800 exit` and save as .sh , chmod it 776 still it does not run.Just tell me , is my script wrong ? Just a simple command line. @user535733

    – ubusr Aug 15 '20 at 16:44