Skip to content

Instantly share code, notes, and snippets.

@phedders
phedders / a_enable_wireless.sh
Created August 10, 2023 17:47 — forked from telenieko/a_enable_wireless.sh
Sample files to enable wireless on Debian initramfs
#!/bin/sh
# this goes into /etc/initramfs-tools/scripts/init-premount/a_enable_wireless
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
@phedders
phedders / pipewire-in-default-switch.sh
Created November 25, 2021 00:02 — forked from miyl/pipewire-in-default-switch.sh
Pipewire default source (input) switching (Pulseaudio pactl)
#!/usr/bin/env sh
# Removing pulseaudio means removing pacmd, so this is an attempt at switching the default via pactl instead.
# It successfully sets the default - but I'm unsure whether programs still respect that default or not.
# Cycles through all sources and sets whatever is the next one as the default.
# Pass -g to just print the current default source
CUR_DEFAULT="$(pactl info | grep 'Default Source' | cut -d':' -f 2)"
SOURCES="$(pactl list short sources | cut -d' ' -f 2)"
@phedders
phedders / pipewire-out-default-switch.sh
Created November 25, 2021 00:02 — forked from miyl/pipewire-out-default-switch.sh
Pipewire default sink (output) switching (Pulseaudio pactl)
#! /usr/bin/env sh
# Removing pulseaudio means removing pacmd, so this is an attempt at switching the default via pactl instead.
# It successfully sets the default - BUT it appears my programs don't go to that default for some reason?
# Unlike the other scripts where sinks are specified, this just switches between whatever sinks exist.
# Sinks can be specified by name or index. Index changes sometimes when you disconnect and reconnect, restart or whatever, so names are better.
# 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
@phedders
phedders / config.yml
Created August 16, 2017 22:33 — forked from Admicos/config.yml
Join Python receiver thingy
port: 1818
commands:
# Join Push Text : Command to run
"eg=:=shutdown": "systemctl poweroff"
@phedders
phedders / gist:1080013
Created July 13, 2011 09:53 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET