diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-09-20 11:45:19 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-09-20 11:45:19 +0200 |
commit | ecca3740145157b468064258974f505cc5c6771b (patch) | |
tree | 2654bb62183e3af3b2023ad8a4d9c708eee80d1e /bin/menuscripts/mmedia | |
parent | d9cc15bce788c57789982a0da10fd5720b93d412 (diff) | |
parent | cd7abd1c2a045f6b824fdcad864693b85cd84d61 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/menuscripts/mmedia')
-rwxr-xr-x | bin/menuscripts/mmedia | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/bin/menuscripts/mmedia b/bin/menuscripts/mmedia deleted file mode 100755 index d113e76..0000000 --- a/bin/menuscripts/mmedia +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env sh - -tmp="/tmp/mmedia" - -dirs="$HOME/dl" - -concat_path() { sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g"; } - -case "$1" in - "video") - regex='^.\+\.\(webm\|mp4\|mpeg\|mkv\)$' - dirs="$dirs $HOME/vids" - viewer() { mpv "$1"; } ;; - "pdf") - regex='^.\+\.\(pdf\)$' - dirs="$dirs $HOME/docs" - viewer() { zathura "$1"; } ;; - "images") - regex='^.\+\.\(png\|avif\|jpg\)$' - dirs="$dirs $HOME/pics" - viewer() { imv "$1"; } ;; - "cursus") - regex='^.*/[cC]ursus/index.html$' - dirs="$HOME/docs/school/Vakken" - concat_path() { sed "s#$dirs/##;s#/[cC]ursus/index.html##"; } - viewer() { $BROWSER "$1"; } ;; - *) - choice="$(cat <<-EOF | commander -d -c - video - pdf - images - cursus - EOF - )" - [ "$choice" ] || exit 1 - "$0" "$choice" - exit ;; -esac - -shift -[ "$1" ] && dirs="$1" - -choice="$(find -L $dirs 2> /dev/null | - grep "$regex" | - sort | tee "$tmp" | - concat_path | - commander -c -d -n -x)" - -file="$(sed -n "${choice}p" "$tmp")" -[ -r "$file" ] || exit 1 - -viewer "$file" |