qutebrowser: use fish as a file manager
This commit is contained in:
parent
0503bef471
commit
8e4a4961cc
@ -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"]
|
||||
|
@ -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
26
src/.local/bin/fish-fm
Executable 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
|
Loading…
Reference in New Issue
Block a user