Ranger dnd optimization + qb filepicker

This commit is contained in:
Emmet 2023-11-04 14:00:41 -05:00
parent 4e86fb971a
commit 49b0f04fda
4 changed files with 21 additions and 1 deletions

View file

@ -82,6 +82,13 @@ c.url.searchengines = {'DEFAULT': 'https://startpage.com/do/search?query={}',
config.set('completion.open_categories',["searchengines","quickmarks","bookmarks"])
config.set('downloads.location.directory', '~/Downloads')
config.set('fileselect.handler', 'external')
config.set('fileselect.single_file.command', ['kitty','-e','ranger','--choosefile={}'])
config.set('fileselect.multiple_files.command', ['kitty','-e','ranger','--choosefiles={}'])
config.set('fileselect.folder.command', ['kitty','-e','ranger','--choosedir={}'])
config.bind('t', 'open -t')
config.bind('x', 'tab-close')
config.bind('yf', 'hint links yank')

View file

@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }:
let myCbxScript = ''
# TODO fix this for wayland
#!/bin/sh
if [ "$#" -le "2" ]; then
if [ "$1" = "copy" -o "$1" = "cut" ]; then
@ -14,10 +15,13 @@ in
home.packages = with pkgs; [
ranger
xdragon
ripdrag
highlight
(pkgs.writeScriptBin "cbx" myCbxScript)
];
xdg.mimeApps.associations.added = {
"inode/directory" = "ranger.desktop";
};
home.file.".config/ranger/rc.conf".source = ./rc.conf;
home.file.".config/ranger/rifle.conf".source = ./rifle.conf;
home.file.".config/ranger/scope.sh" = {

View file

@ -503,6 +503,8 @@ map ud uncut
map da cut mode=add
map dr cut mode=remove
map dt cut mode=toggle
map do shell -w ripdrag -x %s
map dO shell -w ripdrag -x *
map yy chain copy; shell cbx copy %s
map uy uncut

View file

@ -17,9 +17,16 @@
# fixes a bug for kitty users that use image previews
substituteInPlace ranger/ext/img_display.py \
--replace "self.image_id -= 1" "self.image_id = max(0, self.image_id - 1)"
# fixes the .desktop file
substituteInPlace doc/ranger.desktop \
--replace "Terminal=true" "Terminal=false"
substituteInPlace doc/ranger.desktop \
--replace "Exec=ranger" "Exec=kitty -e ranger %U"
'';
});
}
)
];
}