aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@mandriva.org>2000-07-11 21:43:30 +0000
committerChmouel Boudjnah <chmouel@mandriva.org>2000-07-11 21:43:30 +0000
commit027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5 (patch)
tree8e4492d61450ae0e27088e03f7b1736f16f26aad
parenta58fcd8b62d1cfabe5fe86dde4b418de39c7708f (diff)
downloadcommon-data-027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5.tar
common-data-027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5.tar.gz
common-data-027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5.tar.bz2
common-data-027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5.tar.xz
common-data-027b9fcf9a8016eb88c2aa5c8a5047ebf70025d5.zip
A new greatest hit.
-rw-r--r--sbin/convertsession31
1 files changed, 31 insertions, 0 deletions
diff --git a/sbin/convertsession b/sbin/convertsession
new file mode 100644
index 0000000..794ef07
--- /dev/null
+++ b/sbin/convertsession
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# -*- Mode: cperl -*-
+# Copyright (C) 2000 by Chmouel Boudjnah <chmouel@mandrakesoft.com>
+# Redistribution of this file is permitted under the terms of the GNU
+# Public License (GPL)
+## description: Convert a file /etc/X11/window-managers to a
+## /etc/X11/wmsession.d/ style files.
+
+my $dir = '/etc/X11/wmsession.d/';
+
+if ($ARGV[0] =~ /-f/ ) {
+ $file = $ARGV[1];
+} else {
+ $file = '/etc/X11/window-managers';
+}
+
+my $cnt = 0;
+
+open F, $file or die "Can't open $file\n";
+while (<F>) {
+ $/ = "--@@--";
+ s|--@@--||g;
+ if ($cnt != 0) {
+ $content = "$_";
+ $n = $1 if /^NAME=(.*)/m;
+ open C, ">$dir/$cnt$n" or die "Can't open $dir/$cnt$n\n";
+ print C $content;
+ close C;
+ }
+ $cnt++;
+}