dotfiles/.local/bin/toggle-beep

14 lines
266 B
Bash
Executable File

#!/bin/bash
dunstid=$(sum <<<beep | cut -d' ' -f1)
result=$(sudo modprobe -vr pcspkr)
if [[ -z "$result" ]]
then
sudo modprobe -v pcspkr &>/dev/null
sleep .5
dunstify -u low -r "$dunstid" Bipeur Activé
else
dunstify -u low -r "$dunstid" Bipeur Désactivé
fi