bin - Personal scripts
ssh://anon@thyssentishman.com/bin
Log | Files | Refs | Feed | Contribute | README

Commit: 8422bd4c7e160ce618a529da97519c3cac82769e
Parent: a8ad16925971b7114c575aac418497e41b344bf2
Author: Johannes Thyssen Tishman
Date:   Mon, 27 May 2024 15:42:23 +0000

statusbar: Make minor tweaks

- Use one line of ed instead of sed
- Reduce notification duration to 10 seconds
- Use -f flag when removing lock to avoid error message

Diffstat:
M statusbar | 7 +++----

1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/statusbar b/statusbar
@@ -56,8 +56,7 @@ datetime() {
 
 while :; do
 	if [ -s "$NQUEUE" ]; then
-		sed -n '1p' "$NQUEUE"
-		sed -i '1d' "$NQUEUE"
+		printf "1p\n1d\nw\n" | ed -s "$NQUEUE"
 		touch "$NLOCK"
 	else
 		crypto
@@ -67,6 +66,6 @@ while :; do
 		battery
 		datetime
 	fi | xargs -I{} xsetroot -name '{}'
-	sleep 30
-	rm "$NLOCK" 2> /dev/null
+	sleep 10
+	rm -f "$NLOCK"
 done