diff --git a/dotfiles/river/.config/river/bar b/dotfiles/river/.config/river/bar new file mode 100755 index 0000000..f4908ff --- /dev/null +++ b/dotfiles/river/.config/river/bar @@ -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 diff --git a/dotfiles/river/.config/river/init b/dotfiles/river/.config/river/init index 2cbec64..dbfa2c0 100755 --- a/dotfiles/river/.config/river/init +++ b/dotfiles/river/.config/river/init @@ -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" diff --git a/dotfiles/river/.config/river/status b/dotfiles/river/.config/river/status new file mode 100755 index 0000000..a2472e1 --- /dev/null +++ b/dotfiles/river/.config/river/status @@ -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 "$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 diff --git a/packages/install-nerd-fonts.sh b/packages/install-nerd-fonts.sh new file mode 100755 index 0000000..f03c98d --- /dev/null +++ b/packages/install-nerd-fonts.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "nerd-fonts" diff --git a/packages/install-sandbar.sh b/packages/install-sandbar.sh new file mode 100755 index 0000000..818f0b2 --- /dev/null +++ b/packages/install-sandbar.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "sandbar" diff --git a/packages/install.sh b/packages/install.sh index 39a24be..5e75b2e 100755 --- a/packages/install.sh +++ b/packages/install.sh @@ -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"