nixos-config/modules/home/wms/programs/mako/makotoggle/default.nix

21 lines
556 B
Nix
Raw Normal View History

{ config, pkgs, ... }:
2024-10-09 03:36:08 -04:00
{
home.packages = with pkgs; lib.mkIf config.services.mako.enable [
(pkgs.writeScriptBin "makotoggle" ''
2024-08-24 22:16:51 -04:00
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
makoctl mode -r do-not-disturb
2024-12-08 06:41:06 -05:00
notify-send 'Notifications Enabled'
2024-08-24 22:16:51 -04:00
else
2024-12-08 06:41:06 -05:00
notify-send 'Notifications Disabled'
2024-08-24 22:16:51 -04:00
sleep 2
makoctl mode -a do-not-disturb
fi
'')
];
2024-08-24 22:16:51 -04:00
}