aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorDonald Williams <129223418+dwilliam62@users.noreply.github.com>2025-10-03 15:22:53 -0400
committerGitHub <noreply@github.com>2025-10-03 15:22:53 -0400
commit8da32f1f6e8ec1d2b25a14efbf927af232323315 (patch)
tree3d536d1757d7caddd11b4bf7b52e7f30dc165f6a /config
parentf96dcf550c76e29a6fe4d6677563078ed8e2200d (diff)
parentb6403a91781ab071f9efce4657cee81472afb66b (diff)
Merge branch 'development' into qs_overview_fix_v2
Diffstat (limited to 'config')
-rwxr-xr-xconfig/hypr/scripts/MediaCtrl.sh65
1 files changed, 33 insertions, 32 deletions
diff --git a/config/hypr/scripts/MediaCtrl.sh b/config/hypr/scripts/MediaCtrl.sh
index 2cbeccf3..000c3ade 100755
--- a/config/hypr/scripts/MediaCtrl.sh
+++ b/config/hypr/scripts/MediaCtrl.sh
@@ -6,56 +6,57 @@ music_icon="$HOME/.config/swaync/icons/music.png"
# Play the next track
play_next() {
- playerctl next
- show_music_notification
+ playerctl next
+ show_music_notification
}
# Play the previous track
play_previous() {
- playerctl previous
- show_music_notification
+ playerctl previous
+ show_music_notification
}
# Toggle play/pause
toggle_play_pause() {
- playerctl play-pause
- show_music_notification
+ playerctl play-pause
+ sleep 0.1
+ show_music_notification
}
# Stop playback
stop_playback() {
- playerctl stop
- notify-send -e -u low -i $music_icon " Playback:" " Stopped"
+ playerctl stop
+ notify-send -e -u low -i $music_icon " Playback:" " Stopped"
}
# Display notification with song information
show_music_notification() {
- status=$(playerctl status)
- if [[ "$status" == "Playing" ]]; then
- song_title=$(playerctl metadata title)
- song_artist=$(playerctl metadata artist)
- notify-send -e -u low -i $music_icon "Now Playing:" "$song_title by $song_artist"
- elif [[ "$status" == "Paused" ]]; then
- notify-send -e -u low -i $music_icon " Playback:" " Paused"
- fi
+ status=$(playerctl status)
+ if [[ "$status" == "Playing" ]]; then
+ song_title=$(playerctl metadata title)
+ song_artist=$(playerctl metadata artist)
+ notify-send -e -u low -i $music_icon "Now Playing:" "$song_title by $song_artist"
+ elif [[ "$status" == "Paused" ]]; then
+ notify-send -e -u low -i $music_icon " Playback:" " Paused"
+ fi
}
# Get media control action from command line argument
case "$1" in
- "--nxt")
- play_next
- ;;
- "--prv")
- play_previous
- ;;
- "--pause")
- toggle_play_pause
- ;;
- "--stop")
- stop_playback
- ;;
- *)
- echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
- exit 1
- ;;
+"--nxt")
+ play_next
+ ;;
+"--prv")
+ play_previous
+ ;;
+"--pause")
+ toggle_play_pause
+ ;;
+"--stop")
+ stop_playback
+ ;;
+*)
+ echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
+ exit 1
+ ;;
esac
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage