Created
April 7, 2012 20:15
-
-
Save mweinelt/2331837 to your computer and use it in GitHub Desktop.
Extend gnome-shell-extensions/xrandr-indicator with xsetwacom support
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 characters
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