From 8e1c0663dfecc1cd63c8ccc57ee2f3365c307a66 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Tue, 20 Feb 2018 20:53:57 -0700 Subject: Specifiying unicode points rather than the symbols themselves --- scripts/powerline.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/powerline.sh b/scripts/powerline.sh index 5dd6cb5..87fe0c5 100755 --- a/scripts/powerline.sh +++ b/scripts/powerline.sh @@ -1,23 +1,25 @@ #!/usr/bin/env bash -RS="" -LS="" +RS='\ue0bc' +LS='\ue0b8' +WAN_SYMBOL='\uf0ee' +LAN_SYMBOL='\uf0ed' if [[ "$1" == "left" ]]; then - echo -n "#[fg=colour235, bg=colour142] $(tmux display-message -p '#S') #[fg=colour142, bg=colour241]$LS#[default]" + echo -ne "#[fg=colour235, bg=colour142] $(tmux display-message -p '#S') #[fg=colour142, bg=colour241]$LS#[default]" if [[ -f "$HOME/journal.txt" ]]; then LAST_ENTRY=$(tail -n 1 ~/journal.txt | awk '{ $1=""; print }' | cut -c2-40) LAST_ENTRY+="..." else LAST_ENTRY=$(hostname) fi - echo -n "#[fg=colour223, bg=colour241] $LAST_ENTRY #[fg=colour241, bg=colour235]$LS#[default]" + echo -ne "#[fg=colour223, bg=colour241] $LAST_ENTRY #[fg=colour241, bg=colour235]$LS#[default]" fi if [[ "$1" == "right" ]]; then IP_ADDRESS=$(ip addr show | grep "inet[^6]" | grep -v "\(127.0.0.1\|docker\)" | tr -s ' ' | cut -d ' ' -f3 | cut -d '/' -f1) - echo -n "#[fg=colour235, bg=colour241]$RS#[fg=colour223, bg=colour241] ⓛ $IP_ADDRESS" + echo -ne "#[fg=colour235, bg=colour241]$RS#[fg=colour223, bg=colour241] $LAN_SYMBOL $IP_ADDRESS" WAN_IP=$(curl --max-time 2 -s http://whatismyip.akamai.com/) - echo -n " ⓦ $WAN_IP #[default]" + echo -ne " $WAN_SYMBOL $WAN_IP #[default]" DATE=$(date +"%b %d, %H:%M") - echo -n "#[fg=colour241, bg=colour142]$RS#[fg=colour235] $DATE #[default]" + echo -ne "#[fg=colour241, bg=colour142]$RS#[fg=colour235] $DATE #[default]" fi -- cgit v1.2.3