Open different-name opened 4 months ago
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
Mako modes enable disabling notifications via makoctl https://www.github.com/emersion/mako/issues/335