Sunday, May 5, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2591  / 3 Years ago, sat, november 20, 2021, 1:34:09

So sometimes when I connect my laptop to a monitor I like to use both screens at the same time but sometimes I just want to use the monitor. However when I close my laptop screen, my cursor can still go off my monitor screen and to the laptop. I tried messing around with the power management settings such as turning the screen off when lid is closed and connected to an external monitor, but that turns both screens off. Currently, whenever I close my laptop screen I have to go to settings and manually disable it. Is there a way to automate this process? I am currently using Lubuntu 21.04. The other answers I’ve found say to do nothing when the lid closes but I need to disable the screen when the lid’s closed.


More From » multiple-monitors

 Answers
5

Here's how I have solved this problem. I use a keyboard shortcut to turn the laptop screen on and off.


First, run the following command to list your displays:


xrandr

Your laptop screen name should be something like LVDS1. You will need this name later.


Next, set a keyboard shortcut through Settings > Keyboard and click on the plus symbol near the lower right side of the window.


For the name, enter "screen off"


For the command, enter the following command but replace LVDS1 with the name of your laptop screen which may or may not be the same:


xrandr --output LVDS1 --off

Now, click on "Set Shortcut" and press CRTL+ALT+SHIFT+? (the last one is a down arrow if it's hard to see).


Finally, click "Add" to save the shortcut.


image settings window to add a keyboard shortcut with the options filled in as described in the instructions




Now, set a shortcut to turn the screen back on.


Again, click the plus symbol to add another shortcut.


For the name, enter "screen on".


For the command, enter the following command but replace LVDS1 with the name of your laptop screen which may or may not be the same:


 xrandr --output LVDS1 --auto

Now, click on "Set Shortcut" and press CRTL+ALT+SHIFT+? (the last one is an up arrow if it's hard to see).


Finally, click "Add" to save the shortcut.




You will need to log out and log back in to apply these shortcuts.


Also, you can use whatever keys you want. I chose the particular keys because they are unlikely to already be in use. If you set to a combination of keys that are already in use, the shortcut will not work.


[#1658] Saturday, November 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ditery

Total Points: 9
Total Questions: 116
Total Answers: 119

Location: Grenada
Member since Sun, Dec 20, 2020
3 Years ago
ditery questions
Sat, Oct 1, 22, 06:26, 2 Years ago
Thu, Jun 24, 21, 02:55, 3 Years ago
Tue, May 31, 22, 01:21, 2 Years ago
Fri, Jun 17, 22, 03:57, 2 Years ago
;