-
Xubuntu Startup Delay vs. xsetwacom
Over the years, various
xsetwacomincantations have confined the tablet stylus to the left-hand landscape monitor on my desk. Updating to Xubuntu 18.04 once again changed the monitors names (fromHEAD-0back toDP-1), butxsetwacomstopped working.My
startup.shscript runs from Xubuntu’s “Application Autostart” list, so X is already running andxsetwacomshould do the right thing. Alas, even with$XAUTHORITYand$DISPLAYset correctly (automagically by X),xsetwacomstill didn’t corral the cursor.Some rummaging around the Intertubes suggested a delay would allow X to get up to speed and, indeed, sleeping for two seconds solved the problem:
logger "startup.sh - copying Xauthority values" whoami > /tmp/who cp /home/ed/.Xauthority /tmp/Xauthority.txt echo $XAUTHORITY > /tmp/XAUTHORITY.txt cp $XAUTHORITY /tmp/xauth.cp echo $DISPLAY > /tmp/DISPLAY.txt # xsetwacom needs an additional delay after $XAUTHORITY and $DISPLAY become correct logger "startup.sh - waiting aimlessly" sleep 2s logger "startup.sh - doing wacom setup" xsetwacom --verbose set "Wacom Graphire3 6x8 Pen stylus" MapToOutput "DP-1" xsetwacom --verbose set "Wacom Graphire3 6x8 Pen eraser" MapToOutput "DP-1"
Sheesh & similar remarks.
The complete Bash script as a GitHub Gist:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characterslogger "startup.sh – starting" logger "startup.sh – setting configurations" #setxkbmap -option terminate:ctrl_alt_bksp #pactl set-default-sink alsa_output.pci-0000_00_1b.0.hdmi-stereo amixer -D pulse sset Master 41% amixer -D pulse sset Master 1%- gsettings set org.gnome.Evince page-cache-size 500 # enable Kinesis volume and calculator keys #/home/ed/bin/Kinesis/kfreestyle2d /dev/hidraw6 & logger "startup.sh – starting applications" /usr/bin/thunar & /usr/bin/gimp & /usr/bin/chromium-browser & /usr/bin/digikam & /usr/bin/firefox & /usr/bin/thunderbird & /usr/bin/xfce4-terminal & logger "startup.sh – copying Xauthority values" # similar lines in .xprofile happen before X grabs the display whoami > /tmp/who cp /home/ed/.Xauthority /tmp/Xauthority.txt echo $XAUTHORITY > /tmp/XAUTHORITY.txt cp $XAUTHORITY /tmp/xauth.cp echo $DISPLAY > /tmp/DISPLAY.txt # xsetwacom needs an additional delay after $XAUTHORITY and $DISPLAY become correct logger "startup.sh – waiting aimlessly" sleep 2s logger "startup.sh – doing wacom setup" xsetwacom –verbose set "Wacom Graphire3 6×8 Pen stylus" MapToOutput "DP-1" #xsetwacom –verbose set "Wacom Graphire3 6×8 Pen stylus" MapToOutput "HEAD-0" xsetwacom –verbose set "Wacom Graphire3 6×8 Pen eraser" MapToOutput "DP-1" #xsetwacom –verbose set "Wacom Graphire3 6×8 Pen eraser" MapToOutput "HEAD-0" logger "startup.sh — done" The cruft in there reminds me of previous fixes / workarounds / haxx, so it’s not entirely wasted space.