mirror of
				https://github.com/WarrenHood/dotfiles.git
				synced 2025-11-04 15:38:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			38 lines
		
	
	
		
			623 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			623 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
set -euo pipefail
 | 
						|
 | 
						|
case "${1:-}" in
 | 
						|
  next)
 | 
						|
    MEMBER=Next
 | 
						|
    ;;
 | 
						|
 | 
						|
  previous)
 | 
						|
    MEMBER=Previous
 | 
						|
    ;;
 | 
						|
 | 
						|
  play)
 | 
						|
    MEMBER=Play
 | 
						|
    ;;
 | 
						|
 | 
						|
  pause)
 | 
						|
    MEMBER=Pause
 | 
						|
    ;;
 | 
						|
 | 
						|
  play-pause)
 | 
						|
    MEMBER=PlayPause
 | 
						|
    ;;
 | 
						|
 | 
						|
  *)
 | 
						|
    echo "Usage: $0 next|previous|play|pause|play-pause"
 | 
						|
    exit 1
 | 
						|
    ;;
 | 
						|
 | 
						|
esac
 | 
						|
 | 
						|
exec dbus-send                                                \
 | 
						|
  --print-reply                                               \
 | 
						|
  --dest="org.mpris.MediaPlayer2.$(playerctl -l | head -n 1)" \
 | 
						|
  /org/mpris/MediaPlayer2                                     \
 | 
						|
  "org.mpris.MediaPlayer2.Player.$MEMBER"
 |