better swaybar status
This commit is contained in:
parent
23a036ff41
commit
05a976e654
|
@ -1,17 +1,60 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
c_dark="#181825"
|
||||||
|
c_sep="#313244"
|
||||||
|
c_bar="#89b4fa"
|
||||||
|
c_on="#a6e3a1"
|
||||||
|
c_off="#f38ba8"
|
||||||
|
c_icon="#6c7086"
|
||||||
|
separator="<span foreground='$c_sep'> </span>"
|
||||||
|
|
||||||
|
print_stat() {
|
||||||
|
icon=$1
|
||||||
|
content=$2
|
||||||
|
if [ "$icon" = "░" ]; then
|
||||||
|
icon=' '
|
||||||
|
fi
|
||||||
|
echo -n "<span background='$c_dark' foreground='$c_bar'>$icon</span>"
|
||||||
|
printf "%3d%%" "$content"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_icon() {
|
||||||
|
icon=$1
|
||||||
|
echo -n "<span foreground='$c_icon'>$icon </span>"
|
||||||
|
}
|
||||||
|
|
||||||
|
read -r -d '' -a cpu < <(sicli -i cpu -p0)
|
||||||
|
read -r -d '' -a ram < <(sicli -i memory -p0)
|
||||||
|
read -r -d '' -a disk1 < <(sicli -i disk -p0 -r /)
|
||||||
|
read -r -d '' -a disk2 < <(sicli -i disk -p0 -r /home)
|
||||||
|
|
||||||
|
timew="$(timew summary | tail -n2 | head -n1 | awk '{ print $1 }' | sed 's/:[0-9]\+$//')"
|
||||||
|
if [ "$timew" = "No" ]; then
|
||||||
|
timew="0:00"
|
||||||
|
fi
|
||||||
|
if [ "$(timew get dom.active)" = "1" ]; then
|
||||||
|
timew="<span foreground='$c_on'>+$timew</span>"
|
||||||
|
else
|
||||||
|
timew="<span foreground='$c_off'>-$timew</span>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
clock=$(date +'%a %b %d %H:%M')
|
||||||
|
|
||||||
status=$(
|
status=$(
|
||||||
if [ "$(timew get dom.active)" = "1" ]; then
|
#echo -n "$blue $cpu $separator $blue $ram $separator $blue $disk1 $blue$disk2 $separator "
|
||||||
echo -n '+'
|
print_icon ""
|
||||||
else
|
print_stat "${cpu[0]}" "${cpu[1]}"
|
||||||
echo -n '-'
|
echo -n " $separator "
|
||||||
fi
|
print_icon ""
|
||||||
time=$(timew summary | tail -n2 | head -n1 | awk '{ print $1 }' | sed 's/:[0-9]\+$//')
|
print_stat "${ram[0]}" "${ram[1]}"
|
||||||
if [ "$time" != "No" ]; then
|
echo -n " $separator "
|
||||||
echo -n "$time"
|
print_icon ""
|
||||||
else
|
print_stat "${disk1[0]}" "${disk1[1]}"
|
||||||
echo -n '0:00'
|
echo -n ' '
|
||||||
fi
|
print_stat "${disk2[0]}" "${disk2[1]}"
|
||||||
echo -n ' | '
|
echo -n " $separator "
|
||||||
date +'%a %b %d %H:%M'
|
print_icon ""
|
||||||
|
echo -n "$timew"
|
||||||
|
echo -n " $separator <span foreground='$c_icon'></span> $clock"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "$status"
|
echo "$status"
|
||||||
|
|
|
@ -3,13 +3,7 @@ set $term foot
|
||||||
set $menu fuzzel
|
set $menu fuzzel
|
||||||
set $wobpipe /run/user/1000/wobpipe
|
set $wobpipe /run/user/1000/wobpipe
|
||||||
|
|
||||||
exec dbus-update-activation-environment \
|
exec dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
||||||
PATH LD_LIBRARY_PATH \
|
|
||||||
DISPLAY WAYLAND_DISPLAY SWAYSOCK \
|
|
||||||
XDG_CURRENT_DESKTOP=sway \
|
|
||||||
MOZ_ENABLE_WAYLAND=1 \
|
|
||||||
ELECTRON_OZONE_PLATFORM_HINT=wayland \
|
|
||||||
QT_QPA_PLATFORMTHEME=qt6ct
|
|
||||||
|
|
||||||
exec mkfifo $wobpipe
|
exec mkfifo $wobpipe
|
||||||
exec tail -f $wobpipe | wob
|
exec tail -f $wobpipe | wob
|
||||||
|
|
|
@ -2,6 +2,7 @@ bar {
|
||||||
position top
|
position top
|
||||||
font monospace 13
|
font monospace 13
|
||||||
status_command while ~/skynet/scripts/swaystatus.sh; do sleep 1; done
|
status_command while ~/skynet/scripts/swaystatus.sh; do sleep 1; done
|
||||||
|
pango_markup enabled
|
||||||
|
|
||||||
colors {
|
colors {
|
||||||
background $base
|
background $base
|
||||||
|
|
|
@ -5,6 +5,12 @@ export HISTSIZE=100000
|
||||||
export HISTFILE="$HOME/.zsh_history"
|
export HISTFILE="$HOME/.zsh_history"
|
||||||
export SAVEHIST=$HISTSIZE
|
export SAVEHIST=$HISTSIZE
|
||||||
|
|
||||||
|
# wayland env
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
export ELECTRON_OZONE_PLATFORM_HINT=wayland
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt6ct
|
||||||
|
|
||||||
# set zsh options and features
|
# set zsh options and features
|
||||||
setopt autocd
|
setopt autocd
|
||||||
autoload -Uz compinit && compinit
|
autoload -Uz compinit && compinit
|
||||||
|
|
Loading…
Reference in New Issue