Skip to content

Commit

Permalink
allow and opt-out to fancy text features
Browse files Browse the repository at this point in the history
  • Loading branch information
lunarcloud committed Jun 11, 2024
1 parent c3c6f2d commit a582ad0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions script-dialog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fi

# see if it supports colors...
ncolors=$(tput colors)
if [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
if [ "$NOCOLORS" == "" ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
bold="$(tput bold)"
underline="$(tput smul)"
#standout="$(tput smso)"
Expand All @@ -79,8 +79,8 @@ else
yellow=""
fi

# see if we have unicode support
if [[ $LANG == *UTF-8* ]]; then
# see if we have unicode symbols support
if [ "$NOSYMBOLS" == "" ] && [[ $LANG == *UTF-8* ]]; then
INFO_SYMBOL="🛈 "
WARN_SYMBOL="⚠️ "
ERR_SYMBOL=""
Expand Down
5 changes: 3 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

#GUI=false; terminal=false # force relaunching as if launching from GUI without a GUI interface installed, but only do this for testing
#NOSYMBOLS=true
#NOCOLORS=true
# shellcheck source=./script-dialog.sh
source "${SCRIPT_DIR}"/script-dialog.sh

#GUI=false; terminal=false # force relaunching as if launching from GUI without a GUI interface installed, but only do this for testing

relaunchIfNotVisible

APP_NAME="Test Script"
Expand Down

0 comments on commit a582ad0

Please sign in to comment.