OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
6.6 KiB

  1. diff -ur slim-1.3.0.orig/app.cpp slim-1.3.0/app.cpp
  2. --- slim-1.3.0.orig/app.cpp 2007-07-15 15:09:28.000000000 +0100
  3. +++ slim-1.3.0/app.cpp 2007-08-27 15:49:20.000000000 +0100
  4. @@ -556,6 +556,14 @@
  5. string loginCommand = cfg->getOption("login_cmd");
  6. replaceVariables(loginCommand, SESSION_VAR, session);
  7. replaceVariables(loginCommand, THEME_VAR, themeName);
  8. + if(loginCommand=="default"){
  9. + if (session=="default"||session==""){
  10. + loginCommand=". /etc/profile;exec $WINDOWMANAGER";
  11. + } else {
  12. + loginCommand="exec ";
  13. + loginCommand+=cfg->session_map.find(session)->second;
  14. + }
  15. + }
  16. string sessStart = cfg->getOption("sessionstart_cmd");
  17. if (sessStart != "") {
  18. replaceVariables(sessStart, USER_VAR, pw->pw_name);
  19. diff -ur slim-1.3.0.orig/cfg.cpp slim-1.3.0/cfg.cpp
  20. --- slim-1.3.0.orig/cfg.cpp 2007-07-15 15:09:28.000000000 +0100
  21. +++ slim-1.3.0/cfg.cpp 2007-08-25 13:55:19.000000000 +0100
  22. @@ -23,6 +23,75 @@
  23. typedef pair<string,string> option;
  24. +int dir_sel(const struct dirent *entry){
  25. + char *c;
  26. + if ((c=strrchr(entry->d_name,'.'))){
  27. + if (strcmp(c,".desktop")==0){
  28. + return 1;
  29. + }
  30. + }
  31. + return 0;
  32. +}
  33. +
  34. +int parse_session(string &path,string &name,string &exec){
  35. + string line;
  36. + int rc=0;
  37. + ifstream file(path.c_str());
  38. + if (!file.is_open()){
  39. + return 0;
  40. + }
  41. + while(!file.eof()){
  42. + getline(file,line);
  43. + const char *s=line.c_str();
  44. + char *s2;
  45. + if(!(s2=strchr(s,'='))){
  46. + continue;
  47. + }
  48. + s2++;
  49. + if(line.compare(0,s2-s,"Name=")==0){
  50. + line.erase(0,s2-s);
  51. + name=line;
  52. + rc++;
  53. + }else if(line.compare(0,s2-s,"Exec=")==0){
  54. + line.erase(0,s2-s);
  55. + exec=line;
  56. + rc++;
  57. + }
  58. + if (rc==2){
  59. + return rc;
  60. + }
  61. + }
  62. + return rc;
  63. +}
  64. +
  65. +int get_sessions(map<string,string> &m){
  66. + struct dirent **entries;
  67. + int i,n;
  68. + n=scandir("/usr/share/xsessions",&entries,dir_sel,alphasort);
  69. + for(i=0;i<n;i++){
  70. + string s,s2;
  71. + string path("/usr/share/xsessions/");
  72. + path+=entries[i]->d_name;
  73. + if (parse_session(path,s,s2)==2){
  74. + m.insert(pair<string,string>(s,s2));
  75. + }
  76. + }
  77. + return (n?1:0);
  78. +}
  79. +
  80. +const char *get_sessions_str(map<string,string> &m){
  81. + string s("default");;
  82. + map<string,string>::iterator it;
  83. + for(it=m.begin();it!=m.end();it++){
  84. + /*if(it!=m.begin()){
  85. + s+=",";
  86. + }*/
  87. + s+=",";
  88. + s+=(*it).first;
  89. + }
  90. + return s.c_str();
  91. +}
  92. +
  93. Cfg::Cfg()
  94. : currentSession(-1)
  95. {
  96. @@ -33,7 +102,8 @@
  97. options.insert(option("numlock",""));
  98. options.insert(option("daemon",""));
  99. options.insert(option("xauth_path","/usr/X11R6/bin/xauth"));
  100. - options.insert(option("login_cmd","exec /bin/bash -login ~/.xinitrc %session"));
  101. + //options.insert(option("login_cmd","exec /bin/bash -login ~/.xinitrc %session"));
  102. + options.insert(option("login_cmd","default"));
  103. options.insert(option("halt_cmd","/sbin/shutdown -h now"));
  104. options.insert(option("reboot_cmd","/sbin/shutdown -r now"));
  105. options.insert(option("suspend_cmd",""));
  106. @@ -49,7 +119,9 @@
  107. options.insert(option("authfile","/var/run/slim.auth"));
  108. options.insert(option("shutdown_msg","The system is halting..."));
  109. options.insert(option("reboot_msg","The system is rebooting..."));
  110. - options.insert(option("sessions","wmaker,blackbox,icewm"));
  111. + //options.insert(option("sessions","wmaker,blackbox,icewm"));
  112. + get_sessions(session_map);
  113. + options.insert(option("sessions",get_sessions_str(session_map)));
  114. options.insert(option("sessiondir",""));
  115. options.insert(option("hidecursor","false"));
  116. @@ -108,6 +180,7 @@
  117. options.insert(option("msg_shadow_color","#FFFFFF"));
  118. error = "";
  119. +
  120. }
  121. diff -ur slim-1.3.0.orig/cfg.h slim-1.3.0/cfg.h
  122. --- slim-1.3.0.orig/cfg.h 2007-07-15 15:09:28.000000000 +0100
  123. +++ slim-1.3.0/cfg.h 2007-08-25 13:06:11.000000000 +0100
  124. @@ -43,6 +43,7 @@
  125. string nextSession(string current);
  126. + map<string,string>session_map;
  127. private:
  128. void fillSessionList();
  129. diff -ur slim-1.3.0.orig/Makefile slim-1.3.0/Makefile
  130. --- slim-1.3.0.orig/Makefile 2007-07-15 15:09:28.000000000 +0100
  131. +++ slim-1.3.0/Makefile 2007-08-25 13:04:25.000000000 +0100
  132. @@ -5,9 +5,9 @@
  133. #######################################################
  134. CXX=/usr/bin/g++
  135. CC=/usr/bin/gcc
  136. -CFLAGS=-Wall -I. -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/libpng12 -I/usr/include
  137. +CFLAGS=-Wall -I. -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/libpng12 -I/usr/include -I/usr/X11R7/include/
  138. CXXFLAGS=$(CFLAGS)
  139. -LDFLAGS=-L/usr/X11R6/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng12 -lz -lm -lcrypt -lXmu -lpng -ljpeg
  140. +LDFLAGS=-L/usr/X11R6/lib -L/usr/X11R7/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng12 -lz -lm -lcrypt -lXmu -lpng -ljpeg
  141. CUSTOM=-DHAVE_SHADOW
  142. ifdef USE_PAM
  143. LDFLAGS+= -lpam
  144. diff -ur slim-1.3.0.orig/slim.conf slim-1.3.0/slim.conf
  145. --- slim-1.3.0.orig/slim.conf 2007-07-15 15:09:28.000000000 +0100
  146. +++ slim-1.3.0/slim.conf 2007-08-27 15:59:33.000000000 +0100
  147. @@ -1,17 +1,17 @@
  148. # Path, X server and arguments (if needed)
  149. # Note: -xauth $authfile is automatically appended
  150. -default_path ./:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
  151. -default_xserver /usr/X11R6/bin/X
  152. +default_path ./:/bin:/usr/bin:/usr/local/bin:/usr/X11/bin
  153. +default_xserver /usr/X11/bin/X
  154. #xserver_arguments -dpi 75
  155. # Commands for halt, login, etc.
  156. halt_cmd /sbin/shutdown -h now
  157. reboot_cmd /sbin/shutdown -r now
  158. -console_cmd /usr/X11R6/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
  159. +console_cmd /usr/X11/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
  160. #suspend_cmd /usr/sbin/suspend
  161. # Full path to the xauth binary
  162. -xauth_path /usr/X11R6/bin/xauth
  163. +xauth_path /usr/X11/bin/xauth
  164. # Xauth file for server
  165. authfile /var/run/slim.auth
  166. @@ -33,7 +33,7 @@
  167. # to adjust the command according to your preferred shell,
  168. # i.e. for freebsd use:
  169. # login_cmd exec /bin/sh - ~/.xinitrc %session
  170. -login_cmd exec /bin/bash -login ~/.xinitrc %session
  171. +#login_cmd exec /bin/bash -login ~/.xinitrc %session
  172. # Commands executed when starting and exiting a session.
  173. # They can be used for registering a X11 session with
  174. @@ -51,7 +51,7 @@
  175. # The current chosen session name is replaced in the login_cmd
  176. # above, so your login command can handle different sessions.
  177. # see the xinitrc.sample file shipped with slim sources
  178. -sessions xfce4,icewm,wmaker,blackbox
  179. +#sessions xfce4,icewm,wmaker,blackbox
  180. # Executed when pressing F11 (requires imagemagick)
  181. screenshot_cmd import -window root /slim.png