initial commit
This commit is contained in:
commit
23d4795228
99 changed files with 6691 additions and 0 deletions
23
scripts/doc
Executable file
23
scripts/doc
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
dir="$HOME/doc"
|
||||
test -d "$dir" || exit
|
||||
|
||||
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
||||
picker() { dmenu -i -l 10 -p "Select file or folder: "; }
|
||||
else
|
||||
picker() { rofi -dmenu -i -l 10 -p "Select file or folder"; }
|
||||
fi
|
||||
|
||||
while :; do
|
||||
choice="$(find "$dir" -not -path "$dir/.*" -mindepth 1 -maxdepth 1 \( -type d -printf "%f/\n" -o -type f -printf "%f\n" \) | picker)"
|
||||
|
||||
[ -n "$choice" ] || break
|
||||
|
||||
if [ -d "$dir/${choice%/}" ]; then
|
||||
dir="$dir/${choice%/}"
|
||||
elif [ -f "$dir/$choice" ]; then
|
||||
sioyek "$dir/$choice" &
|
||||
break
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue