aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-11-01 17:48:14 -0600
committerCraig Jennings <c@cjennings.net>2026-11-01 17:48:14 -0600
commit0697f1856531cf1700a41ba058c7177257a3b6cf (patch)
tree1a314476e4bfe49caca1e4a7b6e43e8131216dc7 /scripts/testing
parente530fd597b62bda520f9804be7da216eea582750 (diff)
downloadarchsetup-0697f1856531cf1700a41ba058c7177257a3b6cf.tar.gz
archsetup-0697f1856531cf1700a41ba058c7177257a3b6cf.zip
test(desktop): check the Hyprland Lua config instead of hyprland.conf
Hyprland 0.57 removed .conf support, so the desktop checks now read hyprland.lua. The bt-panel check matches the whole Super+Shift+B bind, because the bare binary name still appears when the chord is mangled.
Diffstat (limited to 'scripts/testing')
-rw-r--r--scripts/testing/tests/test_desktop.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/testing/tests/test_desktop.py b/scripts/testing/tests/test_desktop.py
index 1538d6a..ca2f266 100644
--- a/scripts/testing/tests/test_desktop.py
+++ b/scripts/testing/tests/test_desktop.py
@@ -11,6 +11,8 @@ installs `awww` (swww successor) and `pacman -Q swww` no longer matches — so
this checks awww. That divergence from the shell sweep is a correctness fix.
"""
+import re
+
import pytest
@@ -19,8 +21,12 @@ HYPRLAND_TOOLS = [
"awww", "grim", "slurp", "gammastep", "foot",
]
+# Note: hyprland.lua sits beside two .conf files on purpose. Only Hyprland's own
+# config format is deprecated (removed in 0.57); hypridle and hyprlock are
+# separate projects still on hyprlang, so their .conf names are current. Don't
+# "fix" this list for consistency -- that reverts the Lua port.
HYPRLAND_CONFIGS = [
- ".config/hypr/hyprland.conf",
+ ".config/hypr/hyprland.lua",
".config/hypr/hypridle.conf",
".config/hypr/hyprlock.conf",
".config/waybar/config",
@@ -139,8 +145,19 @@ def test_bt_panel_wired(host, hyprland_installed, home):
waybar = host.file("%s/.config/waybar/config" % home)
assert "custom/bluetooth" in waybar.content_string, \
"waybar config lacks the custom/bluetooth module"
- hyprconf = host.file("%s/.config/hypr/hyprland.conf" % home)
- assert "bt-panel" in hyprconf.content_string, \
- "hyprland.conf lacks the bt-panel keybind"
+ hypr = host.file("%s/.config/hypr/hyprland.lua" % home).content_string
+ # Assert the dispatcher and the chord, not the bare binary name. "bt-panel"
+ # on its own still appears inside exec_cmd() when the chord that reaches it
+ # is mangled, so the weak form passes on a config where Super+Shift+B does
+ # nothing. That is not hypothetical: converting this config to Lua produced
+ # exactly that defect elsewhere ("CTRL" .. mod .. " + S" collapsing to an
+ # unparseable CTRLSUPER + S, which Hyprland rejects at parse and leaves dead).
+ # One pattern spanning the whole bind, not two independent checks: asserting
+ # the chord and the dispatcher separately passes when they sit on different
+ # lines, and a planned reshuffle of the panel keybinding family is exactly
+ # the change that would separate them.
+ assert re.search(
+ r'hl\.bind\(\s*mod\s*\.\.\s*" \+ SHIFT \+ B",\s*hl\.dsp\.exec_cmd\("bt-panel"\)',
+ hypr), "hyprland.lua lacks the Super+Shift+B bind reaching bt-panel"
assert host.file("%s/.config/themes/dupre/panel.css" % home).exists, \
"shared panel css missing from the stowed theme"