From 5b5534d012eed17bf33680c22608b9f77df6f59e Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 10 Mar 2021 00:24:39 -0500 Subject: [PATCH] transsetter.sh: only apply opacity when a window is created, not every run --- transsetter.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/transsetter.sh b/transsetter.sh index 14fbbe9..0b813ce 100755 --- a/transsetter.sh +++ b/transsetter.sh @@ -32,17 +32,20 @@ if ! which xshove > /dev/null; then fi wlist=$(mktemp) - +oldwlist=$(mktemp) while true; do xshove > $wlist while read wprop; do wid=$(echo ${wprop} | awk '{print $1}') - wclass=$(echo ${wprop} | awk '{print $3}') - if [ "$wclass" = "${geditor}" ]; then - $setter -i 0x$wid ${opacity} > /dev/null - elif [ "${wclass}" = "${termprog}" ]; then - $setter -i 0x$wid ${opacity} > /dev/null + if ! grep $wid $oldwlist > /dev/null; then + wclass=$(echo ${wprop} | awk '{print $3}') + if [ "$wclass" = "${geditor}" ]; then + $setter -i 0x$wid ${opacity} > /dev/null + elif [ "${wclass}" = "${termprog}" ]; then + $setter -i 0x$wid ${opacity} > /dev/null + fi fi done < $wlist + cat $wlist > $oldwlist; sleep 0.2 done