diff --git a/bin/compton-trans b/bin/compton-trans index 4e557757..7576abc9 100755 --- a/bin/compton-trans +++ b/bin/compton-trans @@ -26,6 +26,7 @@ opacity= cur= i= +# Read options while getopts "scn:w:o:" option; do case "$option" in s) wprefix=''; window='' ;; @@ -37,9 +38,14 @@ while getopts "scn:w:o:" option; do n) wprefix='-name '; window="$OPTARG" ;; w) wprefix='-id '; window="$OPTARG" ;; o) opacity="$OPTARG" ;; + \?) exit 1;; esac done +# Read positional arguments +shift $(($OPTIND - 1)) +[ -n "$1" ] && opacity="$1" + # Validate opacity value if [ -z "$opacity" ]; then echo "No opacity specified." diff --git a/man/compton-trans.1 b/man/compton-trans.1 index 97b4d349..995ab87c 100644 --- a/man/compton-trans.1 +++ b/man/compton-trans.1 @@ -6,7 +6,7 @@ compton\-trans \- an opacity setter tool .SH SYNOPSIS .nf -.B compton-trans [-wncs] [window] -o [opacity] +.B compton-trans [-w WINDOW_ID] [-n WINDOW_NAME] [-c] [-s] OPACITY .fi .SH DESCRIPTION