Skip to content

Commit

Permalink
tweaked Rofi-Beats
Browse files Browse the repository at this point in the history
  • Loading branch information
JaKooLit committed May 20, 2024
1 parent 0006e56 commit bbb2c6d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions config/hypr/UserScripts/RofiBeats.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/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/"

# Directory for icons
iDIR="$HOME/.config/swaync/icons"

# Online Stations
# Online Stations. Edit as required / want here
declare -A online_music=(
["AfroBeatz 2024 🎧"]="https://www.youtube.com/watch?v=7uB-Eh9XVZQ"
["Lofi Girl ☕️🎶"]="https://play.streamafrica.net/lofiradio"
Expand All @@ -22,7 +24,6 @@ declare -A online_music=(
["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() {
local_music=()
Expand Down Expand Up @@ -60,7 +61,7 @@ play_local_music() {
notification "$choice"

# Play the selected local music file using mpv
mpv --shuffle --vid=no "$file"
mpv --vid=no "$file"
}

# Main function for playing online music
Expand All @@ -81,7 +82,7 @@ play_online_music() {

# Main function for shuffling local music
shuffle_local_music() {
notification "Shuffle local music"
notification "Shuffle Play Local music"

# Play music in $mDIR on shuffle
mpv --shuffle --vid=no "$mDIR"
Expand All @@ -91,7 +92,7 @@ shuffle_local_music() {
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\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
"Play from Music Folder")
Expand All @@ -100,7 +101,7 @@ user_choice=$(printf "Play from Online Stations\nPlay from Music Folder\nShuffle
"Play from Online Stations")
play_online_music
;;
"Shuffle from Music Folder")
"Shuffle Play from Music Folder")
shuffle_local_music
;;
*)
Expand Down

0 comments on commit bbb2c6d

Please sign in to comment.