diff --git a/custom/wl-clipedit/default.nix b/custom/wl-clipedit/default.nix new file mode 100644 index 0000000..eaebeb1 --- /dev/null +++ b/custom/wl-clipedit/default.nix @@ -0,0 +1,18 @@ +{ writeShellScriptBin +, lib +, wl-clipboard +, coreutils +, terminal-command ? "kitty -e" +}: +# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } +# 65 │ function clippaste() { xclip -out -selection clipboard; } clip +writeShellScriptBin "wl-clipedit" '' + PATH=$PATH:"${lib.makeBinPath [ coreutils wl-clipboard ]}" + tmp_file=$(mktemp) + wl-paste -pn > $tmp_file + ${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file + wl-copy -pn < $tmp_file + rm $tmp_file +'' + + diff --git a/flake.nix b/flake.nix index 74a53bb..22d318a 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,7 @@ # Flakes packages (self: super: { clipedit = self.callPackage ./custom/clipedit { }; + wl-clipedit = self.callPackage ./custom/wl-clipedit { }; update-background = self.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; }; lockscreen = self.callPackage ./custom/lockscreen { palette = self.rice.colorPalette; font = self.rice.font.normal; }; way-lockscreen = self.callPackage ./custom/way-lockscreen { palette = self.rice.colorPalette; font = self.rice.font.normal; }; diff --git a/modules/hm/hyprland.nix b/modules/hm/hyprland.nix index 59b6d27..7eb9e05 100644 --- a/modules/hm/hyprland.nix +++ b/modules/hm/hyprland.nix @@ -7,7 +7,7 @@ ./yazi.nix ]; - home.packages = builtins.attrValues { inherit (pkgs) blueman brillo networkmanagerapplet pamixer playerctl swaylock swww way-lockscreen waybar wlogout wofi wofi-emoji; }; + home.packages = builtins.attrValues { inherit (pkgs) blueman brillo networkmanagerapplet pamixer playerctl swaylock swww way-lockscreen waybar wl-clipboard wl-clipedit wlogout wofi wofi-emoji; }; # wayland.windowManager.hyprland = { }; @@ -169,6 +169,7 @@ bind = SUPER, P, pseudo, # dwindle bind = SUPER, J, togglesplit, # dwindle bind = SUPER ALT, E, exec, wofi-emoji + bind = SUPER ALT, P, exec, wl-clipedit # Move focus to relative position bind = SUPER, left, movefocus, l