2024-09-17 13:40:50 +02:00
|
|
|
#!/usr/bin/env nu
|
|
|
|
|
|
|
|
def notify [message: string] {
|
2024-09-17 14:09:58 +02:00
|
|
|
do { mpc -f "%file%" current | xargs -I{} mpc albumart {} } | save -f /tmp/mpc_current.png
|
|
|
|
notify-send "Noise" $"($message)" -i /tmp/mpc_current.png
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Displays the currently playing song
|
|
|
|
def main [] {
|
|
|
|
notify (mpc current)
|
|
|
|
}
|
|
|
|
|
|
|
|
# Skips to next song
|
|
|
|
def "main next" [] {
|
|
|
|
mpc next
|
2024-09-17 15:02:44 +02:00
|
|
|
notify $"Switching to:\n(mpc current)"
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Moves back a song in the que
|
|
|
|
def "main prev" [] {
|
|
|
|
mpc prev
|
2024-09-17 15:02:44 +02:00
|
|
|
notify $"Switching to:\n(mpc current)"
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Shuffles the current que
|
|
|
|
def "main shuffle" [] {
|
|
|
|
mpc shuffle
|
|
|
|
notify $"Shuffling que..."
|
|
|
|
}
|
|
|
|
|
|
|
|
# Stops playing the current que
|
|
|
|
def "main stop" [] {
|
|
|
|
mpc stop
|
2024-09-17 15:02:44 +02:00
|
|
|
notify $"Stopping playback of:\n(mpc toggle)"
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Starts playing the current que
|
|
|
|
def "main start" [] {
|
|
|
|
mpc start
|
2024-09-17 15:02:44 +02:00
|
|
|
notify $"Starting playback of:\n(mpc toggle)"
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Toggles playback of the current que
|
|
|
|
def "main toggle" [] {
|
|
|
|
mpc toggle
|
2024-09-17 15:02:44 +02:00
|
|
|
notify $"Toggling playback of:\n(mpc current)"
|
2024-09-17 13:40:50 +02:00
|
|
|
}
|