Preamble: Please don't feel offended when I explain basic safety procedures. I know you are an IT expert, but I need to make sure you don't get into trouble, and, most of all, there are all sorts of people reading here and some of them will try this too...
First of all, save and close all your open files.
In the worst case, you may need to force power-off, i.e. press the power button continuously for a few seconds. Doing a full restart would then reset everything back to normal. I experienced this before and my computer did not suffer.
Now, create those two keyboard shortcuts:
ScreenON
Code: Select all
bash -c "xrandr --output HDMI-0 --auto --output DP-4 --auto;"
NOTE: This will only work with your current installation: HDMI-0 and DP-4.
ScreenLOCK
Code: Select all
bash -c "cinnamon-screensaver-command -l; sleep 3; xrandr --output HDMI-0 --off --output DP-4 --off;"
NOTE: This will only work with your current installation: HDMI-0 and DP-4.
There is a 3 seconds delay between the screen lock and the screen off. Please leave this
sleep 3
there, it might be really needed. Same thing for this
bash -c
and everything else here...
It works! And that's a bit confusing and scary... I was forgetting something... You can't use your keyboard shortcuts when the screen is locked, of course! So, here, you end up having to type your password while the screen is off! Well, it doesn't make a big difference. Usually, you get to see how many characters you typed, and you get a warning message when the cap locks is on. Now you must type your password while facing a blank screen! It is only when you successfully unlocked your screen that you can press your ScreenON keyboard shortcut!
Maybe we could build something smarter, later on. Something that would turn on your screen as soon as you unlock it, for example. But let's start with these 2 little tests here, please.