diff --git a/user/app/ranger/ranger.nix b/user/app/ranger/ranger.nix index 557151f..9fb478f 100644 --- a/user/app/ranger/ranger.nix +++ b/user/app/ranger/ranger.nix @@ -1,9 +1,19 @@ { config, lib, pkgs, ... }: - +let myCbxScript = '' + #!/bin/sh + if [ "$#" -le "2" ]; then + if [ "$1" = "copy" -o "$1" = "cut" ]; then + #xclip -selection clipboard -t $(file -b --mime-type $2) -i $2; + xclip -selection clipboard -t image/png -i $2; + fi + fi + ''; +in { home.packages = with pkgs; [ ranger xdragon + (pkgs.writeScriptBin "cbx" myCbxScript) ]; home.file.".config/ranger/rc.conf".source = ./rc.conf; home.file.".config/ranger/rifle.conf".source = ./rifle.conf; diff --git a/user/app/ranger/rc.conf b/user/app/ranger/rc.conf index cbcef6a..9c83ae7 100644 --- a/user/app/ranger/rc.conf +++ b/user/app/ranger/rc.conf @@ -504,7 +504,7 @@ map da cut mode=add map dr cut mode=remove map dt cut mode=toggle -map yy chain copy; shell ~/.local/bin/cbx copy %s +map yy chain copy; shell cbx copy %s map uy uncut map ya copy mode=add map yr copy mode=remove