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 25, 2024
1 parent a312d61 commit 500fee3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions files/usr/share/cinnamon/applets/[email protected]/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ class InhibitSwitch extends PopupMenu.PopupBaseMenuItem {
if (current_state & INHIBIT_IDLE_FLAG ||
current_state & INHIBIT_SLEEP_FLAG) {
this._applet.icon.toggleInhibitStatus(true);
this._applet.set_applet_tooltip(_("Power management: inhibited"));
this._applet.set_applet_tooltip(_("Power management: Inhibited"));
} else {
this._applet.icon.toggleInhibitStatus(false);
this._applet.set_applet_tooltip(_("Power management: active"));
this._applet.set_applet_tooltip(_("Power management: Active"));
}

if (current_state >= INHIBIT_SLEEP_FLAG && !this.sessionCookie) {
Expand Down 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 500fee3

Please sign in to comment.