Hold power actions to confirm instead of a confirm row

Logout, reboot and shut down now fill with accent liquid while held and
run once full; letting go early drains it. A tap hints to hold. Replaces
the Confirm/Cancel rows in the control center tile and dashboard tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-28 01:05:11 +01:00
1 parent 1e918414d1
commit d37f9b7121
10 files changed
+350 -102

No files matched your search

+5 -6
View File
@@ -80,13 +80,12 @@ with tempfile.TemporaryDirectory(prefix='glassmxrph-controls-') as tmp:
wait(lambda:not state()['busy'] and not state()['error'] and not state()['state']['dnd']['enabled'],'provider recovery')
assert ipc('controlTest','slider','brightnessSlider')
wait(lambda:not state()['busy'] and state()['state']['brightness']['value']>60,'brightness readback')
assert ipc('controlTest','click','power-reboot');assert state()['power']=='reboot'
assert ipc('controlTest','click','power-reboot');assert state()['power']==''
assert ipc('controlTest','hold','power-shutdown',250);assert state()['power']==''
assert not any(json.loads(line)['action']=='power' for line in events.read_text().splitlines())
assert ipc('controlTest','click','powerCancel');assert state()['power']==''
assert ipc('controlTest','click','power-shutdown');ipc('controlTest','pressEscape');wait(lambda:state()['power']=='','Escape cancels pending power')
assert ipc('controlcenter','status')['opened']
assert ipc('controlTest','click','power-reboot');assert ipc('controlTest','click','powerConfirm')
wait(lambda:not state()['busy'],'recorded confirmation')
assert ipc('controlTest','hold','power-reboot',1200)
wait(lambda:not state()['busy'],'recorded hold confirmation')
actions=[json.loads(line) for line in events.read_text().splitlines()]
power=[a for a in actions if a['action']=='power'];assert len(power)==1 and power[0]['value']=='reboot' and power[0]['confirmed'] is True,str(actions)
ipc('controlcenter','close');time.sleep(.3);ipc('controlcenter','open');time.sleep(.35)
@@ -167,4 +166,4 @@ with tempfile.TemporaryDirectory(prefix='glassmxrph-controls-') as tmp:
shell.terminate();shell.wait(timeout=5)
if original:subprocess.run(['hyprctl','dispatch','focusmonitor',original],capture_output=True)
text=log.read_text();assert 'WARN' not in text and 'ERROR' not in text,text
print('PASS: native read-only discovery, active-monitor placement, system pill, recording audio/per-app volume/Caffeine/Game Mode/network/Bluetooth/display/DND actions, free grid edit mode (place, push down, air gaps, resize, remove, add, plugin tiles, reset), power confirmation/cancel, outside/Escape/exclusivity, settings, clean logs.')
print('PASS: native read-only discovery, active-monitor placement, system pill, recording audio/per-app volume/Caffeine/Game Mode/network/Bluetooth/display/DND actions, free grid edit mode (place, push down, air gaps, resize, remove, add, plugin tiles, reset), power hold-to-confirm/early release, outside/Escape/exclusivity, settings, clean logs.')