-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notification DND keybind #46
Comments
Mako modes enable disabling notifications via makoctl |
Created a script as a proof of concept using makoctl and a do-not-disturb mode #! /usr/bin/env nix-shell
#! nix-shell -i sh -p socat mako pipewire
# handle screencast events
handle_screencast() {
event_data="$1" # event data e.g. "screencast>>1,0"
echo "Hyprland screencast event: \"$event_data\""
data="${event_data#screencast>>}" # trim "screencast>>"
# janky way to check if there's currently a screencast client
echo "Checking for current screencast clients"
if pw-cli info all | grep -q '.xdg-desktop-portal-hyprland-wrapped:capture'; then
echo "Hiding notifications"
makoctl mode -a do-not-disturb # hide notifications
else
echo "Displaying notifications"
makoctl mode -r do-not-disturb # show notifications
fi
}
# listening for hyprland events
# https://wiki.hyprland.org/IPC/#how-to-use-socket2-with-bash
SOCKET_PATH="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
socat -U - UNIX-CONNECT:$SOCKET_PATH | while read -r line; do
case "$line" in
screencast*) handle_screencast "$line" ;;
*);;
esac
done services.mako.extraConfig = ''
[mode=do-not-disturb]
invisible=1
''; Would like to create a c application that interfaces with the pipewire api, this is what waybar does (though cpp) I'd like to use c as that's what mako uses, and might be cool to adapt this into a pull request for a config option or something |
I think a simple toggle bind would be far more effective and easier |
No description provided.
The text was updated successfully, but these errors were encountered: