From 9149f6e34c2bc0f7cfc7908c6b315f8df1d70a28 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Mar 2024 10:04:05 +0530 Subject: [PATCH] Get version of hyprland as well --- kitty/debug_config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kitty/debug_config.py b/kitty/debug_config.py index 1fc0d96d0..1238bf7d4 100644 --- a/kitty/debug_config.py +++ b/kitty/debug_config.py @@ -205,6 +205,13 @@ def compositor_name() -> str: exe = cmdline[0] with suppress(Exception): import subprocess + if exe.lower() == 'hyprland': + raw = subprocess.check_output(['hyprctl', 'version']).decode().strip() + m = re.search(r'^Tag:\s*(\S+)', raw, flags=re.M) + if m is not None: + exe = f'{exe} {m.group(1)}' + else: + exe = raw.splitlines()[0] exe = subprocess.check_output([exe, '--version']).decode().strip().splitlines()[0] ans += f' ({exe})' return ans