From 32cd77aefd9a12167d090506d1607dbeb7d9d7d6 Mon Sep 17 00:00:00 2001 From: Photon89 Date: Mon, 5 Jan 2026 13:20:10 +0100 Subject: [PATCH 1/4] Switch to /etc/os-release to get system info --- bin/shutter | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/shutter b/bin/shutter index a2d307f1..c6b063bf 100755 --- a/bin/shutter +++ b/bin/shutter @@ -9470,9 +9470,10 @@ sub STARTUP { } #issue - if (-f '/etc/issue') { - if (File::Which::which('cat')) { - print `cat /etc/issue`, "\n"; + if (-f '/etc/os-release') { + if (File::Which::which('sed')) { + print `sed '1q;d' /etc/os-release`; + print `sed '5q;d' /etc/os-release`, "\n"; } } From 0a0600e4e1187c37c41efd85ecc38ede8ad3de7d Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Wed, 7 Jan 2026 08:57:32 +0000 Subject: [PATCH 2/4] Read the map from file --- bin/shutter | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/shutter b/bin/shutter index c6b063bf..d09bca4f 100755 --- a/bin/shutter +++ b/bin/shutter @@ -9469,13 +9469,17 @@ sub STARTUP { print `uname -a`, "\n"; } - #issue - if (-f '/etc/os-release') { - if (File::Which::which('sed')) { - print `sed '1q;d' /etc/os-release`; - print `sed '5q;d' /etc/os-release`, "\n"; - } - } + eval { + open my $fh, '<', '/etc/os-release' or die; + my %map = map { + chomp; + my ($key, $value) = split /=/, $_, 2; + $value =~ s/^(['"])(.*)\1$/$2/; + ($key, $value) + } <$fh>; + say $map{NAME}; + }; + say "Cannot open /etc/os-release" if $@; printf "Glib %s \n", $Glib::VERSION; printf "Gtk3 %s \n", $Gtk3::VERSION; From 6e67b045b3ea0840c023697b27433257fb49b4c7 Mon Sep 17 00:00:00 2001 From: Photon89 Date: Wed, 7 Jan 2026 17:47:36 +0100 Subject: [PATCH 3/4] Add Distro version/build ID info to debug output --- bin/shutter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/shutter b/bin/shutter index d09bca4f..43bbf51c 100755 --- a/bin/shutter +++ b/bin/shutter @@ -9477,7 +9477,7 @@ sub STARTUP { $value =~ s/^(['"])(.*)\1$/$2/; ($key, $value) } <$fh>; - say $map{NAME}; + say "$map{NAME} $map{VERSION_ID}$map{BUILD_ID}"; }; say "Cannot open /etc/os-release" if $@; From 284370abd2bdc6a0c222122ebf589a5a524630c1 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 8 Jan 2026 01:13:18 +0000 Subject: [PATCH 4/4] output the existing values with space separator --- bin/shutter | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/shutter b/bin/shutter index 43bbf51c..756deb05 100755 --- a/bin/shutter +++ b/bin/shutter @@ -9477,7 +9477,8 @@ sub STARTUP { $value =~ s/^(['"])(.*)\1$/$2/; ($key, $value) } <$fh>; - say "$map{NAME} $map{VERSION_ID}$map{BUILD_ID}"; + local $, = ' '; + say grep { $_ } map { $map{$_} } qw/NAME VERSION_ID BUILD_ID/; }; say "Cannot open /etc/os-release" if $@;