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

Compare commits

..

3 Commits

Author SHA1 Message Date
9dd7bc87dc statusbar: added color for mute, deaf, etc 2023-10-17 00:40:43 +02:00
6876ac5a72 statusbar: added background for icons 2023-10-16 23:49:04 +02:00
bb7b37bb93 xorg: make dwm restartable 2023-10-16 18:40:25 +02:00
8 changed files with 20 additions and 17 deletions

View File

@ -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/$/%/' ) "

View File

@ -1,3 +1,3 @@
#!/bin/sh
date +" %d %b %H:%M"
date +"^b#282828^^c#dfdfdf^ ^d^ %d %b %H:%M"

View File

@ -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

View File

@ -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}')"

View File

@ -1,8 +1,8 @@
#!/usr/bin/env sh
#
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" -%"
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^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 "^c#dfdfdf^ ^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#ff0000^ /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon"

View File

@ -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}'

View File

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

View File

@ -8,4 +8,7 @@ xrandr --auto
[ -f "$HOME/.config/xorg/xpcspec" ] && xrdb -merge "$HOME/.config/xorg/xpcspec" # local resources
setbg
exec dwm
while true; do
dwm || exit
done