You are not logged in.
Pages: 1
Hello,
is it possible to switch the display off (make it dark) and on with a shortcut?
Last edited by Peter_Ziegler (2025-07-03 21:13:26)
Offline
What do you mean by "display"? A secondary monitor? Main monitor/display?
What does the following return?
xfconf-query -c displays -lv
There should be an Active property there you can try toggling.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I mean the main display of a Laptop.
xfconf-query -c displays -lv
/ActiveProfile Default
/AutoEnableProfiles 3
/Default/eDP Laptop
/Default/eDP/Active true
/Default/eDP/EDID daabb9ae941376a7f9553df23ca019479d95847e
/Default/eDP/Position/X 0
/Default/eDP/Position/Y 0
/Default/eDP/Primary true
/Default/eDP/Reflection 0
/Default/eDP/RefreshRate 59,998595
/Default/eDP/Resolution 1440x900
/Default/eDP/Rotation 0
/Default/eDP/Scale/X 1,000000
/Default/eDP/Scale/Y 1,000000
/Fallback/eDP Laptop
/Fallback/eDP/Active true
/Fallback/eDP/EDID daabb9ae941376a7f9553df23ca019479d95847e
/Fallback/eDP/Position/X 0
/Fallback/eDP/Position/Y 0
/Fallback/eDP/Primary true
/Fallback/eDP/Reflection 0
/Fallback/eDP/RefreshRate 59,998595
/Fallback/eDP/Resolution 1440x900
/Fallback/eDP/Rotation 0
/Fallback/eDP/Scale/X 1,000000
/Fallback/eDP/Scale/Y 1,000000
/Notify 1
Offline
Try creating a shortcut using the command:
xfconf-query -c displays -p /Default/eDP/Active -T
...this "should" act as a toggle, but if it doesn't work you may end up with a blank screen - so make sure anything important is saved prior to trying.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Great!
What want you tell to me? I have an idea but if it does not work you have to reinstall your computer?
Thank you but in this case I prefer a display always on.
Last edited by Peter_Ziegler (2025-07-04 21:57:50)
Offline
I'm sorry but I don't understand your post. Did the suggestion answer your question?
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Maybe I misunderstood you but your suggestion is a try which could end in a blank display if it doesn't work. And then? What can I do in this case?
Btw. what is the shortcut in your suggestion? If I understand it right the command itself is the "shortcut" without the possibility to reverse it in the worst case because I don't have a display anymore.
Last edited by Peter_Ziegler (2025-07-05 09:22:08)
Offline
Maybe I misunderstood you but your suggestion is a try which could end in a blank display if it doesn't work. And then? What can I do in this case?
Forced reboot.
Btw. what is the shortcut in your suggestion? If I understand it right the command itself is the "shortcut" without the possibility to reverse it in the worst case because I don't have a display anymore.
There is a setting in the xfconf database for each display that sets its "Active" state. If true, it will be on, if false it is off. That command simply toggles that state.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thanks for the info.
This means that a reboot always manipulate the xfconf database and set the display active state to true?
But it would be interesting to use the command without a display with the hope there is actual a terminal activ.
Does it works also if I change to another tty with STR-ALT-Fx?
Offline
Thanks for the info.
This means that a reboot always manipulate the xfconf database and set the display active state to true?
I think you're misunderstanding. If you use the command to turn the display off and something goes wrong, then you will no longer be able to see anything to change it back. Hence you will need to force reboot.
But it would be interesting to use the command without a display with the hope there is actual a terminal activ.
![]()
Does it works also if I change to another tty with STR-ALT-Fx?
No. It requires an X display server - the terminal you specify does not contain one.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Peter_Ziegler wrote:
Thanks for the info.
This means that a reboot always manipulate the xfconf database and set the display active state to true?I think you're misunderstanding. If you use the command to turn the display off and something goes wrong, then you will no longer be able to see anything to change it back. Hence you will need to force reboot.
But if the xfconf database was changed and the display active state is set to false and something goes wrong a reboot doesn't help because it doesn't change the state to true and the display remains blank if I understand your words correct. In this case I have to manipulate the xfconf database manually to set the state to true but how without a display?
Maybe my thoughts are wrong but I don't want to crash my display server.
Last edited by Peter_Ziegler (2025-07-05 20:52:28)
Offline
Pages: 1
[ Generated in 0.011 seconds, 9 queries executed - Memory usage: 610.91 KiB (Peak: 628.19 KiB) ]