Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11-wm/compton: use basic regex for compton-trans
The compton-trans script makes use of extended regex features sed(1) does not support. Patch it to use BREs only. While we are at it, do some housekeeping on the port Makefile. PR: 273319 Approved by: femc7488@gmail.com (maintainer timeout)
- Loading branch information
1 parent
9e5e541
commit 0816318
Showing
2 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- bin/compton-trans.orig 2016-09-07 08:23:44 UTC | ||
+++ bin/compton-trans | ||
@@ -2,7 +2,7 @@ | ||
|
||
# | ||
# compton-trans | ||
-# transset in a bash script | ||
+# transset in a sh script | ||
# Copyright (c) 2011-2012, Christopher Jeffrey | ||
# | ||
|
||
@@ -46,7 +46,7 @@ v= | ||
|
||
# Workaround: replace '-5' with '~5' so as not to confuse getopts. | ||
for v in "$@"; do | ||
- shift && set -- "$@" "$(echo "$v" | sed 's/^-\([0-9]\+%\?\)$/~\1/')" | ||
+ shift && set -- "$@" "$(echo "$v" | sed 's/^-\([0-9]\{1,\}%\{0,1\}\)$/~\1/')" | ||
done | ||
|
||
# This takes into account the fact that getopts stops on | ||
@@ -69,7 +69,7 @@ while test $# -gt 0; do | ||
OPTIND=$((OPTIND + 1)) | ||
;; | ||
name=* | window=* | opacity=*) | ||
- v=$(echo "$OPTARG" | sed 's/^[^=]\+=//') | ||
+ v=$(echo "$OPTARG" | sed 's/^[^=]\{1,\}=//') | ||
;; | ||
*) | ||
echo "$0: illegal option $OPTARG" >& 2 | ||
@@ -92,7 +92,7 @@ while test $# -gt 0; do | ||
n) wprefix='-name'; window=$OPTARG ;; | ||
w) wprefix='-id'; window=$OPTARG ;; | ||
o) opacity=$OPTARG ;; | ||
- \?) exit 1 ;; | ||
+ \{0,1\}) exit 1 ;; | ||
esac | ||
done | ||
|
||
@@ -102,10 +102,10 @@ while test $# -gt 0; do | ||
done | ||
|
||
# clean up opacity. xargs == a poor man's trim. | ||
-opacity=$(echo "$opacity" | xargs | sed 's/%//g' | sed 's/^~\([0-9]\+\)$/-\1/') | ||
+opacity=$(echo "$opacity" | xargs | sed 's/%//g' | sed 's/^~\([0-9]\{1,\}\)$/-\1/') | ||
|
||
# Validate opacity value | ||
-if test -z "$action" && ! echo "$opacity" | grep -q '^[+-]\?[0-9]\+$'; then | ||
+if test -z "$action" && ! echo "$opacity" | grep -q '^[+-]\{0,1\}[0-9]\{1,\}$'; then | ||
echo "Invalid opacity specified: $opacity." | ||
exit 1 | ||
fi | ||
@@ -184,7 +184,7 @@ fi | ||
|
||
# Get current opacity. | ||
cur=$(xprop -id "$topmost" -notype _NET_WM_WINDOW_OPACITY \ | ||
- | sed 's/^.*\b\([0-9]\+\).*$\|^.*$/\1/') | ||
+ | sed -n 's/^\(.*^[_[:alnum:]]\)\{0,1\}\([0-9]\{1,\}\).*$/\2/p') | ||
test -z "$cur" && cur=0xffffffff | ||
cur=$((cur * 100 / 0xffffffff)) | ||
|