Skip to content

Commit

Permalink
Make hostname widget disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
thassiov committed Aug 6, 2024
1 parent 16668da commit 9fb1dcf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/hostname-widget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
. "${ROOT_DIR}/lib/coreutils-compat.sh"

# Grab global variable for showing hostname widget, only hide if explicitly disabled
SHOW_HOSTNAME=$(tmux show-option -gv @tokyo-night-tmux_show_hostname 2>/dev/null)
if [[ $SHOW_HOSTNAME == "0" ]]; then
exit 0
fi
# Check if enabled
ENABLED=$(tmux show-option -gv @tokyo-night-tmux_show_hostname 2>/dev/null)
[[ ${ENABLED} -ne 1 ]] && exit 0

CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $CURRENT_DIR/themes.sh

hostname=$(hostnamectl hostname)
chassis_icon=$(hostnamectl | grep Chassis | xargs | cut -d " " -f3)

echo "#[fg=red,bold,bg=default]░ @ #[fg=brightwhite,bg=${THEME[background]}]${hostname}"

0 comments on commit 9fb1dcf

Please sign in to comment.