Ubuntu Pastebin

Paste from sakrecoer at Mon, 30 May 2016 23:33:07 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
~$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ USB Optical Mouse                       	id=8	[slave  pointer  (2)]
⎜   ↳ NOVATEK USB Keyboard                    	id=10	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire Pen stylus               	id=11	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire Pen eraser               	id=12	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire Pen cursor               	id=13	[slave  pointer  (2)]


-----------------------------------------


#autumna
#2013
#feel free to use it or adopt it to your needs


mydevice="Wacom Graphire Pen"
pad="$mydevice pad"
cursor="$mydevice cursor"
stylus="$mydevice stylus"
eraser="$mydevice eraser"

toggle1=$HOME/.wacomscreen.1
toggle2=$HOME/.wacomscreen.2


usage ()
{
  echo "Wacom Setup script of doom - usage"
  echo "setup:Graphire screen:Nvidia binary drivers,dualscreen"
  echo ""
  echo "--screen [0,1,2]: screen mode, toggle or"
  echo " 0: both screens, 1: DELL, 2:LG Electronics"
  echo ""
  echo "--key [profile]: set up leds and buttons"
  
}

button ()
{
echo xsetwacom --set '$pad' button $1 \"$2\"
}

screensetter ()
{
echo xsetwacom --set '$stylus' MapToOutput $1 
}

screen()
{

  #how coordinates works - see link below for screen rotation cases
  #http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Dual_and_Multi-Monitor_Set_Up
  #
  #| width     0      x-offset|      
  #|   0     height   y-offset|       all sizes in percentage to total width/height
  #|   0       0         1    |
  #
  # examples:
  #     all    |    top       bottom    |
  # |1  0  0|  | |1  0  0|  |1  0   0 | |
  # |0  1  0|  | |0 0.5 0|  |0 0.5 0.5| |
  # |0  0  1|  | |0  0  1|  |0  0   1 | |

  #both screens - remove all indicators
  if test "$1" == "0"; then
   if test -e $toggle1; then rm $toggle1; fi
   if test -e $toggle2; then rm $toggle2; fi
   echo "xinput set-prop \"$stylus\" --type=float \"Coordinate Transformation Matrix\" 1 0 0 0 1 0 0 0 1"  
   echo "xinput set-prop \"$eraser\" --type=float \"Coordinate Transformation Matrix\" 1 0 0 0 1 0 0 0 1"
  elif test "$1" == "1"; then
   touch $toggle1
   if test -e $toggle2; then rm $toggle2; fi
   echo "xinput set-prop \"$stylus\" --type=float \"Coordinate Transformation Matrix\" 0.333333 0 0.666666 0 1 0 0 0 1"  
   echo "xinput set-prop \"$eraser\" --type=float \"Coordinate Transformation Matrix\" 0.333333 0 0.666666 0 1 0 0 0 1"
  elif test "$1" == "2"; then
   if test -e $toggle1; then rm $toggle1; fi
   touch $toggle2
   echo "xinput set-prop \"$stylus\" --type=float \"Coordinate Transformation Matrix\" 0.666666 0 0 0 1 0 0 0 1"  
   echo "xinput set-prop \"$eraser\" --type=float \"Coordinate Transformation Matrix\" 0.666666 0 0 0 1 0 0 0 1"
  else
   echo "wrong argument for -screen: $1"
   usage
  fi
  exit
} 

#first
#device list



#script for setting up Wacom buttons and abilities
#for intuos4 6x9 pad

#------------------
# pad
#------------------

echo $mydevice
echo "xsetwacom --get '$pad' button 1"

#set the top buttons. 
button 2 "key b"
button 3 "key c"
button 8 "key d"
button 9 "key e"

#wheel
button 1 "key a"

#set the bottom buttons
button 10 "key f"
button 11 "key g"
button 12 "key h"
button 13 "key i"

#check for screen
if test "$1" == "--screen"
 then
 if test ! -e $2  
 then 
  screen "$2"
 else
  #no arguments, toggle then exit
  if test -e $toggle1; then screen "2" #switch 1->2
  elif test -e $toggle2; then screen "0" #switch 2->0
  else screen "1"  #switch 0->1
  fi
 fi

#check for key
elif test "$1" == "--key"
 then
 echo "key!"

else
 echo "wrong argument!"
fi

#if it gets this far either the options were blank or wrong input
usage
Download as text