Last active
April 18, 2018 06:34
-
-
Save eyaleizenberg/8ede340db3cf1437ad8c50a306394b3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_hebrew="$(defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources)" | |
lang="EN" | |
if [[ $is_hebrew = *"Hebrew"* ]]; then | |
lang="HE" | |
fi | |
tm_segment "" "colour243" "$lang" | |
tm_divider | |
------------------------------------------------------- | |
This is what I use for the tm_segment and tm_divider | |
tm_segment() { | |
icon=$1 | |
color=$2 | |
text=$3 | |
res="" | |
[[ -z $color ]] && color="colour237" | |
[[ -n $icon ]] && res+="#[ fg=${color}, noreverse] ${icon}" | |
[[ -n $text ]] && res+="#[fg=${color} bg=default, noreverse] ${text} " | |
res+="#[bg=default, fg=default]" | |
echo -ne "$res" | |
} | |
tm_divider() { | |
echo -ne "#[fg=colour237]|#[bg=default, fg=default]" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment