1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-04-20 00:37:44 +02:00

Compare commits

..

6 Commits

Author SHA1 Message Date
3c19fddd90 statusbar: padded percentages 2023-10-17 05:50:31 +02:00
d263af2862 statusbar: padded percentages 2023-10-17 05:39:13 +02:00
5586af4bb5 statusbar: padded percentages 2023-10-17 05:36:31 +02:00
TiynGER
41d182f481 statusbar: adjusted cpu script for intel 2023-10-17 05:25:40 +02:00
0c6942bb7d statusbar: padded percentages 2023-10-17 05:18:46 +02:00
256be15c0f statusbar: shortened disk script 2023-10-17 03:45:04 +02:00
6 changed files with 27 additions and 18 deletions

View File

@ -3,8 +3,7 @@
capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
status=$(cat /sys/class/power_supply/"$1"/status)
[ -z $warn ] && warn=" "
[ "$status" = "Charging" ]
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/$/%/' ) "
icon=$(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")
capacity=$(echo "$capacity" | sed -e 's/$//' )
capacity=$(printf %3s $capacity | tr ' ' ' ')
echo "$icon $capacity%"

View File

@ -1,7 +1,12 @@
#!/bin/sh
icon="^b#282828^^c#dfdfdf^  ^d^ "
if [ "$1" = "amd" ]; then
sensors | awk '/Tctl/ {print "^b#282828^^c#dfdfdf^  ^d^ " $2}'
temp=$(sensors | awk '/Tctl/ {print $2}')
elif [ "$1" = "intel" ]; then
sensors | awk '/Core 0/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3}'
temp=$(sensors | awk '/Package id 0/ {print $4}')
fi
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
echo "$icon$temp°C"

View File

@ -8,4 +8,4 @@ disk="/"
icon="$disk"
printf "^b#282828^^c#dfdfdf^ 󰗮 ^d^ %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')"
printf "^b#282828^^c#dfdfdf^ 󰗮 ^d^ %s\n" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')"

View File

@ -1,8 +1,10 @@
#!/usr/bin/env sh
#
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^ -%"
wifipercent=" ___"
[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "^c#dfdfdf^ ^d^", int($3 * 100 / 70) "%" }')
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^"
printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon"
[ ! -n "${wifiicon+var}" ] && wifiicon="^c#dfdfdf^ ^d^" && wifipercent=$(grep "^\s*w" /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
wifipercent=$(printf %3s $wifipercent | tr ' ' ' ')
echo "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" "$wifipercent%"

View File

@ -1,3 +1,5 @@
#!/bin/sh
free -h | awk '/^Mem:/ {print "^b#282828^^c#dfdfdf^  ^d^ " $3 "/" $2}'
icon="^b#282828^^c#dfdfdf^  ^d^ "
total=$(free -h | awk '/^Mem:/ {print $3/$2}')
echo "$icon$(printf %3s $(echo ${total##*0.} | cut -c1-2) | tr ' ' ' ')%"

View File

@ -3,14 +3,14 @@
vol="$(pulsemixer --get-volume | awk '{print $1}')"
if [ "$vol" -eq "0" ]; then
vol_info="^c#ff0000^ ^d^ $vol%"
vol_info="^c#dfdfdf^ ^d^"
elif [ "$vol" -gt "70" ]; then
vol_info="^c#dfdfdf^ ^d^ $vol%"
vol_info="^c#dfdfdf^ ^d^"
else
vol_info="^c#dfdfdf^ ^d^ $vol%"
vol_info="^c#dfdfdf^ ^d^"
fi
[ "$(pulsemixer --get-mute)" = "1" ] && vol_info="^c#ff0000^ ^d^ -%"
[ "$(pulsemixer --get-mute)" = "1" ] && vol_info="^c#ff0000^ ^d^"
if amixer get Capture | tail -2 | grep -q '\[on\]'; then
mic="^b#282828^^c#dfdfdf^  "
@ -18,4 +18,5 @@ else
mic="^b#282828^^c#ff0000^  "
fi
printf "%s %s %s\\n" "$mic" "$vol_info"
vol=$(printf %3s $vol | tr ' ' ' ')
printf "%s %s %s %s\\n" "$mic" "$vol_info" "$vol%"