This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |