1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-05 13:11:43 +00:00
dotfiles/scripts/.bin/volume-bluetooth.sh

18 lines
774 B
Bash
Raw Normal View History

2018-09-12 17:04:59 +00:00
#!/bin/bash
DEV="hci0/dev_00_A0_C6_95_DE_E8"
currentvol=`dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/$DEV/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/$DEV/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/$DEV/fd2 org.freedesktop.DBus.Properties.Set string:org.bluez.MediaTransport1 string:Volume variant:uint16:$newvol
}
$1