diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-05-10 22:57:02 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-05-10 22:57:02 +0200 |
| commit | 3cd9138c9d8fb9be248c75330cca9da47f4d2e8a (patch) | |
| tree | b3b677a9c1a474589f45d20953028a987fa73b80 /dm-frecent | |
| parent | 83f7fe4b8402bab171d110703a1b1115efbc9b28 (diff) | |
| download | bin-3cd9138c9d8fb9be248c75330cca9da47f4d2e8a.tar.gz bin-3cd9138c9d8fb9be248c75330cca9da47f4d2e8a.zip | |
added a whole bunch of scripts
Diffstat (limited to 'dm-frecent')
| -rwxr-xr-x | dm-frecent | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dm-frecent b/dm-frecent new file mode 100755 index 0000000..0b12a92 --- /dev/null +++ b/dm-frecent @@ -0,0 +1,27 @@ +#!/usr/bin/env sh +# Pick a frecent file via fre, open with the right app for its type. +set -eu + +file=$( + fre --sorted \ + | while IFS= read -r f; do [ -f "$f" ] && printf '%s\n' "$f"; done \ + | dmenu -l 20 -i -p 'frecent:' +) || exit 0 +[ -n "$file" ] || exit 0 + +fre --add "$file" # bump score on reopen + +case "$file" in + *.pdf|*.epub) + exec zathura "$file" ;; + *.odt|*.ods|*.odp|*.doc|*.docx|*.xls|*.xlsx|*.ppt|*.pptx) + exec libreoffice "$file" ;; + *.png|*.jpg|*.jpeg|*.gif|*.webp|*.bmp|*.tiff) + exec nsxiv "$file" ;; + *.mp4|*.mkv|*.webm|*.avi|*.mov|*.mp3|*.flac|*.ogg|*.opus|*.wav|*.m4a) + exec mpv "$file" ;; + *.html|*.htm) + exec firefox "$file" ;; + *) + exec st -e vim "$file" ;; +esac |
