Vlastný vyhľadávací nástroj
 

Wacom tablet layout script

6 days and 3.97 hours since someone reset this sign. Record is 21 days and 18.88 hours.
p5070040

p5070040

Date: 05/07/2006

Zaujímavé linky:
KSP
FMFI UK
GJH

------BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+: a-- C++ UL+++ P+ L++ E--- W++ N? o? K? w-- O? M? V? PS+ PE+(-) Y+ PGP+ t>+ 5++ X+ R+ tv-- b+ DI+ D G++ e>+++ h-- r++ y?
------END GEEK CODE BLOCK------

This script maximizes active area of Wacom tablet with respect to proper ratio. It also rotates your tablet, if necessary.

  1. #!/bin/bash
  2. #
  3. # This program is under GPLv3 license --
  4. # http://www.gnu.org/licenses/gpl-3.0.html
  5. #
  6. # If you think, that this script is usefull, please send me a postcard to
  7. # adress:
  8. # Michal Nanasi
  9. # Azalkova 1
  10. # 82101 Bratislava
  11. # Slovakia
  12.  
  13. resolutionW=`xrandr  |grep current | sed -e 's/.*current \([0-9]*\) x \([0-9]*\),.*$/\1/'`
  14. resolutionH=`xrandr  |grep current | sed -e 's/.*current \([0-9]*\) x \([0-9]*\),.*$/\2/'`
  15.  
  16. export IFS=$' ';
  17. wacomdev=`xidump -l |grep Wacom |sed -e 's/[ ]*extension.*$//' | sort`
  18. firstDev=`echo $wacomdev | head -n 1`
  19. export IFS=$'\n'
  20. xsetwacom set "$firstDev" xyDefault
  21.  
  22. wacomW=`xsetwacom get "Wacom BambooFun 6x8" BottomX`
  23. wacomH=`xsetwacom get "Wacom BambooFun 6x8" BottomY`
  24.  
  25.  
  26. if  (($resolutionW*$wacomH<$resolutionH*$wacomW))  ; then
  27.         normalWidth=$(($resolutionW*$wacomH/$resolutionH))
  28.         normalHeight=$wacomH
  29.  
  30. else
  31.         normalWidth=$wacomW
  32.         normalHeight=$(($resolutionH*$wacomW/$resolutionW))
  33. fi
  34.  
  35. if  (($resolutionW*$wacomW<$resolutionH*$wacomH))  ; then
  36.         rotateHeight=$(($resolutionW*$wacomW/$resolutionH))
  37.         rotateWidth=$wacomW
  38. else
  39.         rotateHeight=$wacomH
  40.         rotateWidth=$(($resolutionH*$wacomH/$resolutionW))
  41. fi
  42.  
  43. if (($normalWidth*$normalHeight > $rotateWidth*$rotateHeight)) ;  then
  44.         for dev in $wacomdev; do
  45.                 xsetwacom set "$dev" BottomX $normalWidth
  46.                 xsetwacom set "$dev" BottomY $normalHeight
  47.                 xsetwacom set "$dev" Rotate NONE
  48.                 notify-send 'Tablet is NOT rotated'
  49.         done
  50. else
  51.         for dev in $wacomdev; do
  52.                 xsetwacom set "$dev" BottomX $rotateWidth
  53.                 xsetwacom set "$dev" BottomY $rotateHeight
  54.                 xsetwacom set "$dev" Rotate CW
  55.                 notify-send 'Tablet is rotated'
  56.         done
  57. fi
Dátum poslednej zmeny: 01 február, 2010, 17:53 CET
Created by Mic ( mic(at)ksp(dot)sk, ICQ: 281832795, jabber: mic47@jabber.sk) Tato stranka vyzera najlepsie na mojom monitore:-) A v prehliadacoch Chromium, Firefox, Opera, Epiphany. Odporúčaná šírka monitora je aspoň 1280 pixelov. Pri menších šírkach sa nemusia niektoré fotky v galérii zobraziť korektne. Použitý software: PmWiki, Gallery 2.