Handy dot files with sensible bindings and settings
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
2.0 KiB

#!/bin/bash
# Directory for icons
iDIR="$HOME/.config/swaync/icons"
# Note: You can add more options below with the following format:
# ["TITLE"]="link"
# Define menu options as an associative array
declare -A menu_options=(
["Lofi Girl ☕🎶"]="https://play.streamafrica.net/lofiradio"
["Easy Rock 96.3 FM 📻🎶"]="https://radio-stations-philippines.com/easy-rock"
["Wish 107.5 FM 📻🎶"]="https://radio-stations-philippines.com/dwnu-1075-wish"
["Wish 107.5 YT Pinoy HipHop 🎻🎶"]="https://youtube.com/playlist?list=PLkrzfEDjeYJnmgMYwCKid4XIFqUKBVWEs&si=vahW_noh4UDJ5d37"
["Top Youtube Music 2023 ☕🎶"]="https://youtube.com/playlist?list=PLDIoUOhQQPlXr63I_vwF9GD8sAKh77dWU&si=y7qNeEVFNgA-XxKy"
["Wish 107.5 YT Wishclusives ☕🎶"]="https://youtube.com/playlist?list=PLkrzfEDjeYJn5B22H9HOWP3Kxxs-DkPSM&si=d_Ld2OKhGvpH48WO"
["Chillhop ☕🎶"]="http://stream.zeno.fm/fyn8eh3h5f8uv"
["SmoothChill ☕🎶"]="https://media-ssl.musicradio.com/SmoothChill"
["Relaxing Music ☕🎶"]="https://youtube.com/playlist?list=PLMIbmfP_9vb8BCxRoraJpoo4q1yMFg4CE"
["Youtube Remix 📻🎶"]="https://youtube.com/playlist?list=PLeqTkIUlrZXlSNn3tcXAa-zbo95j0iN-0"
["Korean Drama OST 📻🎶"]="https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ"
)
# 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
link="${menu_options[$choice]}"
notification "$choice"
# Check if the link is a playlist
if [[ $link == *playlist* ]]; then
mpv --shuffle --vid=no "$link"
else
mpv "$link"
fi
}
# 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