Files
desktop-planer/dev/enable.py
2026-09-18 22:02:53 +02:00

16 lines
577 B
Python
Executable File

#!/usr/bin/env python3
# Trägt eine Extension-UUID in die aktiven GNOME-Extensions ein, falls sie fehlt: dev/enable.py <uuid>
import ast
import subprocess
import sys
uuid = sys.argv[1]
raw = subprocess.check_output(['gsettings', 'get', 'org.gnome.shell', 'enabled-extensions']).decode().strip()
enabled = ast.literal_eval(raw.replace('@as ', ''))
if uuid in enabled:
print(f'{uuid} ist schon aktiviert.')
else:
enabled.append(uuid)
subprocess.check_call(['gsettings', 'set', 'org.gnome.shell', 'enabled-extensions', str(enabled)])
print(f'{uuid} aktiviert.')