From 6876ac5a72097a97abd87faf6d197fe03bf78735 Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 16 Oct 2023 23:49:04 +0200 Subject: [PATCH] statusbar: added background for icons --- .local/bin/tools/statusbar/battery | 2 +- .local/bin/tools/statusbar/clock | 2 +- .local/bin/tools/statusbar/cpu | 4 ++-- .local/bin/tools/statusbar/disk | 2 +- .local/bin/tools/statusbar/internet | 6 +++--- .local/bin/tools/statusbar/memory | 2 +- .local/bin/tools/statusbar/volume | 14 +++++++------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.local/bin/tools/statusbar/battery b/.local/bin/tools/statusbar/battery index a0c5953..00c091f 100755 --- a/.local/bin/tools/statusbar/battery +++ b/.local/bin/tools/statusbar/battery @@ -7,4 +7,4 @@ status=$(cat /sys/class/power_supply/"$1"/status) [ "$status" = "Charging" ] -printf "%s%s" "$(echo "$status" | sed -e "s/,//;s/Discharging//;s/Not charging//;s/Charging//;s/Unknown//;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/' ) " +printf "%s%s" "$(echo "$status" | sed -e "s/,//;s/Discharging/^b#282828^^c#dfdfdf^  ^d^/;s/Not charging/^b#282828^^c#dfdfdf^  ^d^/;s/Charging/^b#282828^^c#dfdfdf^  ^d^/;s/Unknown/^b#282828^^c#dfdfdf^  ^d^/;s/Full/^b#282828^^c#dfdfdf^ ⚡ ^d^/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/' ) " diff --git a/.local/bin/tools/statusbar/clock b/.local/bin/tools/statusbar/clock index 4e3922d..9e844f0 100755 --- a/.local/bin/tools/statusbar/clock +++ b/.local/bin/tools/statusbar/clock @@ -1,3 +1,3 @@ #!/bin/sh -date +" %d %b %H:%M" +date +"^b#282828^^c#dfdfdf^  ^d^ %d %b %H:%M" diff --git a/.local/bin/tools/statusbar/cpu b/.local/bin/tools/statusbar/cpu index cced088..8b028b4 100755 --- a/.local/bin/tools/statusbar/cpu +++ b/.local/bin/tools/statusbar/cpu @@ -1,7 +1,7 @@ #!/bin/sh if [ "$1" = "amd" ]; then - sensors | awk '/Tctl/ {print " " $2}' + sensors | awk '/Tctl/ {print "^b#282828^^c#dfdfdf^  ^d^ " $2}' elif [ "$1" = "intel" ]; then - sensors | awk '/Core 0/ {print " " $3}' + sensors | awk '/Core 0/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3}' fi diff --git a/.local/bin/tools/statusbar/disk b/.local/bin/tools/statusbar/disk index 5989ab5..e912688 100755 --- a/.local/bin/tools/statusbar/disk +++ b/.local/bin/tools/statusbar/disk @@ -8,4 +8,4 @@ disk="/" icon="$disk" -printf "󰗮 %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')" +printf "^b#282828^^c#dfdfdf^ 󰗮 ^d^ %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.local/bin/tools/statusbar/internet b/.local/bin/tools/statusbar/internet index 0d09df0..91dc629 100755 --- a/.local/bin/tools/statusbar/internet +++ b/.local/bin/tools/statusbar/internet @@ -1,8 +1,8 @@ #!/usr/bin/env sh # -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" -%" +[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" ^d^ -%" -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }') +[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print " ^d^", int($3 * 100 / 70) "%" }') -printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down//;s/up/󰈀/")" "$wifiicon" +printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#dfdfdf^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" diff --git a/.local/bin/tools/statusbar/memory b/.local/bin/tools/statusbar/memory index c1f98aa..b88204d 100755 --- a/.local/bin/tools/statusbar/memory +++ b/.local/bin/tools/statusbar/memory @@ -1,3 +1,3 @@ #!/bin/sh -free -h | awk '/^Mem:/ {print " " $3 "/" $2}' +free -h | awk '/^Mem:/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3 "/" $2}' diff --git a/.local/bin/tools/statusbar/volume b/.local/bin/tools/statusbar/volume index 2c07574..d61509f 100755 --- a/.local/bin/tools/statusbar/volume +++ b/.local/bin/tools/statusbar/volume @@ -3,19 +3,19 @@ vol="$(pulsemixer --get-volume | awk '{print $1}')" if [ "$vol" -eq "0" ]; then - icon="" + vol_info=" ^d^ $vol%" elif [ "$vol" -gt "70" ]; then - icon="" + vol_info=" ^d^ $vol%" else - icon="" + vol_info=" ^d^ $vol%" fi -[ "$(pulsemixer --get-mute)" = "1" ] && icon="" && vol="-" +[ "$(pulsemixer --get-mute)" = "1" ] && vol_info=" ^d^ -%" if amixer get Capture | tail -2 | grep -q '\[on\]'; then - mic="" + mic="^b#282828^^c#dfdfdf^  " else - mic="" + mic="^b#282828^^c#dfdfdf^  " fi -printf "%s %s %s\\n" "$mic" "$icon" "$vol%" +printf "%s %s %s\\n" "$mic" "$vol_info"