Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created October 27, 2021 19:23
Show Gist options
  • Save AndrewWCarson/dc655b25e1f598329a4af987c9a45763 to your computer and use it in GitHub Desktop.
Save AndrewWCarson/dc655b25e1f598329a4af987c9a45763 to your computer and use it in GitHub Desktop.
A "best effort" uninstall of Wacom Tablet drivers and files.
#!/bin/zsh
# Wacom Files
declare -a systemFiles=('/Applications/Wacom Tablet'
'/Library/Application Support/Tablet'
'/Library/Frameworks/WacomMultiTouch.framework'
'/Library/Internet Plugins/WacomTabletPlugin.plugin'
'/Library/Launch Agents/com.wacom.wacomtablet.plist'
'/Library/LaunchDaemons/com.wacom.displayhelper.plist'
'/Library/LaunchDaemons/com.wacom.RemoveTabletHelper.plist'
'/Library/LaunchDaemons/com.wacom.UpdateHelper.plist'
'/Library/LaunchDaemons/com.wacom.TabletHelper.plist'
'/Library/PreferencePanes/WacomTablet.prefpane'
'/Library/Preferences/Tablet'
'/Library/PriveledgedHelperTools/com.wacom.RemoveTabletHelper'
'/Library/PriveledgedHelperTools/com.wacom.TabletHelper')
declare -a userFiles=('Library/Preferences/com.wacom.ProfessionalTablet.plist'
'Library/Preferences/com.wacom.wacomtablet.prefs'
'Library/Preferences/com.wacom.wacomtouch.prefs')
# This is a command-line uninstall using the built-in Wacom binary.
if [ -e '/Applications/Wacom Tablet.localized/Wacom Tablet Utility.app/Contents/MacOS/Wacom Tablet Utility' ]; then
echo "Running Wacom built-in uninstaller..."
'/Applications/Wacom Tablet.localized/Wacom Tablet Utility.app/Contents/MacOS/Wacom Tablet Utility' --uninstall
fi
# Attempt to remove all additional system files.
for file in "${systemFiles[@]}"
do
if [ -e "$file" ]; then
echo "Removing: $file"
rm -rf "$file"
fi
done
# Attempt to remove all additional user files.
for file in "${userFiles[@]}"
do
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//')
if [ -e "$userHome/$file" ]; then
echo "Removing: $userHome/$file"
rm -rf "$userHome/$file"
fi
done
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment