18 lines
408 B
Bash
Executable file
18 lines
408 B
Bash
Executable file
#!/usr/bin/bash
|
|
|
|
MONITOR_DATA=$(hyprctl monitors)
|
|
readarray -t LINES <<<"$MONITOR_DATA"
|
|
|
|
CURRENT_MONITOR=""
|
|
|
|
# Recorrer las líneas y buscar el nombre y el estado enfocado
|
|
for LINE in "${LINES[@]}"; do
|
|
if [[ $LINE == *"Monitor"* ]]; then
|
|
CURRENT_MONITOR=$(echo $LINE | awk '{print $2}')
|
|
fi
|
|
|
|
if [[ $LINE == *"focused: yes"* ]]; then
|
|
echo $CURRENT_MONITOR
|
|
break
|
|
fi
|
|
done
|