Skip to content

Instantly share code, notes, and snippets.

@mweinelt
Created April 7, 2012 20:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mweinelt/2331837 to your computer and use it in GitHub Desktop.
Save mweinelt/2331837 to your computer and use it in GitHub Desktop.
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