Change the way qtile handles colors in statusbar.

This commit is contained in:
Bartek Stalewski 2022-11-04 02:46:17 +01:00
parent 1b6c5cca0b
commit 3e706f9ca6
4 changed files with 20 additions and 13 deletions

View File

@ -1,8 +1,6 @@
#!/bin/bash
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) printf "<span foreground='#000000' background='#ff3333'>no wifi</span>" ;;
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] || printf "<span foreground='#000000' background='#ff3333'>no ip</span>"
# && printf "$icon $(iwgetid -r)" \
down) printf "no wifi" ;;
up) [ -n "$(ip address show dev wlan0 | grep 'inet ')" ] || printf "no ip" ;;
esac

View File

@ -9,7 +9,7 @@ if [ $1 ]; then
dunstify -u low -h int:value:$volume -r 20 -t 800 "volume: $volume"
else
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="<span foreground='#ffffff' background='#770000'> \uf131 </span> " || micmute=""
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="\uf131" || micmute=""
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "${micmute} <span foreground='#ffffff' background='#770000'> \ufc5d </span>" || printf "$micmute"
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "${micmute} \ufc5d" || printf "$micmute"
fi

View File

@ -1,6 +1,6 @@
#!/bin/sh
case $(cat $XDG_CACHE_HOME/yubikey.status) in
*_1) printf " <span foreground='#000000' background='#e7c547'>touch the yubikey</span>" ;;
*_1) printf "touch the yubikey" ;;
*) printf "" ;;
esac

View File

@ -103,9 +103,9 @@ layouts = [
]
widget_defaults = dict(
foreground='#e6e1cf',
background='#0f1419',
font="RobotoMono Nerd Font",
foreground='#e6e1cf',
font="RobotoMono Nerd Font Medium",
fontsize=14,
)
extension_defaults = widget_defaults.copy()
@ -122,24 +122,33 @@ screens = [
urgent_alert_method='block',
urgent_border='#ff3333',
),
widget.GenPollText(
update_interval=0.5,
func=lambda: subprocess.check_output("sb-yubikey").decode(),
),
widget.Prompt(
prompt='open: ',
record_history=False,
),
widget.Spacer(),
widget.GenPollText(
background='#e8b923',
foreground='#000000',
font='RobotoMono Nerd Font Bold',
update_interval=0.5,
func=lambda: subprocess.check_output("sb-yubikey").decode(),
),
widget.GenPollText(
background='#36a3d9',
foreground='#000000',
update_interval=1,
func=lambda: subprocess.check_output("sb-mail").decode(),
),
widget.GenPollText(
background='#ff3333',
foreground='#000000',
update_interval=1,
func=lambda: subprocess.check_output("sb-network").decode(),
),
widget.GenPollText(
background='#ff3333',
foreground='#000000',
update_interval=1,
func=lambda: subprocess.check_output("sb-volume").decode(),
),