From a19623ea0ac098c6bf545fea043694da97029f08 Mon Sep 17 00:00:00 2001 From: Eddy <4950107+echu2013@users.noreply.github.com> Date: Sun, 5 Oct 2025 22:43:33 -0300 Subject: [PATCH] Add mutter property check rather only relying on XDG_SESSION_DESKTOP name, add support to gnome-shell +v48 on Ubuntu 25.04 and probably others as well --- turn-off-monitors | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/turn-off-monitors b/turn-off-monitors index efd4b2c..d4601aa 100755 --- a/turn-off-monitors +++ b/turn-off-monitors @@ -17,7 +17,7 @@ function turn-off-screen-in-wayland() { echo "Turning off monitors..." - if [[ $XDG_SESSION_DESKTOP == gnome* ]]; then + if [[ $XDG_SESSION_DESKTOP == gnome* || $MUTTER_PROPERTY_SUPPORTED ]]; then _trigger-monitors-off-in-gnome-wayland local interaction_event=$(wait_until_mouse_or_keyboard_event) @@ -89,6 +89,13 @@ function wait_until_mouse_or_keyboard_event() } ### END framework/wait_until_mouse_or_keyboard_event.sh +# C +if busctl --user get-property org.gnome.Mutter.DisplayConfig \ + /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig \ + PowerSaveMode &>/dev/null; then + MUTTER_PROPERTY_SUPPORTED=true +fi + if [ "$XDG_SESSION_TYPE" == "wayland" ]; then turn-off-screen-in-wayland else