diff options
| author | Linxford Kwabena <linxford7@gmail.com> | 2024-05-12 12:38:07 +0000 |
|---|---|---|
| committer | Ja.KooLit <ejhay.games@gmail.com> | 2024-05-12 21:46:57 +0900 |
| commit | f3b3f8ed2b122a84ff1f6cc772e244d318fbf9f6 (patch) | |
| tree | 9fb40d4beaf4b0a61127e00bfd8706e67675ddf1 /config/hypr/UserScripts | |
| parent | b03a65085bf0b93567ca74e6d1fd5dc2a8c0b08d (diff) | |
Update RofiBeats.sh
Added option to list all supported music formats (mp3, ogg, wav, flac, m4a, wma,mp4) for local files.
Diffstat (limited to 'config/hypr/UserScripts')
| -rwxr-xr-x | config/hypr/UserScripts/RofiBeats.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 5620f666..010d5f74 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -6,10 +6,12 @@ iDIR="$HOME/.config/swaync/icons" # Define menu options as associative arrays for local and online music declare -A local_music -# Populate the menu_options array with music files from the Music folder -for file in ~/Music/*.mp3; do - filename=$(basename "$file") - local_music["$filename"]="$file" +# Populate the menu_options array with music files from the Music folder with specified extensions +for file in ~/Music/*.{mp3,ogg,wav,flac,m4a,wma,mp4}; do + if [ -f "$file" ]; then + filename=$(basename "$file") + local_music["$filename"]="$file" + fi done @@ -67,7 +69,6 @@ play_online_music() { # Check if an online music process is running and send a notification, otherwise run the main function pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { - # Prompt the user to choose between local and online music user_choice=$(printf "Play from Music Folder\nOnline Streaming" | rofi -dmenu -p "Select music source") @@ -83,4 +84,3 @@ pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { ;; esac } - |
