Working on dwlb

This commit is contained in:
2025-09-19 11:44:17 -04:00
parent 24725fcdb8
commit e745c93495
18 changed files with 5504 additions and 136 deletions

View File

@@ -0,0 +1,60 @@
#!/bin/sh
# dwlb status script for system information
# This script runs in a loop and updates the dwlb status bar
# Get all available outputs
get_outputs() {
wlr-randr | grep '^[^ ]' | cut -d' ' -f1
}
while true; do
# Get current time
TIME=$(date '+%H:%M:%S')
DATE=$(date '+%a %b %d')
# Get battery info if available
BATTERY=""
if [ -f /sys/class/power_supply/BAT*/capacity ]; then
BAT_LEVEL=$(cat /sys/class/power_supply/BAT*/capacity 2>/dev/null | head -1)
BAT_STATUS=$(cat /sys/class/power_supply/BAT*/status 2>/dev/null | head -1)
if [ -n "$BAT_LEVEL" ]; then
case "$BAT_STATUS" in
"Charging") BAT_ICON="🔌" ;;
"Discharging") BAT_ICON="🔋" ;;
"Full") BAT_ICON="🔋" ;;
*) BAT_ICON="🔋" ;;
esac
BATTERY=" ${BAT_ICON}${BAT_LEVEL}%"
fi
fi
# Get CPU usage
CPU_USAGE=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}' 2>/dev/null || echo "")
if [ -n "$CPU_USAGE" ]; then
CPU=" 💻${CPU_USAGE}"
else
CPU=""
fi
# Get memory usage
MEM_INFO=$(free | grep Mem)
if [ -n "$MEM_INFO" ]; then
MEM_USED=$(echo $MEM_INFO | awk '{printf "%.1f", $3/1024/1024}')
MEM_TOTAL=$(echo $MEM_INFO | awk '{printf "%.1f", $2/1024/1024}')
MEMORY=" 🧠${MEM_USED}/${MEM_TOTAL}GB"
else
MEMORY=""
fi
# Combine status
STATUS="${BATTERY}${CPU}${MEMORY} 📅 ${DATE} 🕒 ${TIME}"
# Send to dwlb for all outputs
for output in $(get_outputs); do
dwlb -status "$output" "$STATUS" 2>/dev/null
done
# Update every 5 seconds
sleep 5
done

8
home/.local/usr/bin/dwlb.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
for output in $(wlr-randr | grep '^[^ ]' | cut -d' ' -f1); do
dwlb -middle-bg-color '#16181a' -active-fg-color '#ffffff' \
-active-bg-color '#5ea1ff' -inactive-fg-color '#ffffff' \
-inactive-bg-color '#3c4048' -urgent-fg-color '#ffffff' \
-urgent-bg-color '#ff6e5e' -font 'FiraCode Nerd Font Mono:size=10' &
done

View File

@@ -35,6 +35,7 @@
autossh
elinks
fastfetch
htop
ranger
mpv
zip
@@ -93,8 +94,8 @@
syncthing
lazygit
gopls
# pyright
ncurses
clang-tools
rustup
wayvnc
gvfs

View File

@@ -100,6 +100,11 @@
dunst
dwl
dwlb
swaybg
simulide
arduino-cli
rpi-imager
wlr-randr
];
programs = {
ghostty = {
@@ -171,32 +176,34 @@
width = 400;
};
style = ''
/* Base */
/* Cyberdream theme for wofi */
window {
background-color: rgba(17, 24, 39, 0.6);
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
background-color: rgba(22, 24, 26, 0.95);
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.2);
border-radius: 1rem;
border: 1px solid rgba(94, 161, 255, 0.3);
font-size: 1rem;
font-family: "FiraCode Nerd Font Mono";
}
window #outer-box { }
window #outer-box #input {
background-color: rgba(17,24,39,0.6);
color: #c0caf5;
background-color: rgba(60, 64, 72, 0.8);
color: #ffffff;
border: none;
border-bottom: 1px solid rgba(17,24,39,0.2);
border-bottom: 1px solid rgba(94, 161, 255, 0.5);
padding: 0.8rem 1rem;
font-size: 1rem;
border-radius: 1rem 1rem 0 0;
}
/* focus states (no #window!) */
/* focus states */
window #outer-box #input:focus,
window #outer-box #input:focus-visible,
window #outer-box #input:active {
border: none;
outline: 2px solid transparent;
outline: 2px solid rgba(94, 161, 255, 0.6);
outline-offset: 2px;
}
@@ -204,8 +211,8 @@
window #outer-box #scroll #inner-box { }
window #outer-box #scroll #inner-box #entry {
color: #c0caf5;
background-color: rgba(17,24,39,0.1);
color: #ffffff;
background-color: rgba(22, 24, 26, 0.3);
padding: 0.6rem 1rem;
}
@@ -215,8 +222,8 @@
}
window #outer-box #scroll #inner-box #entry:selected {
color: #c0caf5;
background-color: rgba(38,50,56,0.1);
color: #ffffff;
background-color: rgba(94, 161, 255, 0.6);
outline: none;
}
'';