Updated Advanced use cases (markdown)

luukvbaal 2021-11-04 14:58:21 +01:00
parent cdf107f999
commit eaebd0212d

@ -132,11 +132,13 @@ To use `nnn` as the file picker dialog for chromium browsers, create a script `k
#!/bin/sh #!/bin/sh
while :; do case $1 in while :; do case $1 in
--getsavefilename) file="$2" break ;; --getsavefilename) file="$2" break ;;
--version) printf ""; exit ;;
--*) shift ;; --*) shift ;;
*) break ;; *) break ;;
esac done esac done
file="${file##/*/}" file="${file##/*/}"
st -c picker sh -c "nnn -S -s picker -p - | awk '{ print system(\"[ -d \" \$0 \" ]\") ? \$0: \$0\"/${file##/*/}\" }' > /proc/$$/fd/1" st -c picker sh -c "nnn -S -s picker -p - | awk '{ print system(\"[ -d \" \$0 \" ]\") ? \$0: \$0\"/${file##/*/}\" }' > /proc/$$/fd/1"
``` ```
This example sets the class for `st` to `picker` and `nnn` uses a named session `picker`. This allows you to for example have the picker window float by default in your window manager and `nnn` remembers where your previous "Save as..." target was. Replace with your preferred terminal and `nnn` options if applicable. This example sets the class for `st` to `picker` and `nnn` uses a named session `picker`. This allows you to for example have the picker window float by default in your window manager and `nnn` remembers where your previous "Save as..." target was. Replace with your preferred terminal and `nnn` options if applicable.