Skip to content

Instantly share code, notes, and snippets.

@altercation
Created January 21, 2013 01:29

Revisions

  1. altercation created this gist Jan 21, 2013.
    10 changes: 10 additions & 0 deletions handler.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    case $* in
    ac_adapter*) power auto ;; # unplug or plug ac cord
    *LID*close) system sleep ;; # shut laptop lid
    *TBLT*on*) displays tablet on ;; # rotate to tablet mode
    *TBLT*off*) displays tablet off ;; # rotate to laptop mode
    *0000500c) trigger Print ;; # undock tablet pen
    *0000500b) trigger shift+Print ;; # dock tablet pen
    esac