Revived cbx script to copy images directly to clipboard

This commit is contained in:
Emmet 2023-06-15 19:05:18 -05:00
parent 23a2dcc1a1
commit f7c2b21b09
2 changed files with 12 additions and 2 deletions

View file

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

View file

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