Last active
March 2, 2019 05:26
-
-
Save bdavidhicks/cb0d6b74ad3296cfae501d15bd9991db to your computer and use it in GitHub Desktop.
systemd service configuration for user service to run on startup to unmute sound when Spotify notification occurs (i.e. when a song plays)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| interface=org.freedesktop.Notifications | |
| member=Notify | |
| dbus-monitor --profile "interface='$interface',member='$member',arg0='Spotify'" | | |
| while read -r line; do | |
| amixer -q -D pulse sset Master unmute; | |
| done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| After=network.target | |
| [Service] | |
| ExecStart=/home/bhix/spotify_unmuter.sh | |
| [Install] | |
| WantedBy=default.target |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spotify_unmuter.shin your home directory, i.e./home/bhix~/.config/systemd/user/unmuter.servicein the~/.config/systemd/user/directoryunmuter.serviceand change the path forExecStart=to be the full path of your home directory, i.e./home/YOUR_USER/spotify_unmuter.shsudo chmod 744 ~/spotify_unmuter.shto make it executablesudo chmod 664 ~/.config/systemd/user/unmuter.serviceto make it readable/writeablesystemctl start --user unmuter.serviceto start the service.systemctl enable --user unmuter.serviceto enable it to start when the sytem starts.systemctl --user status unmuter.service