Hyprland and notifications with mako
source link: https://www.lorenzobettini.it/2023/11/hyprland-and-notifications-with-mako/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Hyprland and notifications with mako
Here’s another post on how to get started with Hyprland.
This time, we’ll see how to configure notifications with mako, a lightweight notification daemon for Wayland, which also works with Hyprland. (you might also want to consider and experiment with an alternative: dunst).
If you followed my previous tutorials, you have no notification daemon installed. You can verify that by running the following command (to issue a notification manually) and by looking at the resulting errors:
$ notify-send "hello" GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files |
Let’s install “mako”:
sudo pacman -S mako |
The nice thing about mako is that you don’t need to start it as a service manually: the first time a notification is emitted, mako will run automatically.
Let’s try to run the above notification command above, and this time, we see the pop-up, by default, on the right top corner of the screen:
You have to click the pop-up to make it disappear.
Each time a program emits a notification, mako will show it. For example, Thunderbird, Firefox, and Chrome will emit notifications that mako will display.
Let’s do some further experiments by manually emitting notifications:
notify-send "hello world\!" "This is a message" |
will lead to
You can see that the first argument is the title and formatted in boldface.
You can have a look at mako’s manual (5) about its configuration file and where it is searched for:
man 5 mako mako - configuration file DESCRIPTION The config file is located at <strong>~/.config/mako/config</strong> or at $XDG_CON‐ FIG_HOME/mako/config. Option lines can be specified to configure mako like so: key=value Empty lines and lines that begin with # are ignored. |
An example configuration, usable as a starting point, can be found here: https://github.com/emersion/mako/wiki/Example-configuration.
Each time you modify the configuration, you must reload mako by using one of the following commands:
killall mako |
makoctl reload |
With that example configuration, we can emit a few notifications with different “urgencies”, and see the different colors and positions of the boxes:
notify-send -u low "hello world\!" "This is a low urgency message" notify-send -u normal "hello world\!" "This is a normal message" notify-send -u critical \ "This is a critical message\!" \ "OK, that was just a demo ;)" |
If you use EndeavourOS, you will get notifications about new updates and when a reboot is required after a system update (the latter is a “critical” notification):
That’s all! Not too difficult, isn’t it?
Stay tuned for more posts about Hyprland.
Like this:
Related
Recommend
-
3
mako - full bitcoin implementation in C Mako is a from-scratch bitcoin reimplementation, written in "almost-C89" (i.e. it can be compiled by a C89 compiler if <stdint.h> is available -- no other C9...
-
4
Wayfire 迁移进展(三):taskmaid, waybar 以及 mako 等 本文来自依云's Blog,转...
-
5
mako学习笔记 2014-07-14 edx ed...
-
3
Mako 1.2.0 Documentation Release: 1.2.0 Most of the inheritance examples here take advantage of a feature...
-
4
Mako 1.2.0 Documentation Release: 1.2.0 Namespaces are used to organize groups of defs into categories, and also...
-
1
Hyprland and the Variety wallpaper manager Leave a reply ...
-
8
Screen sharing on Hyprland (Arch Linux) Table of contents Introduction This guide will go through the setup and troubleshooting steps required to get screen sharing working on OBS with the
-
20
This is the second blog post on getting started with Hyprland (see the first post here).
-
20
Hyprland and Waybar Leave a reply Up to now, I have shown how to ge...
-
7
Hyprland and ssh-agent Leave a reply In this post, I’d like to d...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK