qutebrowser: use fish as a file manager

This commit is contained in:
dogeystamp 2023-06-24 11:58:20 -04:00
parent 0503bef471
commit 8e4a4961cc
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 36 additions and 0 deletions

View File

@ -14,3 +14,8 @@ c.fonts.default_family = "JetBrains Mono"
c.downloads.location.directory = "~/quar/"
c.scrolling.smooth = True
c.downloads.remove_finished = 1000
# homegrown file selector
c.fileselect.handler = "external"
c.fileselect.multiple_files.command = ["st", "-e", "fish", "-C", "set -x OUTPUT {}; source ~/.local/bin/fish-fm"]
c.fileselect.single_file.command = ["st", "-e", "fish", "-C", "set -x OUTPUT {}; source ~/.local/bin/fish-fm"]

View File

@ -115,3 +115,8 @@ config.bind("ct", "hint title userscript code_select.py")
# use libre redirects
config.bind(",fl", "hint links userscript fixlink.sh")
config.bind(",fL", "hint links userscript fixlink-tab.sh")
# homegrown file selector
c.fileselect.handler = "external"
c.fileselect.multiple_files.command = ["st", "-e", "fish", "-C", "set -x OUTPUT {}; source ~/.local/bin/fish-fm"]
c.fileselect.single_file.command = ["st", "-e", "fish", "-C", "set -x OUTPUT {}; source ~/.local/bin/fish-fm"]

26
src/.local/bin/fish-fm Executable file
View File

@ -0,0 +1,26 @@
#!/bin/fish
# simple wrapper to let you select files in the terminal
# call it like this:
#
# fish -P -C "set -x OUTPUT [output file]; source fish-fm"
#
# if specified, $OUTPUT will contain the selected paths
# otherwise paths are printed to stdout
# in the shell, write the following to select files:
#
# sel file1 file2 file3
#
if test -z "$OUTPUT"
set OUTPUT /dev/stdout
end
# clear output
printf "" > "$OUTPUT"
function sel
for arg in $argv
realpath "$arg" >> "$OUTPUT"
end
exit
end