|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
| 3 | +# SC1117: Backslash is literal in "\e". Prefer explicit escaping: "\\e". |
| 4 | +# SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n". |
| 5 | +# SC1117: Backslash is literal in "\t". Prefer explicit escaping: "\\t". |
| 6 | +# SC2086: Double quote to prevent globbing and word splitting. # ${variable} does not work when double quoted. also, double quote breaks this script in many cases --> there are warning comments containing "ATTENTION" about this. |
| 7 | +# SC2162: read without -r will mangle backslashes. # "read" is often used to wait for user input (e.g. a press of ENTER). "-r" is pointless in this case and makes the script harder to read. |
| 8 | +# shellcheck disable=SC1117,SC2086,SC2162 # exclude MANY false-positive shellcheck warnings (see above) |
| 9 | + |
3 | 10 | # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as |
4 | 11 | # published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
5 | 12 | # |
|
13 | 20 | # |
14 | 21 | # Design based on IceFox script. Heavily modified by pekman, excalibur1234, Chrysostomus, papajoker, and thefallenrat. |
15 | 22 |
|
16 | | - |
17 | | -# use unofficial strict mode in order to make bash behave like modern programming languages: |
18 | | -set -e # exit script immediately, if any command exits with non-zero error code |
19 | | -set -u # only allow previously defined variables |
20 | | -set -o pipefail # if one command in a pipe fails, all fail (this is not default behavior!) |
21 | | - |
22 | | -# ANSI Escape sequences used in this script (do NOT use \\e[..., because it does not always work): |
| 23 | +# ANSI Escape sequences used in this script: # ATTENTION: do NOT use \\e[..., because it does not always work! |
23 | 24 | # \e[31m # red text |
24 | 25 | # \e[36m # cyan text |
25 | 26 | # \e[41m # red background |
26 | 27 | # \e[0m \033[0m # non-colored, non-bold text without background color ( \033[0m has to be used in "awk") |
27 | 28 | # \e[1m \033[1m # bold text ( \033[1m has to be used in "awk") |
28 | 29 |
|
| 30 | +# use unofficial strict mode in order to make bash behave like modern programming languages: |
| 31 | +set -e # exit script immediately, if any command exits with non-zero error code |
| 32 | +set -u # only allow previously defined variables |
| 33 | +set -o pipefail # if one command in a pipe fails, all fail (this is not default behavior!) |
| 34 | + |
29 | 35 |
|
30 | 36 |
|
31 | 37 | # all functions of pacui are defined here in the same order as they appear in pacui's UI (with some helper functions): |
|
0 commit comments