Support batched reads in the glass test's recording hyprctl
The customization runtime test's fake hyprctl did not understand `--batch`, so batched HyprGlass reads fell through to the real compositor (writes were still recorded). It now answers batched getoption requests from the record. The glass probe reports why HyprGlass is unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0e43c47bbb
commit
83a0d155ba
2 files changed
+8
-3
No files matched your search
@@ -32,8 +32,13 @@ with tempfile.TemporaryDirectory(prefix='glassmxrph-customization-') as tmp:
|
||||
import json,os,subprocess,sys
|
||||
from pathlib import Path
|
||||
args=sys.argv[1:];p=Path(os.environ['GLASS_TEST_RECORD']);d=json.loads(p.read_text())
|
||||
if 'getoption' in args and args[-1].startswith('plugin:hyprglass:'):
|
||||
k=args[-1].removeprefix('plugin:hyprglass:');v=d[k];print(json.dumps({'str' if isinstance(v,str) else 'float' if isinstance(v,float) else 'int':v,'set':True}))
|
||||
def option(name):
|
||||
k=name.removeprefix('plugin:hyprglass:');v=d[k]
|
||||
return json.dumps({'option':name,'str' if isinstance(v,str) else 'float' if isinstance(v,float) else 'int':v,'set':True})
|
||||
if '--batch' in args and all(c.strip().startswith('getoption plugin:hyprglass:') for c in args[-1].split(';')):
|
||||
print('\\n\\n'.join(option(c.split()[1]) for c in args[-1].split(';')))
|
||||
elif 'getoption' in args and args[-1].startswith('plugin:hyprglass:'):
|
||||
print(option(args[-1]))
|
||||
elif args[0]=='keyword' and args[1].startswith('plugin:hyprglass:'):
|
||||
k=args[1].removeprefix('plugin:hyprglass:');v=args[2]
|
||||
if not isinstance(d[k],str):v=float(v);v=int(v) if v.is_integer() else v
|
||||
|
||||
Reference in new issue
Block a user