diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-01-30 10:37:39 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-01-30 10:47:55 +0100 |
commit | eeb9231009f9e121fc59c7f4ff8aa474fcda5079 (patch) | |
tree | 87bf3a1db94f423d952465ffc0603ce4ab3264d1 | |
parent | 1a5d3e9c171bdfdc7279885a13e6c0c7ae7b1c99 (diff) | |
download | nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar.gz nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar.bz2 nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar.lz nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar.xz nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.tar.zst nixlib-eeb9231009f9e121fc59c7f4ff8aa474fcda5079.zip |
slim: Sort sessions
This ensures that xfce and most others DMs are preferred over xterm. Previously slim used directory order, which is undefined. Of course, it's just lucky that xfce < xterm lexicographically, but that also applies to the other display managers, AFAIK. We should have a way to specify a DM order, but that can be accomodated by generating desktop entries like "<NN>-session.desktop". Fixes #4300. Parenthetical to #12516.
-rw-r--r-- | pkgs/applications/display-managers/slim/default.nix | 6 | ||||
-rw-r--r-- | pkgs/applications/display-managers/slim/sort-sessions.patch | 40 |
2 files changed, 45 insertions, 1 deletions
diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix index 42d2c777aea2..8020ecb12a55 100644 --- a/pkgs/applications/display-managers/slim/default.nix +++ b/pkgs/applications/display-managers/slim/default.nix @@ -18,13 +18,17 @@ stdenv.mkDerivation rec { # slim's broken PAM session handling (see # http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663). ./run-once.patch + + # Ensure that sessions appear in sort order, rather than in + # directory order. + ./sort-sessions.patch ]; preConfigure = "substituteInPlace CMakeLists.txt --replace /lib $out/lib"; cmakeFlags = [ "-DUSE_PAM=1" ]; - NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype"; + NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype -std=c++11"; enableParallelBuilding = true; diff --git a/pkgs/applications/display-managers/slim/sort-sessions.patch b/pkgs/applications/display-managers/slim/sort-sessions.patch new file mode 100644 index 000000000000..cab5610f44fb --- /dev/null +++ b/pkgs/applications/display-managers/slim/sort-sessions.patch @@ -0,0 +1,40 @@ +diff -ru -x '*~' slim-1.3.6-orig/cfg.cpp slim-1.3.6/cfg.cpp +--- slim-1.3.6-orig/cfg.cpp 2013-10-02 00:38:05.000000000 +0200 ++++ slim-1.3.6/cfg.cpp 2016-01-30 10:35:51.108766802 +0100 +@@ -14,6 +14,7 @@ + #include <iostream> + #include <unistd.h> + #include <stdlib.h> ++#include <algorithm> + + #include <sys/types.h> + #include <sys/stat.h> +@@ -293,6 +294,8 @@ + + sessions.clear(); + ++ typedef pair<string,string> session_t; ++ + if( !strSessionDir.empty() ) { + DIR *pDir = opendir(strSessionDir.c_str()); + +@@ -325,7 +328,7 @@ + } + } + desktop_file.close(); +- pair<string,string> session(session_name,session_exec); ++ session_t session(session_name,session_exec); + sessions.push_back(session); + cout << session_exec << " - " << session_name << endl; + } +@@ -341,6 +344,10 @@ + pair<string,string> session("",""); + sessions.push_back(session); + } ++ ++ std::sort(sessions.begin(), sessions.end(), [](session_t& a, session_t& b) -> bool{ ++ return a.first < b.first; ++ }); + } + + pair<string,string> Cfg::nextSession() { |