wl-clipedit

This commit is contained in:
Filippo Berto 2023-11-17 11:08:32 +01:00
parent e240fbdc46
commit b74916095a
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
3 changed files with 21 additions and 1 deletions

View file

@ -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
''

View file

@ -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; };

View file

@ -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