From 69921d5c6e58cfcc5b89229cad4958aeb9eb7d52 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sun, 10 Nov 2024 21:00:44 +0100 Subject: [PATCH] feat(cliphist): add cliphist and refactor some code --- home/default.nix | 1 - home/graphical/cliphist.nix | 16 ++++++++++++++++ home/graphical/default.nix | 3 +++ home/{sway => graphical}/swayidle.nix | 0 home/{sway => graphical}/swaylock.nix | 5 ++--- home/hyprlock/default.nix | 5 ++--- home/sway/default.nix | 11 ++--------- hosts/brontes/home.nix | 2 +- hosts/marr/home.nix | 1 + 9 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 home/graphical/cliphist.nix rename home/{sway => graphical}/swayidle.nix (100%) rename home/{sway => graphical}/swaylock.nix (92%) diff --git a/home/default.nix b/home/default.nix index c33f413..13eede2 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,7 +10,6 @@ ./foot.nix ./rofi ./sway - ./sway/swayidle.nix ./waybar ./hyprpaper ./swaync diff --git a/home/graphical/cliphist.nix b/home/graphical/cliphist.nix new file mode 100644 index 0000000..6743284 --- /dev/null +++ b/home/graphical/cliphist.nix @@ -0,0 +1,16 @@ +{ lib, config, ... }: +let + package = config.services.cliphist.package; +in +{ + config = lib.mkIf config.services.cliphist.enable { + programs.rofi = { + enable = true; + extraConfig = { + modes = [ + "clipboard:${lib.my.checkPath package "cliphist-rofi-img"}" + ]; + }; + }; + }; +} diff --git a/home/graphical/default.nix b/home/graphical/default.nix index 0c5787b..a2ca96f 100644 --- a/home/graphical/default.nix +++ b/home/graphical/default.nix @@ -7,5 +7,8 @@ ./gammastep.nix # default because I need to protect my peepers ./swww.nix ./keepassxc.nix + ./cliphist.nix + ./swayidle.nix + ./swaylock.nix ]; } diff --git a/home/sway/swayidle.nix b/home/graphical/swayidle.nix similarity index 100% rename from home/sway/swayidle.nix rename to home/graphical/swayidle.nix diff --git a/home/sway/swaylock.nix b/home/graphical/swaylock.nix similarity index 92% rename from home/sway/swaylock.nix rename to home/graphical/swaylock.nix index bc49261..3e62883 100644 --- a/home/sway/swaylock.nix +++ b/home/graphical/swaylock.nix @@ -1,7 +1,6 @@ -{ ... }: +{ lib, config, ... }: { - programs.swaylock = { - enable = true; + config.programs.swaylock = lib.mkIf config.programs.swaylock.enable { settings = { ignore-empty-password = true; indicator-idle-visible = true; diff --git a/home/hyprlock/default.nix b/home/hyprlock/default.nix index bfeed39..3a54ac5 100644 --- a/home/hyprlock/default.nix +++ b/home/hyprlock/default.nix @@ -1,7 +1,6 @@ -{ lib, osConfig, ... }: -lib.mkIf (osConfig.programs.hyprland.enable || osConfig.programs.sway.enable) { +{ lib, config, ... }: +lib.mkIf config.programs.hyprlock.enable { programs.hyprlock = { - enable = true; settings = { general = { hide_cursor = true; diff --git a/home/sway/default.nix b/home/sway/default.nix index 190ae64..b8a3083 100644 --- a/home/sway/default.nix +++ b/home/sway/default.nix @@ -13,7 +13,6 @@ lib.mkIf osConfig.programs.sway.enable { wayland.windowManager.sway = let - homeDirectory = config.home.homeDirectory; term = "${pkgs.foot}/bin/foot"; filemanager = "${pkgs.nautilus}/bin/nautilus"; colors = { @@ -27,8 +26,6 @@ lib.mkIf osConfig.programs.sway.enable { keychron_bt = "1452:591:Keychron_K4"; }; }; - wallpaper = "${homeDirectory}/Pictures/backgrounds/catppucchin"; - mkRegexList = list: "^(${(lib.strings.concatStringsSep "|" list)})$"; in { @@ -90,8 +87,8 @@ lib.mkIf osConfig.programs.sway.enable { "--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; - "Print" = "exec ${pkgs.scripts.screenshot}/bin/screenshot"; - "${mod}+u" = "exec ${pkgs.hyprshot}/bin/hyprshot -o ~/Pictures/screenshots -m region"; + "Print" = "exec ${pkgs.hyprshot}/bin/hyprshot -m region"; + "${mod}+u" = "exec ${pkgs.hyprshot}/bin/hyprshot -m region"; "${mod}+Shift+u" = "exec ${pkgs.hyprshot}/bin/hyprshot --raw -m region | ${pkgs.satty}/bin/satty -f - --fullscreen"; #: Workspace movement {{{ @@ -123,10 +120,6 @@ lib.mkIf osConfig.programs.sway.enable { { command = "${pkgs.nextcloud-client}/bin/nextcloud --background"; } { command = "${config.services.kdeconnect.package}/bin/kdeconnect-indicator"; } { command = "${pkgs.protonmail-bridge-gui}/bin/protonmail-bridge-gui --no-window"; } - { - command = "${pkgs.scripts.set-background}/bin/set-background -f ${wallpaper}"; - always = true; - } ]; #: }}} assigns = { diff --git a/hosts/brontes/home.nix b/hosts/brontes/home.nix index 1968f65..f567dd7 100644 --- a/hosts/brontes/home.nix +++ b/hosts/brontes/home.nix @@ -30,8 +30,8 @@ services = { blueman-applet.enable = true; - swayidle.enable = true; syncthing.enable = true; + cliphist.enable = true; }; home = { diff --git a/hosts/marr/home.nix b/hosts/marr/home.nix index 8ba4501..61aad1b 100644 --- a/hosts/marr/home.nix +++ b/hosts/marr/home.nix @@ -41,6 +41,7 @@ services = { blueman-applet.enable = true; syncthing.enable = true; + cliphist.enable = true; }; home = {