@ -1,12 +1,14 @@
#!/bin/bash
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# This script Rofi Beats (Super Shift M)
# Directory music folder
# Directory music folder for Local Music
mDIR = " $HOME /Music/ "
mDIR = " $HOME /Music/ "
# Directory for icons
# Directory for icons
iDIR = " $HOME /.config/swaync/icons "
iDIR = " $HOME /.config/swaync/icons "
# Online Stations
# Online Stations. Edit as required / want here
declare -A online_music = (
declare -A online_music = (
[ "AfroBeatz 2024 🎧" ] = "https://www.youtube.com/watch?v=7uB-Eh9XVZQ"
[ "AfroBeatz 2024 🎧" ] = "https://www.youtube.com/watch?v=7uB-Eh9XVZQ"
[ "Lofi Girl ☕️ 🎶" ] = "https://play.streamafrica.net/lofiradio"
[ "Lofi Girl ☕️ 🎶" ] = "https://play.streamafrica.net/lofiradio"
@ -22,7 +24,6 @@ declare -A online_music=(
[ "Korean Drama OST 📻🎶" ] = "https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ"
[ "Korean Drama OST 📻🎶" ] = "https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ"
)
)
# Local Music
# Populate local_music array with files from music directory and subdirectories
# Populate local_music array with files from music directory and subdirectories
populate_local_music( ) {
populate_local_music( ) {
local_music = ( )
local_music = ( )
@ -60,7 +61,7 @@ play_local_music() {
notification " $choice "
notification " $choice "
# Play the selected local music file using mpv
# Play the selected local music file using mpv
mpv --shuffle -- vid= no " $file "
mpv --vid= no " $file "
}
}
# Main function for playing online music
# Main function for playing online music
@ -81,7 +82,7 @@ play_online_music() {
# Main function for shuffling local music
# Main function for shuffling local music
shuffle_local_music( ) {
shuffle_local_music( ) {
notification "Shuffle local music"
notification "Shuffle P lay L ocal music"
# Play music in $mDIR on shuffle
# Play music in $mDIR on shuffle
mpv --shuffle --vid= no " $mDIR "
mpv --shuffle --vid= no " $mDIR "
@ -91,7 +92,7 @@ shuffle_local_music() {
pkill mpv && notify-send -u low -i " $iDIR /music.png " "Music stopped" || {
pkill mpv && notify-send -u low -i " $iDIR /music.png " "Music stopped" || {
# Prompt the user to choose between local and online music
# Prompt the user to choose between local and online music
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" )
user_choice = $( printf "Play from Online Stations\nPlay from Music Folder\nShuffle Play from Music Folder" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source" )
case " $user_choice " in
case " $user_choice " in
"Play from Music Folder" )
"Play from Music Folder" )
@ -100,7 +101,7 @@ user_choice=$(printf "Play from Online Stations\nPlay from Music Folder\nShuffle
"Play from Online Stations" )
"Play from Online Stations" )
play_online_music
play_online_music
; ;
; ;
"Shuffle from Music Folder" )
"Shuffle Play from Music Folder" )
shuffle_local_music
shuffle_local_music
; ;
; ;
*)
*)