From ac5099ebf8fced835c2108ce4d2d327762d0e595 Mon Sep 17 00:00:00 2001 From: Dexter Morgan Date: Thu, 2 Jun 2011 20:30:42 +0000 Subject: Branch for updates --- sbin/convertsession | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sbin/convertsession (limited to 'sbin/convertsession') diff --git a/sbin/convertsession b/sbin/convertsession new file mode 100644 index 0000000..05ea57e --- /dev/null +++ b/sbin/convertsession @@ -0,0 +1,31 @@ +#!/usr/bin/perl +# -*- Mode: cperl -*- +# Copyright (C) 2000 by Chmouel Boudjnah +# 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 () { + $/ = "--@@--"; + 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++; +} -- cgit v1.2.1