Skip to content

Instantly share code, notes, and snippets.

View jthomaschewski's full-sized avatar

Janek Thomaschewski jthomaschewski

View GitHub Profile
@jthomaschewski
jthomaschewski / stream_sound_linux_to_windows_pipewire.md
Last active September 23, 2024 22:21 — forked from Fusl/gist:3a708b8c32c9d5264fa0
Streaming audio output from Linux (Pulseaudio/Pipewire) to Windows (ffmpeg 7)

Windows (receiver) side:

ffplay.exe -nodisp -acodec pcm_s16le -ar 48000 -flags low_delay -fflags nobuffer -framedrop -analyzeduration 0 -probesize 32 -max_delay 0 -f s16le -ch_layout '2 channels' -i udp://0.0.0.0:18181?listen=1

Linux (transmitter) side:

pactl load-module module-null-sink sink_name=remote

ectool raw 0x3E0C d1,d1,b4,b4,w76 # CAPS => ESC
# revert
ectool raw 0x3E0C d1,d1,b4,b4,w58 # CAPS => CAPS
### Keybase proof
I hereby claim:
* I am jthomaschewski on github.
* I am janek (https://keybase.io/janek) on keybase.
* I have a public key whose fingerprint is 8374 414F 9366 0571 8B19 72F0 03FD 6A82 57CD 72C2
To claim this, I am signing this object:
@jthomaschewski
jthomaschewski / detectDarkMode.js
Created September 22, 2019 14:03
Detect Browser Dark Mode in JS & CSS
// check if browser/os is set to dark mode
function prefersDark() {
return window.matchMedia('(prefers-color-scheme: dark)').matches
}
// listen for dark mode change in browser/os:
const queryDark = window.matchMedia('(prefers-color-scheme: dark)')
queryDark.addListener(mediaQuery => {
const prefersDark = mediaQuery.matches
if (prefersDark) {
@jthomaschewski
jthomaschewski / _directives.graphql
Created October 22, 2018 08:54
Lighthouse GraphQL Directives (WIP)
# Scalar directives
directive @scalar(class: String!) on SCALAR
# ENUM directives
directive @enum(value: ID!) on ENUM_VALUE
# Union directives
directive @union(resolver: String!) on UNION
@jthomaschewski
jthomaschewski / Makefile
Created April 3, 2018 19:19 — forked from t-8ch/Makefile
minimal mutter application with window management
CFLAGS=$(shell pkg-config --cflags libmutter-2) -Wl,-rpath,/usr/lib/mutter
LDLIBS=$(shell pkg-config --libs libmutter-2)
all: main