Skip to content

Instantly share code, notes, and snippets.

@kenanpelit
kenanpelit / toggle_headset.sh
Created September 28, 2023 09:20 — forked from crigertg/toggle_headset.sh
Use this script to automatically connect to a bluetooth headset and switch audio profiles.
#!/bin/bash
# Use this script to automatically connect to a bluetooth headset and switch audio profiles.
# By default the script toggles the headset connection on/off and selects the handsfree profile
# when a connection is established.
# There is the possibility to switch to the ALT_MODE which ensures a connection and
# when executed again it switches between the a2dp profile for music and handsfree for using the microphone.
# The MAC address of your Bluetooth headset
# Use `bluetoothctl devices` to list your devices
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh"
_DB_PASSWORD="aig2Chie"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
#!/usr/bin/ruby
# Filename: pulse-switch-out
# Author: David Ljung Madison <DaveSource.com>
# See License: http://MarginalHacks.com/License/
# Description: Switch pulse audio output (sink) using pacmd
PACMD = %w(pacmd)
##################################################
# Usage
[GENERAL]
# Enable or disable the script execution
Enabled: True
# SYSFS path for checking if the system is running on AC power
Sysfs_Power_Path: /sys/class/power_supply/AC*/online
## Settings to apply while connected to Battery power
[BATTERY]
# Update the registers every this many seconds
Update_Rate_s: 30