2025-03-01 12:23:40 +01:00

3.1 KiB

DnDBuster

A timer that notifies you - even if "do not disturb" is enabled.

ToC

Application IDs

https://developer.gnome.org/documentation/tutorials/application-id.html

Used by

  • GtkApplication

identifying your application to the system, for ensuring that only one instance of your application is running at a given time, and as a way of passing messages to your application

  • D-Bus

to name your application on the message bus. This is the primary means of communicating between applications

  • name of the .desktop file for your application

This file is how you describe your application to the system (so that it can be displayed in and launched by GNOME).

.desktop entry

https://wiki.gnome.org/HowDoI/GNotification

The GNOME desktop environment needs a .desktop file that matches your applications ID. Otherwise, sent notifications are not displayed!

Warning: gnome-shell uses desktop files to find extra information (app icon, name) about the sender of the notification. If you don't have a desktop file whose base name matches the application id, then your notification will not show up.

During development, we created a dummy vile at ~/.local/share/applications/de.p1st.dndbuster.desktop with content:

[Desktop Entry]
Name=DnDBuster
Comment=A simple timer app
Exec=nix-shell /home/yoda/Downloads/git/DnDBuster-python/shell.nix --run 'export PYTHONPATH="${PYTHONPATH}:/home/yoda/Downloads/git/DnDBuster-python/src" && python /home/yoda/Downloads/git/DnDBuster-python/src/dndbuster/main.py'
Icon=dndbuster-stopwatch
Terminal=false
Type=Application
Categories=Application;

Copy watch-icon.svg to ~/.local/share/icons/hicolor/scalable/apps/dndbuster-stopwatch.svg

GTK resources

mypy

https://mypy.readthedocs.io/en/latest/getting_started.html

mypy src/dndbuster/app.py

Alternatives

https://man.archlinux.org/man/notify-send.1.en

nix-shell -p libnotify
sleep 30m
notify-send -u critical -a PleaseDisturbTimer "Timeout" "The time is over and your do-not-disturb mode just got busted!"