From: Einar Jørgen Haraldseid Date: Tue, 10 Mar 2026 19:13:24 +0000 (+0100) Subject: list-inhibitors.sh for listing apps that are blocking screen blanking X-Git-Url: https://git.slaskete.net/einar-bin/commitdiff_plain?ds=sidebyside list-inhibitors.sh for listing apps that are blocking screen blanking --- diff --git a/list-inhibitors.sh b/list-inhibitors.sh new file mode 100755 index 0000000..dfc2527 --- /dev/null +++ b/list-inhibitors.sh @@ -0,0 +1,12 @@ +inhibitors=$(dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.GetInhibitors 2>/dev/null | awk '/object path/ {print $3}' | tr -d '\"') +if [[ -z "$inhibitors" ]]; then + echo "No inhibitors found." + exit 0 +else + # Loop through each inhibitor and get the application name + for inhibitor in $inhibitors; do + app_id=$(dbus-send --print-reply --dest=org.gnome.SessionManager "$inhibitor" org.gnome.SessionManager.Inhibitor.GetAppId 2>/dev/null | awk -F '"' '/string/ {print $2}') + app_reason=$(dbus-send --print-reply --dest=org.gnome.SessionManager "$inhibitor" org.gnome.SessionManager.Inhibitor.GetReason 2>/dev/null | awk -F '"' '/string/ {print $2}') + echo "Inhibitor: $inhibitor | App: $app_id | Reason: $app_reason" + done +fi