Compare commits

..

1 Commits

2 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,7 @@
#
# If there is already a running instance, user will be prompted to end it.
getdim() { xrandr | grep -oP '(?<=current ).*(?=,)' | tr -d ' ' ;}
getdim() { xrandr | sed -n "s/\s*\([0-9]\+x[0-9]\+\).*\*.*/\1/p" ;}
updateicon() { \
echo "$1" > /tmp/recordingicon

View File

@ -1,4 +1,10 @@
#!/bin/sh
video_files=$(locate -d ~/.config/.mymlocate.db -b -r '.*\.\(mp4\|mkv\|webm\|mov\|m4v\|wmv\|flv\|avi\)$')
chosen_file=$(echo "$video_files" | sed 's|.*/||; s/\.[^.]*$//' | dmenu -p "Select Video")
mpv "$(echo "$video_files" | grep "/$chosen_file.")"
tempfile=$(mktemp)
locate -d ~/.config/.mymlocate.db -b -r '.*\.\(mp4\|mkv\|webm\|mov\|m4v\|wmv\|flv\|avi\)$' > "$tempfile"
chosen_name=$(sed 's|.*/||; s/\.[^.]*$//' "$tempfile" | dmenu -i -l 10 -p "Select a video file:")
chosen_path=$(grep "/$chosen_name\." "$tempfile")
mpv "$chosen_path"
rm -f "$tempfile"