Replies: 4 comments 1 reply
-
nice idea... You can either integrate on the RofiBeats.sh or create a new one.... But a choice would be nice, Online or local music, shuffle, possibly add other filetypes like .ogg or something you can make PR so you will be credited accordingly... |
Beta Was this translation helpful? Give feedback.
1 reply
-
Done!! @JaKooLit Here is how it goes after an option is selected ...this comes up |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi bro @JaKooLit , i have just worked on this right now, and i want toknow if it will be worth it implementing it..
i can now play music from my local Music folder using the ff code, you can try it and give suggestions
`#!/bin/bash
Directory for icons
iDIR="$HOME/.config/swaync/icons"
Define menu options as an associative array
declare -A menu_options
Populate the menu_options array with music files from the Music folder
for file in ~/Music/*.mp3; do
filename=$(basename "$file")
menu_options["$filename"]="$file"
done
Function for displaying notifications
notification() {
notify-send -u normal -i "$iDIR/music.png" "Playing now: $@"
}
Main function
main() {
choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "")
if [ -z "$choice" ]; then
exit 1
fi
file="${menu_options[$choice]}"
notification "$choice"
Play the selected music file using mpv
mpv "$file"
}
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" || main
`
Beta Was this translation helpful? Give feedback.
All reactions