Deskto...ication(3pm)
π Desktop::Notify::Notification β a notification object for the desktop notifications framework π
okay so bestie, this is the manual page for Desktop::Notify::Notification (section 3pm, i.e. a Perl module page, from the User Contributed Perl Documentation crew). It's literally the notification object for the desktop notifications framework. Sit down, grab a strawberry π, and let's get into it.
β¨ VERSION β¨
This is Version 0.03, no cap.
π¦ SYNOPSIS π¦
okay so picture this: $notify is an existing Desktop::Notify object (not this class's business, we're just borrowing it), and you make a note like this:
# $notify is an existing Desktop::Notify object
my $note = $notify->create(summary => 'Rebuilding FooBar',
body => 'Progress: 10%');
$note->show;
then, like, later on:
# Update the notification later
$note->body('Progress: 20%');
$note->show;
and when you're done with it, take it off the screen:
# Take it off the screen
$note->close;
slay. that's the whole vibe. π
πΈ DESCRIPTION πΈ
Desktop notification objects are represented as objects of this class. They are created by a Desktop::Notify object β not by you directly, bestie, let the parent handle it. And then displaying, closing, and modifying the notification? All done with the methods in this class. Iconic division of labour honestly. π
π METHODS π
new $notify, %params
This one is called internally by Desktop::Notify to create a new notification object. So like, not your job. The parent class handles it. iykyk. π«Ά
show
Display the notification on the screen. β¨ And listen: if this notification had previously been shown and not closed yet, it will replace the existing notification.
You can call show multiple times on the same notification β probably with attribute changes in between calls β and later show calls will cause the server to seamlessly replace the existing notification. seamless. we love a glow-up that doesn't flicker. π
close
Close the notification if it is already being displayed. That's it, that's the method. bye bestie π
π ATTRIBUTES π
So these are the parameters you can set when creating the object, or change later using accessors. (and jsyk, the descriptions below are from the spec at <http://www.galago-project.org/specs/notification/0.9/x408.html> β credit where it's due π)
summaryβ the summary text that briefly describes the notification. the TL;DR of your notif, fr fr.bodyβ the optional detailed body text. Can be empty. no pressure, she can be a little mysterious πactionsβ actions are sent over as a list of pairs. Each even element in the list (starting at index 0) represents the identifier for the action. Each odd element in the list is the localized string that will be displayed to the user.
A user-specified function to be called whenever an action is invoked can be specified with Desktop::Notify's action_callback method. (that's the parent's job, not ours β go look over there π)
hintsβ optional hints that can be passed to the server from the client program. lil whispers, if you will. π€«timeoutβ the timeout time in milliseconds since the display of the notification at which the notification should automatically close.
If -1, the notification's expiration time is dependent on the notification server's settings, and may vary for the type of notification. If 0, never expire. (immortal notif energy, honestly π)
π the extra parameters π
The following extra parameters are included in the specification but not supported by Desktop::Notify at this time. so like, they're in the group chat but they never show up to the hangout. π
app_iconβ the optional program icon of the calling application.
heads up bestie: those last ones? spec says yes, Desktop::Notify says "not right now." don't come for me, I'm just the messenger π«Ά
and that's the whole page, mwah π This was Deskto...ication(3pm), from perl v5.28.0, dated 2018-10-29. stay notified, stay iconic, and remember: if it's not in the spec, it's not in the code. periodt. π
β¨
π¦ where this page comes from
- ubuntu jammy: libdesktop-notify-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdesktop-notify-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms