Skip to content

Instantly share code, notes, and snippets.

View Dema's full-sized avatar

Dmitry Olyenyov Dema

View GitHub Profile
@miyl
miyl / pipewire-out-default-switch.sh
Last active May 22, 2024 15:23
Pipewire default sink (output) switching (Pulseaudio pactl)
#! /usr/bin/env sh
# This script switches between whatever sinks exist.
# Removing pulseaudio (but not libpulse) means removing pacmd, so this is an attempt at switching the default via pactl instead.
# Sinks can be specified by name or index. Index changes sometimes when you disconnect and reconnect, restart or whatever, so names are better as they are persistent.
# Annoyingly the command used to switch audio over to a new sink cannot take a name as its argument, otherwise I'd only need the name here.
# TODO: Trigger a zenity or dmenu dialog with entr that asks whether to switch monitor and/or sound to hdmi? Could do
# the same for mounting.
@puffnfresh
puffnfresh / nix-example.sh
Last active February 22, 2023 04:22
Using Nix from AUR on Arch Linux
#!/bin/sh
## Or use an AUR helper, e.g.
## sudo aura -A nix
sudo pacman -S base-devel git
git clone https://aur.archlinux.org/nix.git
cd nix
makepkg -s
sudo pacman -U nix-*.pkg.tar.xz