NixOS-Config/modules/home/programs/gui/mako/default.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

2024-10-15 02:40:43 -04:00
{ pkgs, config, ... }:
2024-10-09 03:36:08 -04:00
{
2024-09-23 16:22:01 -04:00
services.mako = {
2024-08-24 22:16:51 -04:00
enable = true;
2024-10-15 02:40:43 -04:00
borderColor = "#${config.look.colors.accent}";
2024-10-16 00:04:56 -04:00
backgroundColor = "#${config.look.colors.dark}D9";
2024-10-15 02:40:43 -04:00
output = "${config.displays.d1}";
2024-08-24 22:16:51 -04:00
sort = "+time";
layer = "overlay";
padding = "8";
margin = "0";
2024-10-15 02:40:43 -04:00
borderSize = config.look.border.int;
2024-08-24 22:16:51 -04:00
maxIconSize = 40;
defaultTimeout = 6000;
2024-10-15 02:40:43 -04:00
font = "${config.look.fonts.main} 12";
2024-08-24 22:16:51 -04:00
anchor = "bottom-right";
extraConfig = ''
on-button-right=dismiss-all
outer-margin=10
[mode=do-not-disturb]
invisible=1
'';
2024-08-24 22:16:51 -04: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-08-24 22:16:51 -04:00
}