aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-12-05 02:47:51 +0000
committerAnssi Hannula <anssi@mageia.org>2011-12-05 02:47:51 +0000
commite49d748f4736c9c119e07b60ef843e91219a5a13 (patch)
treeb5f1320f22b6bfddab6af893fba7a91f096503fa
parent7d591749d448e68a551945ce5b96f25f00412366 (diff)
downloadcommon-data-e49d748f4736c9c119e07b60ef843e91219a5a13.tar
common-data-e49d748f4736c9c119e07b60ef843e91219a5a13.tar.gz
common-data-e49d748f4736c9c119e07b60ef843e91219a5a13.tar.bz2
common-data-e49d748f4736c9c119e07b60ef843e91219a5a13.tar.xz
common-data-e49d748f4736c9c119e07b60ef843e91219a5a13.zip
chksession: add support for generic --generate=DIR and --wrap-sessions
See mgabz #2740. This also allows migrating other users to the more readable and robust versions, avoiding the use of hardcoded directories in chksession.
-rw-r--r--sbin/chksession21
1 files changed, 18 insertions, 3 deletions
diff --git a/sbin/chksession b/sbin/chksession
index 196414f..f61ef1c 100644
--- a/sbin/chksession
+++ b/sbin/chksession
@@ -18,12 +18,19 @@ Usage: $0 [OPTION]...
-t, --test: Go in test mode.
-l, --list: List window-managers.
-L: List window-managers including the order number
+
-d=DIR, --dir=DIR: Specifies a directory of w-m configuration files.
Default is /etc/X11/wmsession.d/
+
-x=ENTRY, --xsession=ENTRY: Produce window-managers script of ENTRY.
- -k, --kdm3: Produce window-managers list for kdm3 sessions.
- -K, --kdm4: Produce window-managers list for kdm4 sessions.
- -g, --gdm: Produce window-managers script for gdm sessions.
+
+ --generate=DIR: Produce window-manager .desktop files into DIR.
+ --wrap-sessions: Wrap window-managers with /usr/share/X11/xdm/Xsession.
+
+ -k, --kdm3: Shortcut for --generate=/opt/kde3/share/apps/kdm/sessions
+ -K, --kdm4: Shortcut for --generate=/usr/share/apps/kdm/sessions
+ -g, --gdm: Shortcut for --generate=/etc/X11/dm/Sessions --wrap-sessions
+
-h, --help: Produce this help.
EOF
@@ -83,6 +90,10 @@ while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) {
$xsession = $1;
} elsif (/^--first/ || /^-F/) {
$first++;
+ } elsif (/^--generate=([^ ]+)/) {
+ $generate = $1;
+ } elsif (/^--wrap-sessions/) {
+ $wrap_sessions++;
} elsif (/^--gdm/ || /^-g/) {
die "You should be root to build gdm session\n" if $< != 0;
$gdm++;
@@ -123,6 +134,10 @@ my ($e) = eval {cat("/etc/sysconfig/desktop")} =~ /DESKTOP=(\S+)/;
@lf = sort { $b =~ /^$e$/i <=> $a =~ /^$e$/i } @lf;
+if ($generate) {
+ gen_desktops($generate, $wrap_sessions);
+}
+
if ($kdm3) {
gen_desktops('/opt/kde3/share/apps/kdm/sessions', 0);
}