Skip to content

Instantly share code, notes, and snippets.

@parkerlreed
Created May 16, 2017 16:00
Show Gist options
  • Save parkerlreed/1a5e181fa7ed48200b5e426cf31d8c36 to your computer and use it in GitHub Desktop.
Save parkerlreed/1a5e181fa7ed48200b5e426cf31d8c36 to your computer and use it in GitHub Desktop.
#!/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