Finished hacker theme mostly and added some other configs
This commit is contained in:
parent
0c499ecbd6
commit
ad06f5284e
91 changed files with 1928 additions and 3 deletions
43
themes/base/.config/xdg-desktop-portal-termfilechooser/ranger-wrapper.sh
Executable file
43
themes/base/.config/xdg-desktop-portal-termfilechooser/ranger-wrapper.sh
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env sh
|
||||
# This wrapper script is invoked by xdg-desktop-portal-termfilechooser.
|
||||
#
|
||||
# For more information about input/output arguments read `xdg-desktop-portal-termfilechooser(5)`
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$6" -ge 4 ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
multiple="$1"
|
||||
directory="$2"
|
||||
save="$3"
|
||||
path="$4"
|
||||
out="$5"
|
||||
|
||||
cmd="ranger"
|
||||
termcmd="${TERMCMD:-kitty --title 'termfilechooser'}"
|
||||
|
||||
if [ "$save" = "1" ]; then
|
||||
# save a file
|
||||
set -- --choosefile="$out" --cmd="echo Select save path (see tutorial in preview pane; try pressing zv or zp if no preview)" --selectfile="$path"
|
||||
elif [ "$directory" = "1" ]; then
|
||||
# upload files from a directory
|
||||
set -- --choosedir="$out" --show-only-dirs --cmd="echo Select directory (quit in dir to select it)" "$path"
|
||||
elif [ "$multiple" = "1" ]; then
|
||||
# upload multiple files
|
||||
set -- --choosefiles="$out" --cmd="echo Select file(s) (open file to select it; <Space> to select multiple)" "$path"
|
||||
else
|
||||
# upload only 1 file
|
||||
set -- --choosefile="$out" --cmd="echo Select file (open file to select it)" "$path"
|
||||
fi
|
||||
|
||||
command="$termcmd $cmd"
|
||||
for arg in "$@"; do
|
||||
# escape double quotes
|
||||
escaped=$(printf "%s" "$arg" | sed 's/"/\\"/g')
|
||||
# escape special
|
||||
command="$command \"$escaped\""
|
||||
done
|
||||
|
||||
sh -c "$command"
|
||||
Loading…
Add table
Add a link
Reference in a new issue