16 lines
420 B
Python
Executable file
16 lines
420 B
Python
Executable file
#!/usr/bin/env python3
|
|
import subprocess
|
|
|
|
monitor_data = subprocess.check_output(["hyprctl", "monitors"], text=True)
|
|
lines = monitor_data.split("\n")
|
|
|
|
current_monitor = ""
|
|
|
|
# Recorrer las líneas y buscar el nombre y el estado enfocado
|
|
for line in lines:
|
|
if "Monitor" in line:
|
|
current_monitor = line.split(" ", 1)[1].split(" ")[0]
|
|
|
|
if "focused: yes" in line:
|
|
print(current_monitor)
|
|
break
|