From 1bfd55a6c2bdf687ccaacf5eee766913ca97b0fc Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 14 Jul 2025 16:26:22 +0200 Subject: [PATCH] Fix opacity script nil handling --- bin/opacity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/opacity b/bin/opacity index ff5d499..b73a54e 100755 --- a/bin/opacity +++ b/bin/opacity @@ -2,8 +2,8 @@ id=$(xdotool selectwindow) -before=$(xprop -id $id 32c _NET_WM_WINDOW_OPACITY | lua -e 'print(tonumber(io.read():match("= .*$"):sub(2)))') -initial=$(xprop -id $id 32c _NET_WM_WINDOW_OPACITY | lua -e 'print(math.floor(tonumber(io.read():match("= .*$"):sub(2)) / 0xffffffff * 100 + 0.5))') +before=$(xprop -id $id 32c _NET_WM_WINDOW_OPACITY | lua -e 'print(tonumber(string.match(io.read() or "=", "= .*$"):sub(2)))' || echo 4294967295) +initial=$(xprop -id $id 32c _NET_WM_WINDOW_OPACITY | lua -e 'print(math.floor(tonumber(io.read():match("= .*$"):sub(2)) / 0xffffffff * 100 + 0.5))' || echo 100) ((zenity --scale --title "Opacity" --value=$initial --print-partial; echo $? >&3) \ | lua -e 'for line in io.lines() do print(string.format("0x%08x", math.floor(tonumber(line) / 100 * 0xffffffff + 0.5))) end' \