Fixed wob

This commit is contained in:
ManOfGoldForever 2026-04-07 11:36:59 -04:00
parent b532a2b8f4
commit 29e0e5db25
8 changed files with 52 additions and 11 deletions

View file

@ -51,6 +51,7 @@ for_window [app_id="dev.zed.Zed"] focus
bindsym $mod+e exec $filemanager
# bindsym $mod+w (wallpaper selector removed - using solid color bg)
bindsym $mod+p exec kitty --app-id powermenu fish -c powermenu
for_window [app_id="powermenu"] floating enable
bindsym $mod+s exec steam
bindsym $mod+a exec mumble
@ -155,13 +156,13 @@ for_window [app_id="dev.zed.Zed"] focus
# Utilities:
# Volume
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && (pactl get-sink-mute @DEFAULT_SINK@ | grep -q yes && echo 0 || pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+(?=%)' | head -1) > $XDG_RUNTIME_DIR/wob.sock
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+(?=%)' | head -1 > $XDG_RUNTIME_DIR/wob.sock
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+(?=%)' | head -1 > $XDG_RUNTIME_DIR/wob.sock
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Brightness
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- && brightnessctl get | awk -v max=$(brightnessctl max) '{printf "%d\n", ($1/max)*100}' > $XDG_RUNTIME_DIR/wob.sock
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ && brightnessctl get | awk -v max=$(brightnessctl max) '{printf "%d\n", ($1/max)*100}' > $XDG_RUNTIME_DIR/wob.sock
# Screenshots
bindsym Print exec grim -g "$(slurp)" - | wl-copy
bindsym Shift+Print exec grim - | wl-copy

View file

@ -1,4 +1,5 @@
exec_always autotiling
exec_always ~/.config/sway/wob.sh
exec swayidle -w \
timeout 1800 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"'

View file

@ -0,0 +1,7 @@
#!/bin/bash
while true; do
disk=$(df / --output=pcent 2>/dev/null | tail -1 | tr -d ' ')
datetime=$(date +'%m/%d/%Y %I:%M %p')
echo "$disk $datetime"
sleep 30
done

View file

@ -14,7 +14,7 @@ bar {
position top
workspace_min_width 36
tray_padding 4
status_command while echo "$(df / --output=pcent | tail -1 | tr -d ' ') $(date +'%m/%d/%Y %I:%M %p')"; do sleep 30; done
status_command ~/.config/sway/status.sh
colors {
background #141514
statusline #ef934d

View file

@ -0,0 +1,17 @@
#!/bin/bash
# Wait for pipewire/pulseaudio to be ready
until pactl info &>/dev/null; do
sleep 0.5
done
WOB_SOCK="${XDG_RUNTIME_DIR}/wob.sock"
pactl subscribe 2>/dev/null | grep --line-buffered "sink" | while read -r _; do
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+(?=%)' | head -1)
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -c yes)
if [ "$muted" -gt 0 ]; then
echo 0 > "$WOB_SOCK"
else
echo "$vol" > "$WOB_SOCK"
fi
done