diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2024-05-20 12:12:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-20 12:12:33 +0900 |
| commit | 0006e56a97120792a90087875d8cab6b2f46ed78 (patch) | |
| tree | 0bdf2f0dfd32bd0c8a88420afed0c1bd64a981bc | |
| parent | 9a5fa868105d459da9dd6323accf7f7c50589dd7 (diff) | |
| parent | 56fc332acc557bb09eae5fd317170146281fe9d9 (diff) | |
Merge pull request #285 from darkeddie/development
Add a Quick shuffle option to rofibeats
| -rwxr-xr-x | config/hypr/UserScripts/RofiBeats.sh | 15 | ||||
| -rw-r--r-- | config/rofi/config-rofi-Beats-menu.rasi | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 1cf2a445..5753857b 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -79,11 +79,19 @@ play_online_music() { mpv --shuffle --vid=no "$link" } +# Main function for shuffling local music +shuffle_local_music() { + notification "Shuffle local music" + + # Play music in $mDIR on shuffle + mpv --shuffle --vid=no "$mDIR" +} + # 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" || { +pkill mpv && notify-send -u low -i "$iDIR/music.png" "Music stopped" || { # Prompt the user to choose between local and online music -user_choice=$(printf "Play from Online Stations\nPlay from Music Folder" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source") +user_choice=$(printf "Play from Online Stations\nPlay from Music Folder\nShuffle from Music Folder" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source") case "$user_choice" in "Play from Music Folder") @@ -92,6 +100,9 @@ user_choice=$(printf "Play from Online Stations\nPlay from Music Folder" | rofi "Play from Online Stations") play_online_music ;; + "Shuffle from Music Folder") + shuffle_local_music + ;; *) echo "Invalid choice" ;; diff --git a/config/rofi/config-rofi-Beats-menu.rasi b/config/rofi/config-rofi-Beats-menu.rasi index 6cdd6e99..fd2e194e 100644 --- a/config/rofi/config-rofi-Beats-menu.rasi +++ b/config/rofi/config-rofi-Beats-menu.rasi @@ -18,5 +18,5 @@ window { listview { fixed-columns: false; colums: 1; - lines: 2; -}
\ No newline at end of file + lines: 3; +} |
