Skip to content

Instantly share code, notes, and snippets.

@tmonjalo
tmonjalo / bt-profile.sh
Last active October 3, 2021 12:16
bluetooth audio profile with PulseAudio
View bt-profile.sh
#! /bin/sh -e
# argument can be:
# - list
# - next (default)
# - any text matching a profile name or description
arg=${1:-next}
infos=$(pactl list cards | sed -n '/bluez/,/^Card/p')
if [ -z "$infos" ] ; then
@tmonjalo
tmonjalo / disable-wireless-when-wired.sh
Last active September 21, 2018 12:46
Toggle wifi status on ethernet event with Linux NetworkManager
View disable-wireless-when-wired.sh
#! /bin/sh
# path should be /etc/NetworkManager/dispatcher.d/99-disable-wireless-when-wired
self=${0##*/}
log() { logger -p user.info -t "${self}[$$]" "$*" ;}
iface=$1
action=$2
case $iface in eth*|usb*|en*)
@tmonjalo
tmonjalo / list-fftabs.py
Created September 13, 2018 10:42
List all Firefox tabs with title and URL
View list-fftabs.py
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""