use symlinks
This commit is contained in:
parent
088ce0f107
commit
4d70221098
8 changed files with 8 additions and 1297 deletions
36
scripts/doc
36
scripts/doc
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
require() {
|
||||
for cmd in "$@"; do
|
||||
command -v "$cmd" >/dev/null 2>&1 || {
|
||||
echo "doc: missing dependency: $cmd" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
require sioyek
|
||||
|
||||
dir="$HOME/doc"
|
||||
test -d "$dir" || exit
|
||||
|
||||
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
||||
require dmenu
|
||||
picker() { dmenu -i -l 10 -p "Select file or folder: "; }
|
||||
else
|
||||
require rofi
|
||||
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
|
||||
1
scripts/doc
Symbolic link
1
scripts/doc
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/40nbay8rh1nal3jj3na32jw0f9vi4gsh-home-manager-files/.local/bin/scripts/doc
|
||||
Loading…
Add table
Add a link
Reference in a new issue