dotfiles/scripts/mpv-pick.sh
2026-08-07 00:59:48 -04:00

8 lines
338 B
Bash
Executable file

#!/bin/bash
# Build a list of full paths, display just filenames in rofi
files=$(cd $HOME/Videos && fd -t f)
selection=$(echo "$files" | awk -F'/' '{print $NF}' | rofi -i -dmenu -p mpv)
if [ -n "$selection" ]; then
fullpath=$(echo "$files" | grep -F "$selection" | head -1)
mpv --save-position-on-quit "$HOME/Videos/$fullpath"
fi