aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaviddavid <geiger.david68210@gmail.com>2016-08-23 17:59:40 +0200
committerdaviddavid <geiger.david68210@gmail.com>2016-08-23 17:59:40 +0200
commit46e66c480c4447e014c51e7283f24186e4978a62 (patch)
tree3403d06549a5983e3c35dd427eb3a8f323757ce9
parent14ef24332e653eb8e6a7eacf00ed0091e517fc3a (diff)
downloadcommon-data-6.3.tar
common-data-6.3.tar.gz
common-data-6.3.tar.bz2
common-data-6.3.tar.xz
common-data-6.3.zip
fix chksession from David Walser (mga#17617)6.3
-rw-r--r--Makefile2
-rwxr-xr-xsbin/chksession25
2 files changed, 25 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index bca5960..5e6dabe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
# Use Mageia release as major and bump minor
-VERSION = 6.2
+VERSION = 6.3
PACKAGE = desktop-common-data
NAME = desktop-common-data
TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
diff --git a/sbin/chksession b/sbin/chksession
index a4b8d71..5efa42f 100755
--- a/sbin/chksession
+++ b/sbin/chksession
@@ -23,6 +23,8 @@ Usage: $0 [OPTION]...
-d=DIR, --dir=DIR: Specifies a directory of w-m configuration files.
Default is /usr/share/xsessions/
+ -x=ENTRY, --xsession=ENTRY: Produce window-managers script of ENTRY.
+
-h, --help: Produce this help.
EOF
@@ -41,6 +43,8 @@ sub parse_file { # parse a session descriptor file
my $n;
local $_ = cat($fn);
($n = $1) =~ s| ||g if /^Name=(.*)/m;
+ my $e = $1 if /^Exec=(.*)/m;
+ $script{$n} = $e;
push @lf, $n;
($order{$n}) = $fn =~ m/(^[0-9][0-9])/;
}
@@ -50,7 +54,9 @@ usage(1)
while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) {
local $_ = shift;
- if (/^--first/ || /^-F/) {
+ if (/^--xsession=([^ ]+)/ || /^-x=([^ ]+)/) {
+ $xsession = $1;
+ } elsif (/^--first/ || /^-F/) {
$first++;
} elsif (/^--list/ || /^-l/) {
$list++;
@@ -82,6 +88,23 @@ my ($e) = eval { cat("/etc/sysconfig/desktop") } =~ /DESKTOP=(\S+)/;
# Order of names in @lf is otherwise unchanged.
@lf = sort { $b =~ /^$e$/i <=> $a =~ /^$e$/i } @lf;
+if ($xsession) {
+ if ($script{$xsession}) {
+ print "#!/bin/sh\n";
+ print $script{$xsession}
+ } else {
+ print "xterm -geometry 100x25+0+0 &\n";
+ if ( -x '/usr/bin/icewm' ) {
+ print "icewm\n";
+ } elsif ( -x '/usr/bin/twm' ) {
+ print "twm\n";
+ } else {
+ print "xterm -geometry 67x14+384+446\n";
+ }
+ }
+ exit (0);
+}
+
@lf ? print shift @lf, "\n" : print "default\n"
if $first;