#!/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