mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-14 03:39:53 +03:00
39 lines
1,003 B
Diff
39 lines
1,003 B
Diff
Patch-Source: https://github.com/misterdanb/avizo/pull/66
|
|
--
|
|
From b59181e1332854f502440004041366d294ee74b2 Mon Sep 17 00:00:00 2001
|
|
From: Jakub Jirutka <jakub@jirutka.cz>
|
|
Date: Sat, 3 Feb 2024 22:14:23 +0100
|
|
Subject: [PATCH] Fix #48 bashism in lightctl
|
|
|
|
This was introduced in #44.
|
|
---
|
|
lightctl | 9 +++------
|
|
1 file changed, 3 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/lightctl b/lightctl
|
|
index 43abe1d..f5333ae 100755
|
|
--- a/lightctl
|
|
+++ b/lightctl
|
|
@@ -109,19 +109,16 @@ elif command -v light >/dev/null; then
|
|
=) light $opts -S "$value";;
|
|
esac
|
|
|
|
- light=$(light $opts -G)
|
|
+ light="$(light $opts -G)"
|
|
+ light="${light%.*}" # strip decimal part
|
|
else
|
|
die 'command not found: brightnessctl or light'
|
|
fi
|
|
|
|
-if ! is_integer "$light" && ! is_float "$light"; then
|
|
+if ! is_integer "$light"; then
|
|
die "$prog returned invalid brigtness: '$light'"
|
|
fi
|
|
|
|
-if is_float "$light"; then
|
|
- light=${light/.*}
|
|
-fi
|
|
-
|
|
if [ "$light" -le 33 ]; then
|
|
image='brightness_low'
|
|
elif [ "$light" -le 66 ]; then
|