-
Notifications
You must be signed in to change notification settings - Fork 19
Add mutter property check rather only relying on XDG_SESSION_DESKTOP … #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Comment on lines
+92
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a critical issue in the I've included a fix in the suggestion below, and also took the opportunity to make a few other improvements for maintainability:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get the bot's suggestion, this was previously tested and worked just fine :-) |
||
|
|
||
| if [ "$XDG_SESSION_TYPE" == "wayland" ]; then | ||
| turn-off-screen-in-wayland | ||
| else | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To align with the suggested fix and shell scripting best practices, this variable should be updated to its new lowercase name. This change is necessary for the new GNOME detection logic to function correctly.