Skip to content

Instantly share code, notes, and snippets.

@orumin
Created February 2, 2014 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orumin/8763763 to your computer and use it in GitHub Desktop.
Save orumin/8763763 to your computer and use it in GitHub Desktop.
support rotate patch for SLiM DisplayManeger
diff -Nur slim-1.3.6.orig/cfg.cpp slim-1.3.6/cfg.cpp
--- slim-1.3.6.orig/cfg.cpp 2014-02-02 15:13:01.434729372 +0900
+++ slim-1.3.6/cfg.cpp 2014-02-02 15:11:59.447111335 +0900
@@ -32,6 +32,7 @@
options.insert(option("default_path","/bin:/usr/bin:/usr/local/bin"));
options.insert(option("default_xserver","/usr/bin/X"));
options.insert(option("xserver_arguments",""));
+ options.insert(option("xrotate",""));
options.insert(option("numlock",""));
options.insert(option("daemon",""));
options.insert(option("xauth_path","/usr/bin/xauth"));
diff -Nur slim-1.3.6.orig/panel.cpp slim-1.3.6/panel.cpp
--- slim-1.3.6.orig/panel.cpp 2014-02-02 15:13:01.430729332 +0900
+++ slim-1.3.6/panel.cpp 2014-02-02 15:13:25.661970887 +0900
@@ -18,12 +18,26 @@
Panel::Panel(Display* dpy, int scr, Window root, Cfg* config,
const string& themedir, PanelType panel_mode) {
+ XRRScreenConfiguration *sc;
+ SizeID size_index;
+ Rotation rotation;
/* Set display */
Dpy = dpy;
Scr = scr;
Root = root;
cfg = config;
mode = panel_mode;
+ sc = XRRGetScreenInfo( Dpy, Root );
+ size_index = XRRConfigCurrentConfiguration( sc, &rotation );
+
+ if (cfg->getOption("xrotate") == "")
+ XRRSetScreenConfig( Dpy, sc, Root, size_index, rotation, CurrentTime );
+ else if (cfg->getOption("xrotate") == "90")
+ XRRSetScreenConfig( Dpy, sc, Root, size_index, RR_Rotate_90, CurrentTime );
+ else if (cfg->getOption("xrotate") == "180")
+ XRRSetScreenConfig( Dpy, sc, Root, size_index, RR_Rotate_180, CurrentTime );
+ else if (cfg->getOption("xrotate") == "270")
+ XRRSetScreenConfig( Dpy, sc, Root, size_index, RR_Rotate_270, CurrentTime );
session_name = "";
session_exec = "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment