Reorder Control Center modules by drag and drop

Rows drag from anywhere (or the grip, Ctrl+Up/Down from the keyboard) with
an accent drop indicator, replacing the up/down buttons. The Control Center
runtime test drags instead of clicking, and turns off built-in notifications
since the live shell owns the bus name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-15 14:55:15 +02:00
1 parent 395de70b26
commit 0b3bb83bc9
3 files changed
+157 -30

No files matched your search

+4 -2
View File
@@ -22,7 +22,8 @@ log=ROOT/'.cache/controlcenter-runtime.log';log.parent.mkdir(exist_ok=True)
monitors=json.loads(subprocess.check_output(['hyprctl','monitors','-j'],text=True));original=next((m['name'] for m in monitors if m['focused']),None)
with tempfile.TemporaryDirectory(prefix='glassmxrph-controls-') as tmp:
events=Path(tmp)/'events';cfg=Path(tmp)/'config/glassMxrph/config.json';cfg.parent.mkdir(parents=True)
cfg.write_text(json.dumps({'schemaVersion':3,'media':{'enabled':False},'dock':{'enabled':False}}))
# The user's live shell owns the notification bus name; a second server would warn.
cfg.write_text(json.dumps({'schemaVersion':3,'media':{'enabled':False},'dock':{'enabled':False},'notifications':{'enabled':False}}))
env=dict(os.environ,XDG_CONFIG_HOME=tmp+'/config',XDG_STATE_HOME=tmp+'/state',XDG_CACHE_HOME=tmp+'/cache',GLASSMXRPH_CONTROL_TESTING='1',GLASSMXRPH_SYSTEM_EVENTS=str(events),QT_QPA_PLATFORMTHEME='',QT_NO_XDG_DESKTOP_PORTAL='1')
with log.open('w') as output:
shell=subprocess.Popen([str(ROOT/'scripts/glassmxrph'),'run'],env=env,stdout=output,stderr=subprocess.STDOUT)
@@ -84,7 +85,8 @@ with tempfile.TemporaryDirectory(prefix='glassmxrph-controls-') as tmp:
pref('animation.reducedMotion',False)
ipc('controlcenter','open');ipc('launcher','open');wait(lambda:not ipc('controlcenter','status')['opened'],'launcher exclusivity');ipc('launcher','close')
ipc('shell','openSettings','controlcenter');wait(lambda:state()['settingsVisible'],'module editor opens');time.sleep(.3)
assert ipc('controlTest','settingsClick','control-down-connectivity')
second=state()['modules'][1]['id']
assert ipc('controlTest','settingsDrag','control-drag-connectivity','control-drag-'+second)
wait(lambda:state()['modules'][1]['id']=='connectivity','visual module reorder')
assert ipc('controlTest','settingsClick','control-enable-audio')
wait(lambda:not next(m for m in state()['modules'] if m['id']=='audio')['enabled'],'visual module toggle')