Skip to content

Instantly share code, notes, and snippets.

@flops
Created December 23, 2017 08:23
Show Gist options
  • Save flops/0245c74ad0a737e749e8c4495b753515 to your computer and use it in GitHub Desktop.
Save flops/0245c74ad0a737e749e8c4495b753515 to your computer and use it in GitHub Desktop.

Revisions

  1. flops created this gist Dec 23, 2017.
    25 changes: 25 additions & 0 deletions handler.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/bin/bash
    # Default acpi script that takes an entry for all actions

    case "$1" in
    jack/headphone)
    case "$2" in
    HEADPHONE)
    case "$3" in
    plug)
    amixer -c 0 set Headphone on 81
    amixer -c 0 set Speaker off 0
    amixer -c 0 set Master on
    ;;
    unplug)
    amixer -c 0 set Speaker on 81
    amixer -c 0 set Headphone off 0
    amixer -c 0 set Master on
    ;;
    esac
    ;;
    esac
    ;;
    esac

    # vim:set ts=4 sw=4 ft=sh et: