-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Junker
committed
Dec 20, 2019
1 parent
bdf9550
commit b3206e5
Showing
5 changed files
with
51 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Notify; | ||
|
||
class Notification : Object | ||
{ | ||
private Notify.Notification vol_notification; | ||
|
||
construct | ||
{ | ||
Notify.init ("MicTray"); | ||
|
||
vol_notification = new Notify.Notification ("Volume: %d%c".printf(pulse.volume, '%'), "", status_icon.icon_name); | ||
vol_notification.set_timeout(2000); | ||
vol_notification.set_hint("transient", new Variant.boolean(true)); | ||
} | ||
|
||
public void update() | ||
{ | ||
try | ||
{ | ||
this.vol_notification.update("Volume: %d%c".printf(pulse.volume, '%'), "", status_icon.icon_name); | ||
this.vol_notification.set_hint("value", new Variant.int32(pulse.volume)); | ||
this.vol_notification.show(); | ||
} | ||
catch (Error e) | ||
{ | ||
error ("Error: %s", e.message); | ||
} | ||
} | ||
|
||
public void source_changed() | ||
{ | ||
try | ||
{ | ||
Notify.Notification notification = new Notify.Notification ("Input source changed", pulse.current_source_description, status_icon.icon_name); | ||
notification.show(); | ||
} | ||
catch (Error e) | ||
{ | ||
error ("Error: %s", e.message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters