Skip to content

Instantly share code, notes, and snippets.

@DamirSvrtan
Created November 16, 2013 15:05
Show Gist options
  • Save DamirSvrtan/7501111 to your computer and use it in GitHub Desktop.
Save DamirSvrtan/7501111 to your computer and use it in GitHub Desktop.
Short script so my linux mint 15 laptop can automatically connect to my creative D80 bluetooth speakers via bluez-tools (sudo apt-get install bluez-tools).
BLUETOOTH_MAC_ADDRESS = "00:02:02:33:B1:87"
SINK_NAME = "bluez_sink.00_02_02_33_B1_87"
def connect
`bt-audio -c #{BLUETOOTH_MAC_ADDRESS}`
end
def disconnect
`bt-audio -d #{BLUETOOTH_MAC_ADDRESS}`
end
def decrease_volume
`pacmd set-sink-volume #{SINK_NAME} 0x6000`
end
def get_sink_list
`pactl list short sinks`
end
def get_input_list
`pactl list short sink-inputs`
end
def set_creative_as_sink
connect
decrease_volume
end
set_creative_as_sink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment