Skip to content

Instantly share code, notes, and snippets.

@tmonjalo
tmonjalo / list-fftabs.py
Created September 13, 2018 10:42
List all Firefox tabs with title and URL
#! /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
"""
@tmonjalo
tmonjalo / auto-wireless.sh
Last active December 11, 2023 11:08
Toggle wifi status on ethernet event with Linux NetworkManager
#! /bin/sh
# path should be /etc/NetworkManager/dispatcher.d/99-auto-wireless
self=${0##*/}
log() { logger -p user.info -t "${self}[$$]" "$*" ;}
iface=$1
action=$2
case $iface in eth*|usb*|en*)
@tmonjalo
tmonjalo / bt-profile.sh
Last active November 19, 2023 23:23
bluetooth audio profile with PulseAudio
#! /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