The script behaves weirdly when called using the shortcut, it works fine when called from the terminal.
So I added the line env > /home/seele/env-from-s.txt to compare with my session, and the file is never generated!
So I tried something else: I created a new shortcut with simply bash -c ‘env > /home/seele/env-from-s.txt’. And guess what? Nothing happens.
So right now I’m lost. I think this is a context issue (shortcuts may be launched from another context than the session, but that would be a strange design as the utility of such shortcuts is to behave exactly the same as if launched from the user).
You said it reacts weirdly so it sounds as if it does run but not do what it is supposed to do?
But then again not seeing your env output suggests that it does not run
But when activated from the shortcut, it only enables one of the desktop screen. The other stays disabled. That’s the “weird behavior” I was talking about. At first I was calling the kscreen-doctor directly but then I tried with a script.
How can I be sure the shortcut is properly triggered? Is there any log or output in KDE? So far “dmesg” doesn’t show anything.
you can run your script in a terminal and observe echo output, or you can add kdialog messages for debugging so can ulitimately be able to follow along with the script as it executes.
Meanwhile I removed the shortcuts and recreated it all, but using direct command kscreen-doctor instead of a script.
And what’s happing is unexpected.
The first command kscreen-doctor output.HDMI-A-1.enable output.DP-1.disable output.DP-3.disable perfectly works: both desktop screens off and the TV is on.
But when I try the second command kscreen-doctor output.HDMI-A-1.disable output.DP-1.enable output.DP-3.enable then TV is off, DP-1 is on but DP-3 stays off… unless I run the very same command from the terminal which output this:
Disabling output 3
Enabling output 1
Enabling output 2
qt.qpa.wayland: There are no outputs - creating placeholder screen
Hold on, I think we have a clue now, what’s this last message stands for?
but that works perfetly fine when the command is called from a terminal, so I don’t think the names change. They are related to the connected port (DP for DisplayPort) so it would not logic for them to change.