aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelian R <arusanu@gmail.com>2025-06-07 15:44:07 +0200
committerPapoteur <papoteur@mageia.org>2025-06-07 15:44:07 +0200
commitdb650a0853be39d1c54cf2ccee8bd157cfb34a99 (patch)
treebd85e11d521b1e07af9fcdcaf3c852170961458e
parent285d8b8f6d83e713b5036ea70c2d2ef2d98773b0 (diff)
downloadcommon-data-db650a0853be39d1c54cf2ccee8bd157cfb34a99.tar
common-data-db650a0853be39d1c54cf2ccee8bd157cfb34a99.tar.gz
common-data-db650a0853be39d1c54cf2ccee8bd157cfb34a99.tar.bz2
common-data-db650a0853be39d1c54cf2ccee8bd157cfb34a99.tar.xz
common-data-db650a0853be39d1c54cf2ccee8bd157cfb34a99.zip
Fix detection of Wayland sessions (mga#33738)
-rwxr-xr-xsbin/chksession18
1 files changed, 14 insertions, 4 deletions
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.