mirror of
https://github.com/tanrax/maza-ad-blocking.git
synced 2025-11-27 12:54:35 +01:00
Implement terminal color detection
Add terminal color support based on output type
This commit is contained in:
12
maza
12
maza
@@ -11,9 +11,15 @@ THIS_OS=$(uname -mrs)
|
|||||||
PROGNAME=$(basename "$0")
|
PROGNAME=$(basename "$0")
|
||||||
[[ -z "${XDG_CONFIG_HOME}" ]] && CONFIG=$HOME/.config/maza/ || CONFIG=$XDG_CONFIG_HOME/maza/
|
[[ -z "${XDG_CONFIG_HOME}" ]] && CONFIG=$HOME/.config/maza/ || CONFIG=$XDG_CONFIG_HOME/maza/
|
||||||
HOST_FILE=/etc/hosts
|
HOST_FILE=/etc/hosts
|
||||||
COLOR_RED=$(tput setaf 1)
|
if [ -t 1 ]; then
|
||||||
COLOR_GREEN=$(tput setaf 2)
|
COLOR_RED=$(tput setaf 1 2>/dev/null || true)
|
||||||
COLOR_RESET=$(tput sgr0)
|
COLOR_GREEN=$(tput setaf 2 2>/dev/null || true)
|
||||||
|
COLOR_RESET=$(tput sgr0 2>/dev/null || true)
|
||||||
|
else
|
||||||
|
COLOR_RED=""
|
||||||
|
COLOR_GREEN=""
|
||||||
|
COLOR_RESET=""
|
||||||
|
fi
|
||||||
LIST="list"
|
LIST="list"
|
||||||
LIST_DNSMASQ="dnsmasq.conf"
|
LIST_DNSMASQ="dnsmasq.conf"
|
||||||
CUSTOM_DOMAINS="custom-domains"
|
CUSTOM_DOMAINS="custom-domains"
|
||||||
|
|||||||
Reference in New Issue
Block a user