Skip to content

Commit

Permalink
inhibit applet: Pass a string to showOSD when using hotkeys
Browse files Browse the repository at this point in the history
When a hot key is set in the applets options, using them will show an OSD.
Pass a label so we get a proper display
  • Loading branch information
JosephMcc committed Sep 24, 2024
1 parent a312d61 commit 69e60b0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions files/usr/share/cinnamon/applets/inhibit@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,11 @@ class CinnamonInhibitApplet extends Applet.IconApplet {
"inhibit-symbolic" :
"inhibit-active-symbolic";

Main.osdWindowManager.show(-1, Gio.ThemedIcon.new(_symbol));
let _text = this.inhibitSwitch._switch.state ?
_("Power Management Active") :
_("Power Management Inhibited");

Main.osdWindowManager.show(-1, Gio.ThemedIcon.new(_symbol), _text);
}

toggle_inhibit_notifications() {
Expand All @@ -488,7 +492,11 @@ class CinnamonInhibitApplet extends Applet.IconApplet {
"inhibit-notification-symbolic" :
"inhibit-notification-active-symbolic";

Main.osdWindowManager.show(-1, Gio.ThemedIcon.new(_symbol));
let _text = this.notificationsSwitch._switch.state ?
_("Notifications Active") :
_("Notifications Inhibited");

Main.osdWindowManager.show(-1, Gio.ThemedIcon.new(_symbol), _text);
}

get inhibitors() {
Expand Down

0 comments on commit 69e60b0

Please sign in to comment.