From 075e8ac472403934f4ca383beae2cd9ac555f71a Mon Sep 17 00:00:00 2001 From: remph Date: Thu, 31 Oct 2024 18:26:08 +0000 Subject: Minor changes: * Allow changing volume/brightness while locked in Sway * Ensure separate wob instance for each WAYLAND_DISPLAY * Update copyright, mostly for other branches based on this --- swob.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'swob.sh') diff --git a/swob.sh b/swob.sh index bdcdf01..77968fa 100755 --- a/swob.sh +++ b/swob.sh @@ -1,12 +1,10 @@ #!/bin/sh # SPDX-FileCopyrightText: 2023-2024 The Remph -# SPDX-License-Identifier: FSFULLRWD +# SPDX-License-Identifier: GPL-3.0-or-later -wobfifo=${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}}/wob -wobini= -readonly wobfifo -# `set -e' comes after readonly, which isn't vital enough to kill the script for set ${BASH_VERSION:+-o pipefail} -efmu +wobfifo=$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.swob +wobini= set_wobini() { for dir in ${XDG_CONFIG_HOME:+"$XDG_CONFIG_HOME"} ~/.config /etc; do -- cgit From 549e328b61c44bc6fe244f14a4eeaf1bfa464a9b Mon Sep 17 00:00:00 2001 From: remph Date: Fri, 15 Nov 2024 02:02:06 +0000 Subject: Shell vagaries and chatter reduction: * Reduce talk from dash about set -m that's cluttering up my logs: not sure that it was ever necessary anyway. * Don't run swob in an unnecessary subshell. * Gag wob's own verbose babble, which I forgot about from debugging. * Prevent `set -u' from biting me about $! --- swob.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'swob.sh') diff --git a/swob.sh b/swob.sh index 77968fa..dc2dbb4 100755 --- a/swob.sh +++ b/swob.sh @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2023-2024 The Remph # SPDX-License-Identifier: GPL-3.0-or-later -set ${BASH_VERSION:+-o pipefail} -efmu +set ${BASH_VERSION:+-o pipefail} -efu wobfifo=$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.swob wobini= @@ -44,11 +44,11 @@ start_wob() { set_wobini # spawn wob process with temporary file(s) - ( + { trap 'rm "$wobfifo"' 0 # Don't `exec' wob here, else the trap won't work - wob -c "$wobini" -v <$wobfifo - ) & + wob -c "$wobini" <$wobfifo + } & } do_cmd_get_percent() { @@ -104,4 +104,4 @@ start_wob # soon as it's done sleeping (the existing situation is that as long as one # script sleeps, the shell that spawned the wob process will wait until that # sleep is done) -test -z $! || wait $! +test -z ${!-} || wait $! # surprisingly, $! could be unset (not just zero-length) -- cgit