From db650a0853be39d1c54cf2ccee8bd157cfb34a99 Mon Sep 17 00:00:00 2001 From: Aurelian R Date: Sat, 7 Jun 2025 15:44:07 +0200 Subject: Fix detection of Wayland sessions (mga#33738) --- sbin/chksession | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sbin') diff --git a/sbin/chksession b/sbin/chksession index c406fdf..0b07104 100755 --- a/sbin/chksession +++ b/sbin/chksession @@ -8,6 +8,8 @@ my (@lf, $dir, $first, $list, $list_order, %order, $test); +# Define multiple default paths for window-managers +my @dir_wm = qw(/usr/share/xsessions/ /usr/share/wayland-sessions/); sub usage { my $e = shift @_; @@ -75,11 +77,19 @@ while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) { } # Parse all relevant files in session directory $dir -$dir = $test ? './xsessions/' : '/usr/share/xsessions/' unless $dir; -chdir($dir); -foreach (glob("*.desktop")) { - parse_file($_); +if ($test) { + $dir = './xsessions/'; } +if ($dir) { + @dir_wm = $dir; +} +foreach my $dir (@dir_wm) { + chdir($dir); + foreach (glob("*.desktop")) { + parse_file($_); + } +} + my ($e) = eval { cat("/etc/sysconfig/desktop") } =~ /DESKTOP=(\S+)/; # The first string (without spaces) in the file is copied to $e. -- cgit v1.2.1