From 49d20db7f35671d3eb2ce91cdee7ad334e61a903 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Thu, 25 Jul 2024 17:25:29 -0700 Subject: [PATCH] clipse and batsignal --- hosts/goopnet-interface/default.nix | 2 ++ modules/desktop/batsignal.nix | 23 +++++++++++++++++++++ modules/desktop/clipse.nix | 31 +++++++++++++++++++++++++++++ modules/desktop/hyprland.nix | 2 +- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 modules/desktop/batsignal.nix create mode 100644 modules/desktop/clipse.nix diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index 0a51c99..b43c260 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -54,6 +54,8 @@ rofi.enable = true; nwg-drawer.enable = true; waybar.enable = true; + batsignal.enable = true; + clipse.enable = true; # display manager sddm.enable = true; diff --git a/modules/desktop/batsignal.nix b/modules/desktop/batsignal.nix new file mode 100644 index 0000000..c8020bf --- /dev/null +++ b/modules/desktop/batsignal.nix @@ -0,0 +1,23 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop.batsignal; +in { + options.modules.desktop.batsignal = { + enable = mkEnableOption "Enable batsignal, a battery notification service"; + package = mkOption { + type = types.package; + default = pkgs.batsignal; + }; + }; + + config = mkIf cfg.enable { + hm.wayland.windowManager.hyprland.settings.exec-once = [ + # -w 20 -c 10 -d 5 -- set battery levels + # -p -- notify on plug/unplug + # -m 2 -- set interval to 2 seconds + "${lib.getExe cfg.package} -w 20 -c 10 -d 5 -p -m 2" + ]; + }; +} \ No newline at end of file diff --git a/modules/desktop/clipse.nix b/modules/desktop/clipse.nix new file mode 100644 index 0000000..26172a4 --- /dev/null +++ b/modules/desktop/clipse.nix @@ -0,0 +1,31 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop.clipse; +in { + options.modules.desktop.clipse = { + enable = mkEnableOption "Enable clipse, a generic clipboard manager"; + package = mkOption { + type = types.package; + default = pkgs.clipse; + }; + }; + + config = mkIf cfg.enable { + hm.wayland.windowManager.hyprland.settings = let + class = "clipse"; + in { + exec-once = [ "${lib.getExe cfg.package} -listen-shell" ]; + + windowrulev2 = [ + "float, class:^${class}$" + "size 622 652, class:^${class}$" + ]; + + bind = [ + "$mod, V, exec, ${lib.getExe pkgs.wezterm} start --class ${class} -e '${lib.getExe cfg.package}'" + ]; + }; + }; +} \ No newline at end of file diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 54548e4..46b68c1 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -103,7 +103,7 @@ in { "$mod, T, exec, ${lib.getExe pkgs.wezterm}" "$mod, Q, killactive, " - "$mod, V, togglefloating, " + "$mod, F, togglefloating, " "$mod, P, pseudo, " # dwindle "$mod, J, togglesplit, " # dwindle