Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extend gnome-shell-extensions/xrandr-indicator with xsetwacom support
diff --git a/extensions/xrandr-indicator/extension.js b/extensions/xrandr-indicator/extension.js
index 0a41ce7..0641fa9 100644
--- a/extensions/xrandr-indicator/extension.js
+++ b/extensions/xrandr-indicator/extension.js
@@ -33,6 +33,9 @@ let rotations = [ [ GnomeDesktop.RRRotation.ROTATION_0, N_("Normal") ],
[ GnomeDesktop.RRRotation.ROTATION_180, N_("Upside-down") ]
];
+let wacom_rotations = [ "none", "ccw", "cw","half" ];
+let wacom_devices = [ 14, 15, 16 ];
+
const XRandr2Iface = {
name: 'org.gnome.SettingsDaemon.XRANDR_2',
methods: [
@@ -104,6 +107,11 @@ Indicator.prototype = {
config.save();
output.set_rotation(bitmask);
+
+ // wacom support
+ for (let w = 0; w < wacom_devices.length; w++)
+ GLib.spawn_command_line_async('xsetwacom set ' + wacom_devices[w] + ' rotate ' + wacom_rotations[bitmask-1]);
+
try {
config.save();
this._proxy.ApplyConfigurationRemote(0, event.get_time());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.