From ee2d2fb015d050e3476171802b815a9885aad597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Tue, 25 Jul 2023 13:22:19 +0200 Subject: [PATCH] bar --- .../herbstluftwm/executable_panel-handler | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dot_config/herbstluftwm/executable_panel-handler b/dot_config/herbstluftwm/executable_panel-handler index 9c55b2a..c5f8938 100644 --- a/dot_config/herbstluftwm/executable_panel-handler +++ b/dot_config/herbstluftwm/executable_panel-handler @@ -1,4 +1,5 @@ #!/bin/bash +shopt -s extglob hc() { # t="$EPOCHREALTIME" @@ -94,7 +95,7 @@ hc --idle | { done #bordercolor="#26221C" - separator="%{B-}%{F-}|" + separator="%{B-}%{F-}| " #separator="%{B$selbg} %{B-}%{F-}" #right= #for st in playing volume wifi temperature load date @@ -117,7 +118,7 @@ hc --idle | { ### center #echo -n "%{c}%{U${colors[bright_orange]}}${windowtitle:0:150}%{U-}" ### print the right - res+="%{r}$memory $df $playing $separator $volume $separator $wifi $separator $network $separator $temperature $separator $load $separator $date $separator %{U#f2f229}$charge%{U-} $separator" + res+="%{r}$memory$df$playing$volume$wifi$network$temperature$load$separator$date$separator%{U#f2f229}$charge%{U-}$separator" #echo -en "%{r}$right $separator %{U#f2f229}$charge%{U-} $separator" done @@ -183,6 +184,7 @@ hc --idle | { ;; esac playing="$play_sym$play_line" + [[ -n "$playing" ]] && playing+=" $separator" fi # [[ "${player_status[${cmd[1]}]}" != "${cmd[2]}" ]] && @@ -251,24 +253,24 @@ hc --idle | { fi ;; temperature) - temperature=" ${cmd[1]}°C" + temperature=" ${cmd[1]}°C $separator" ;; wifi) _wifi_net="${cmd[1]}" if [[ -n "$_wifi_net" ]] then - _wifi_sym=直 + _wifi_sym=󰖩 else - _wifi_sym=睊 + _wifi_sym=󰖪 fi - wifi="$(xargs <<<"$_wifi_sym $_wifi_net")" + wifi="$(xargs <<<"$_wifi_sym $_wifi_net $separator")" ;; network) _net_status="${cmd[1]}" if [[ "$_net_status" == 'UP' ]] then - network="$(xargs <<<"ﯱ ${cmd[2]}")" + network="$(xargs <<<"󰈀 ${cmd[2]}")" else network= fi @@ -281,9 +283,9 @@ hc --idle | { if [[ "$mute" == yes ]] then - volume="" + volume=" $separator" else - volume=" ${cmd[1]}" + volume=" ${cmd[1]} $separator" fi ;; esac