Skip to content

Instantly share code, notes, and snippets.

@acarapetis
Created March 7, 2010 09:28
Show Gist options
  • Save acarapetis/324269 to your computer and use it in GitHub Desktop.
Save acarapetis/324269 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
WACOM_DEVICE_IDS = [12, 13]
ROTATIONS = %w{ NONE CCW HALF CW };
RANDR_VALUES = {
'NONE' => 'normal',
'CCW' => 'left',
'HALF' => 'inverted',
'CW' => 'right',
}
o = ARGV.shift
fail "Must specify one of #{ROTATIONS.join ','}" unless RANDR_VALUES.has_key? o
WACOM_DEVICE_IDS.each do |i|
system "xsetwacom --set #{i} Rotate #{o}"
end
v = RANDR_VALUES[o]
system "xrandr -o #{v}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment