1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-05 05:01:43 +00:00
dotfiles/scripts/.bin/volume-bluetooth.sh
J. Fernando Sánchez ea78b16bd9 Multiple changes
2018-09-12 19:04:59 +02:00

18 lines
774 B
Bash
Executable File

#!/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