2024-12-03 16:50:23 -05:00
|
|
|
{ pkgs, ... }:
|
2024-10-09 03:36:08 -04:00
|
|
|
{
|
2024-11-05 16:09:49 -05:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
(pkgs.writeScriptBin "makotoggle" ''
|
2024-08-24 22:16:51 -04:00
|
|
|
# Run makoctl mode and store the output in a variable
|
|
|
|
mode_output=$(makoctl mode)
|
|
|
|
|
|
|
|
# Extract the second line after "default"
|
|
|
|
mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}')
|
|
|
|
|
|
|
|
if [[ "$mode_line" == "do-not-disturb" ]]; then
|
|
|
|
# Notifications are disabled, so we enable them
|
|
|
|
makoctl mode -r do-not-disturb
|
|
|
|
notify-send --expire-time=1500 'Notifications Enabled'
|
|
|
|
else
|
|
|
|
# Notifications are enabled, so we disable them
|
|
|
|
notify-send --expire-time=1500 'Notifications Disabled'
|
|
|
|
sleep 2
|
|
|
|
makoctl mode -a do-not-disturb
|
|
|
|
fi
|
2024-11-05 16:09:49 -05:00
|
|
|
'')
|
|
|
|
];
|
2024-08-24 22:16:51 -04:00
|
|
|
}
|