Skip to content

Instantly share code, notes, and snippets.

View schnipseljagd's full-sized avatar

Joscha Meyer schnipseljagd

  • superluminar GmbH
  • Granada
View GitHub Profile
@natenho
natenho / bt-profile-switch.sh
Last active July 22, 2022 08:11 — forked from OndraZizka/switchHeadphones.sh
Bluetooth headset - switch between quality sound + no mic (A2DP) and crappy sound and mic (HSP/HFP)
#!/bin/bash
CARD=$(pactl list | grep bluez_card | awk '{print $NF}')
BLUETOOTH_DEVICE=$(pacmd list-sinks | grep -o '<bluez_sink[^>]*' | cut -d\< -f2)
PROFILE_A2DP="a2dp_sink"
PROFILE_HEADSET_UNIT="headset_head_unit"
if [ "${1}" == "" -o "${1}" == "toggle" ] ; then
if $(pacmd list-sinks | grep -o "<bluez_sink\..*\.$PROFILE_A2DP>" &> /dev/null) ; then
@pesterhazy
pesterhazy / frpl.sh
Last active July 9, 2018 14:26
Fixed-string replace in multiple files. Change files in place
#!/usr/bin/env bash
set -euo pipefail
# Fixed-string replace in multiple files. Changes files in place
if [[ $# -lt 3 ]]; then
echo "Syntax: frpl <from-string> <to-string> <file1> [file2 file3 ....]"
exit 1
fi