compton-trans: ensure wid format. misc.
xwininfo falls back to cursor selection if the window ID is formatted improperly.
This commit is contained in:
parent
216441c7b0
commit
a9a3b015e1
|
@ -19,6 +19,10 @@
|
||||||
# $ compton-trans -s 75
|
# $ compton-trans -s 75
|
||||||
# Increment current window 5%
|
# Increment current window 5%
|
||||||
# $ compton-trans -c +5
|
# $ compton-trans -c +5
|
||||||
|
# Delete current window's opacity
|
||||||
|
# $ compton-trans -c --delete
|
||||||
|
# Reset all windows
|
||||||
|
# $ compton-trans --reset
|
||||||
|
|
||||||
# "command" is a shell built-in, faster than "which"
|
# "command" is a shell built-in, faster than "which"
|
||||||
if test -z "$(command -v xprop)" -o -z "$(command -v xwininfo)"; then
|
if test -z "$(command -v xprop)" -o -z "$(command -v xwininfo)"; then
|
||||||
|
@ -120,6 +124,9 @@ fi
|
||||||
if test -z "$wprefix"; then
|
if test -z "$wprefix"; then
|
||||||
treeout=$(xwininfo -children -frame)
|
treeout=$(xwininfo -children -frame)
|
||||||
else
|
else
|
||||||
|
test "$wprefix" = '-id' \
|
||||||
|
&& ! echo "$window" | grep -q '^\(0x\)\?[0-9a-fA-F]\+$' \
|
||||||
|
&& echo 'Bad window ID.' && exit 1
|
||||||
treeout=$(xwininfo -children $wprefix "$window")
|
treeout=$(xwininfo -children $wprefix "$window")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -189,7 +196,7 @@ fi
|
||||||
|
|
||||||
# Calculate the desired opacity
|
# Calculate the desired opacity
|
||||||
if echo "$opacity" | grep -q '^[+-]'; then
|
if echo "$opacity" | grep -q '^[+-]'; then
|
||||||
opacity=$(($cur + $opacity))
|
opacity=$((cur + opacity))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test $opacity -lt 0 && opacity=0
|
test $opacity -lt 0 && opacity=0
|
||||||
|
|
Loading…
Reference in New Issue