{ config, pkgs, ... }:
{
  home.packages = with pkgs; lib.mkIf config.services.mako.enable [ 
    (pkgs.writeScriptBin "makotoggle" ''
      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
        notify-send 'Notifications Enabled'
      else
        notify-send 'Notifications Disabled'
        sleep 2
        makoctl mode -a do-not-disturb
      fi
    '')
  ];
}