Review everything shipped this weekend, and fix what the reviewers caught
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -12,9 +12,10 @@ log="$scratch/calls"
|
||||
|
||||
cat >"$scratch/bin/wpctl" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'wpctl' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='wpctl'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
if [[ $1 == "get-volume" ]]; then
|
||||
printf '%s\n' "${WPCTL_OUTPUT:-Volume: 0.58}"
|
||||
fi
|
||||
@@ -22,9 +23,10 @@ SH
|
||||
|
||||
cat >"$scratch/bin/brightnessctl" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'brightnessctl' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='brightnessctl'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
if [[ " $* " == *" -m "* && " $* " != *" set "* ]]; then
|
||||
[[ ${BACKLIGHT_AVAILABLE:-true} == true ]] || exit 1
|
||||
printf '%s\n' "${BRIGHTNESS_OUTPUT:-intel_backlight,backlight,500,50%,1000}"
|
||||
@@ -33,9 +35,10 @@ SH
|
||||
|
||||
cat >"$scratch/bin/panama-brightness" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'panama-brightness' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='panama-brightness'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
|
||||
case "${1:-}" in
|
||||
list)
|
||||
@@ -69,24 +72,27 @@ SH
|
||||
|
||||
cat >"$scratch/bin/hyprctl" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'hyprctl' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='hyprctl'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
printf '[{"name":"%s","focused":true}]\n' "${FOCUSED_MONITOR:-DP-2}"
|
||||
SH
|
||||
|
||||
cat >"$scratch/bin/notify-send" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'notify-send' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='notify-send'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
SH
|
||||
|
||||
cat >"$scratch/bin/playerctl" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'playerctl' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='playerctl'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
if [[ $1 == "metadata" ]]; then
|
||||
printf '%s\n' "${PLAYER_OUTPUT:-Horizon — Tycho}"
|
||||
elif [[ $1 == "status" ]]; then
|
||||
@@ -96,16 +102,18 @@ SH
|
||||
|
||||
cat >"$scratch/bin/pw-play" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'pw-play' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='pw-play'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
SH
|
||||
|
||||
cat >"$scratch/bin/qs" <<'SH'
|
||||
#!/bin/bash
|
||||
printf 'qs' >>"$OSD_TEST_LOG"
|
||||
printf ' <%s>' "$@" >>"$OSD_TEST_LOG"
|
||||
printf '\n' >>"$OSD_TEST_LOG"
|
||||
# One atomic append per call: the blip's pw-play runs in the background
|
||||
# and a multi-write log line would interleave with the next stub's.
|
||||
line='qs'; for a in "$@"; do line+=" <$a>"; done
|
||||
printf '%s\n' "$line" >>"$OSD_TEST_LOG"
|
||||
[[ ${OSD_TEST_FAIL_QS:-false} != true ]]
|
||||
SH
|
||||
|
||||
@@ -123,7 +131,12 @@ mkdir -p "$scratch/config-default"
|
||||
# is what a fresh install looks like: the helper must fall back to the schema
|
||||
# defaults rather than treating an absent file as an error.
|
||||
settings_root() {
|
||||
local name="$1" body="${2:-}" root="$scratch/config-$name"
|
||||
# Three separate statements on purpose: bash expands every word of one
|
||||
# `local` command before performing any of its assignments, so $name in
|
||||
# the third RHS would be unbound (set -u) if these shared a line.
|
||||
local name="$1"
|
||||
local body="${2:-}"
|
||||
local root="$scratch/config-$name"
|
||||
rm -rf "$root"
|
||||
mkdir -p "$root/panama"
|
||||
[[ -n "$body" ]] && printf '%s\n' "$body" >"$root/panama/settings.json"
|
||||
@@ -202,10 +215,10 @@ assert_line 'wpctl <set-mute> <@DEFAULT_AUDIO_SOURCE@> <toggle>'
|
||||
assert_line 'qs <ipc> <call> <osd> <progress> <microphone-muted> <72> <100> <Muted>'
|
||||
|
||||
# ── Over-amplification: the ceiling is a setting, not a constant ─────────────
|
||||
# `wpctl set-volume` clamps to 1.0 unless told otherwise, and it clamps the
|
||||
# *result* -- so the limit has to be on the down step too. Without it, coming
|
||||
# down from 130% would snap to 100% instead of stepping to 124%, which reads as
|
||||
# the slider jumping on its own.
|
||||
# `-l` caps the *result*, and without it wpctl caps nothing -- 100% is not a
|
||||
# ceiling it enforces on its own. The limit is on the down step for that reason:
|
||||
# with over-amplification off, stepping down from a volume already above 100%
|
||||
# has to land under the ceiling rather than merely one step lower.
|
||||
: >"$log"
|
||||
OSD_CONFIG_HOME="$(settings_root overamp '{"overAmplification": true}')" \
|
||||
run_helper volume up 6
|
||||
@@ -245,6 +258,11 @@ assert_line 'qs <ipc> <call> <osd> <progress> <volume> <58> <100> <58%>'
|
||||
# ── The volume blip ─────────────────────────────────────────────────────────
|
||||
# Default on, per the schema, so a settings.json that has never been written
|
||||
# still clicks. Fire-and-forget: the blip must never gate the OSD.
|
||||
#
|
||||
# Each case below awaits its own click before the next one starts, which is also
|
||||
# what keeps them independent: the helper takes a non-blocking lock in its
|
||||
# runtime directory so a held-down volume key clicks once rather than stacking
|
||||
# one pw-play per repeat, and a click still sounding would suppress the next.
|
||||
: >"$log"
|
||||
run_helper volume up 6
|
||||
await_line "pw-play <$blip_sound>"
|
||||
|
||||
Reference in New Issue
Block a user