Created
May 16, 2017 16:00
-
-
Save parkerlreed/1a5e181fa7ed48200b5e426cf31d8c36 to your computer and use it in GitHub Desktop.
This file contains 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 | |
currentvol=`dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/hci0/dev_94_01_C2_4B_58_9D/fd2 org.freedesktop.DBus.Properties.Get string:org.bluez.MediaTransport1 string:Volume | cut -d" " -f 12` | |
increment() { | |
newvol=$(($currentvol + 5)) | |
dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/hci0/dev_94_01_C2_4B_58_9D/fd2 org.freedesktop.DBus.Properties.Set string:org.bluez.MediaTransport1 string:Volume variant:uint16:$newvol | |
} | |
decrement() { | |
newvol=$(($currentvol - 5)) | |
dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/hci0/dev_94_01_C2_4B_58_9D/fd2 org.freedesktop.DBus.Properties.Set string:org.bluez.MediaTransport1 string:Volume variant:uint16:$newvol | |
} | |
$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment