1
0
Fork 0
This commit is contained in:
Vladimír Dudr 2023-07-25 13:22:19 +02:00
parent 76d4d5c21e
commit ee2d2fb015

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
shopt -s extglob
hc() { hc() {
# t="$EPOCHREALTIME" # t="$EPOCHREALTIME"
@ -94,7 +95,7 @@ hc --idle | {
done done
#bordercolor="#26221C" #bordercolor="#26221C"
separator="%{B-}%{F-}|" separator="%{B-}%{F-}| "
#separator="%{B$selbg} %{B-}%{F-}" #separator="%{B$selbg} %{B-}%{F-}"
#right= #right=
#for st in playing volume wifi temperature load date #for st in playing volume wifi temperature load date
@ -117,7 +118,7 @@ hc --idle | {
### center ### center
#echo -n "%{c}%{U${colors[bright_orange]}}${windowtitle:0:150}%{U-}" #echo -n "%{c}%{U${colors[bright_orange]}}${windowtitle:0:150}%{U-}"
### print the right ### 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" #echo -en "%{r}$right $separator %{U#f2f229}$charge%{U-} $separator"
done done
@ -183,6 +184,7 @@ hc --idle | {
;; ;;
esac esac
playing="$play_sym$play_line" playing="$play_sym$play_line"
[[ -n "$playing" ]] && playing+=" $separator"
fi fi
# [[ "${player_status[${cmd[1]}]}" != "${cmd[2]}" ]] && # [[ "${player_status[${cmd[1]}]}" != "${cmd[2]}" ]] &&
@ -251,24 +253,24 @@ hc --idle | {
fi fi
;; ;;
temperature) temperature)
temperature=" ${cmd[1]}°C" temperature=" ${cmd[1]}°C $separator"
;; ;;
wifi) wifi)
_wifi_net="${cmd[1]}" _wifi_net="${cmd[1]}"
if [[ -n "$_wifi_net" ]] if [[ -n "$_wifi_net" ]]
then then
_wifi_sym= _wifi_sym=󰖩
else else
_wifi_sym= _wifi_sym=󰖪
fi fi
wifi="$(xargs <<<"$_wifi_sym $_wifi_net")" wifi="$(xargs <<<"$_wifi_sym $_wifi_net $separator")"
;; ;;
network) network)
_net_status="${cmd[1]}" _net_status="${cmd[1]}"
if [[ "$_net_status" == 'UP' ]] if [[ "$_net_status" == 'UP' ]]
then then
network="$(xargs <<<" ${cmd[2]}")" network="$(xargs <<<"󰈀 ${cmd[2]}")"
else else
network= network=
fi fi
@ -281,9 +283,9 @@ hc --idle | {
if [[ "$mute" == yes ]] if [[ "$mute" == yes ]]
then then
volume="" volume=" $separator"
else else
volume=" ${cmd[1]}" volume=" ${cmd[1]} $separator"
fi fi
;; ;;
esac esac