add sandbar

This commit is contained in:
desolate
2026-05-16 01:05:36 +03:00
parent ac095191f7
commit d37aada70b
6 changed files with 89 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
FIFO="$XDG_RUNTIME_DIR/sandbar"
[ -e "$FIFO" ] && rm -f "$FIFO"
mkfifo "$FIFO"
while cat "$FIFO"; do :; done | sandbar \
-font "Hack Nerd Font:size=15" \
-active-fg-color "#000000ff" \
-active-bg-color "#ccccccff" \
-inactive-fg-color "#888888ff" \
-inactive-bg-color "#000000ff" \
-urgent-fg-color "#000000" \
-urgent-bg-color "#cc241d" \
-title-fg-color "#aaaaaa" \
-title-bg-color "#000000ff" \
-vertical-padding 4
+3
View File
@@ -19,3 +19,6 @@ pkill -9 pipewire
riverctl spawn 'pipewire'
riverctl spawn 'mako'
riverctl spawn "$HOME/.config/river/bar"
riverctl spawn "$HOME/.config/river/status"
+61
View File
@@ -0,0 +1,61 @@
#!/bin/env sh
cpu()
{
cpu=$(top -bn1 | awk '/Cpu\(s\):/ {print $2 + $4 "%"}')
}
memory()
{
memory=$(free -m | awk '/^Mem:/ {printf "%.1f", $3/2024}')
}
disk() {
disk="$(df -h | awk 'NR==2{print $4}')"
}
cdate()
{
cdate="$(date "+%a %d %b")"
}
ctime()
{
ctime="$(date "+%I:%M:%S %p")"
}
bat() {
# read -r bat_status </sys/class/power_supply/BAT0/status
read -r bat_capacity </sys/class/power_supply/BAT0/capacity
bat="$bat_capacity%"
}
vol() {
vol=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{printf "%.0f%%\n", $2*100}')
}
display() {
echo "all status  $memory  $cpu 󰁹$bat 󰋋 $vol 󰃭 $cdate 󰥔 $ctime" >"$FIFO"
}
printf "%s" "$$" > "$XDG_RUNTIME_DIR/status_pid"
FIFO="$XDG_RUNTIME_DIR/sandbar"
[ -e "$FIFO" ] || mkfifo "$FIFO"
sec=0
while true; do
sleep 1 &
wait && {
[ $((sec % 1)) -eq 0 ] && memory
[ $((sec % 1)) -eq 0 ] && cpu
# [ $((sec % 1)) -eq 0 ] && disk
[ $((sec % 60)) -eq 0 ] && bat
[ $((sec % 1)) -eq 0 ] && vol
[ $((sec % 1)) -eq 0 ] && cdate
[ $((sec % 1)) -eq 0 ] && ctime
[ $((sec % 1)) -eq 0 ] && display
sec=$((sec + 1))
}
done
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
install_package "nerd-fonts"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
install_package "sandbar"
+2
View File
@@ -21,10 +21,12 @@ INSTALLING PACKAGES:
. "$PACKAGES_DIR/install-light.sh"
. "$PACKAGES_DIR/install-mako.sh"
. "$PACKAGES_DIR/install-mesa-dri.sh"
. "$PACKAGES_DIR/install-nerd-fonts.sh"
. "$PACKAGES_DIR/install-noto-fonts.sh"
. "$PACKAGES_DIR/install-pipewire.sh"
. "$PACKAGES_DIR/install-ripgrep.sh"
. "$PACKAGES_DIR/install-river.sh"
. "$PACKAGES_DIR/install-sandbar.sh"
. "$PACKAGES_DIR/install-seatd.sh"
. "$PACKAGES_DIR/install-slurp.sh"
. "$PACKAGES_DIR/install-stow.sh"