#!/usr/bin/ruby def cmd(c) puts(c) res =`#{c}` puts res return res end def getIDs(dev) id = cmd("xinput").split("\n").select{|l| l=~/#{dev}/}[0].scan(/id=(\d+)/)[0][0] puts "Id (#{dev}) = #{id}" propId = cmd("xinput list-props #{id}").split("\n").select{|l| l=~/Wacom Tablet Area/}[0].scan(/\((\d+)\):/)[0][0] puts "PropID = #{propId}" return id,propId end if ARGV[0]!="-u" id,propId = getIDs("Pen stylus") cmd("xinput set-int-prop #{id} #{propId} 32 0 0 58752 16524") id,propId = getIDs("Finger touch") cmd("xinput set-int-prop #{id} #{propId} 32 0 0 23504 6608") else id,propId = getIDs("Pen stylus") cmd("xinput set-int-prop #{id} #{propId} 32 0 0 29376 16524") id,propId = getIDs("Finger touch") cmd("xinput set-int-prop #{id} #{propId} 32 0 0 11752 6608") end