Skip to content

Commit

Permalink
Hostname segment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erikw authored Feb 10, 2025
1 parent b9b3082 commit 67ab5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ is_tmp_valid() {

}

is_command_found () {
command_exists () {
command -v $1 > /dev/null
}
6 changes: 1 addition & 5 deletions segments/hostname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

TMUX_POWERLINE_SEG_HOSTNAME_FORMAT="${TMUX_POWERLINE_SEG_HOSTNAME_FORMAT:-short}"

command_exists() {
command -v $1 > /dev/null
}

generate_segmentrc() {
read -r -d '' rccontents <<EORC
# Use short or long format for the hostname. Can be {"short, long"}.
Expand All @@ -30,7 +26,7 @@ run_segment() {
elif command_exists hostnamectl; then
hostnamectl hostname
else
echo 'Host'
echo 'Hostname could not be determined'
fi
return 0

Expand Down

0 comments on commit 67ab5b5

Please sign in to comment.