Skip to content

Instantly share code, notes, and snippets.

@ema
Created November 30, 2016 10:58
Show Gist options
  • Save ema/04c18cfdb1e606a659d208fb898ab423 to your computer and use it in GitHub Desktop.
Save ema/04c18cfdb1e606a659d208fb898ab423 to your computer and use it in GitHub Desktop.
root@orion:/etc/acpi# cat /etc/acpi/events/fucking-headphones-plugged-in
# Fucking headphones man
event=jack/headphone HEADPHONE plug
action=/etc/acpi/fucking-headphones-plugged-in.sh
root@orion:/etc/acpi# cat /etc/acpi/fucking-headphones-plugged-in.sh
#!/bin/sh
# 2 is not pulled out of my ass. See `pactl list short sinks`.
su ema -c 'pactl list short sink-inputs | while read x y ; do pactl move-sink-input $x 2; done'
@hashar
Copy link

hashar commented Nov 30, 2016

That is absolutely awesome. I wasn't aware of the ACPI events scripts, looks like it would do exactly what I need. Kudos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment