mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Fix internal monitor disable for non-eDP-1 systems (#5511)
Detect the internal monitor name dynamically at runtime instead of hardcoding eDP-1 in a static toggle conf file. Uses the same pattern as omarchy-hyprland-monitor-internal-mirror. Fixes #5443
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
TOGGLE="internal-monitor-disable"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf"
|
||||
MIRROR_TOGGLE="internal-monitor-mirror"
|
||||
|
||||
# Get internal monitor name dynamically
|
||||
INTERNAL=$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP")).name' | head -n 1)
|
||||
|
||||
enable() {
|
||||
if omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle --disabled-notification " Laptop display enabled" "$TOGGLE"
|
||||
@@ -10,14 +14,15 @@ enable() {
|
||||
}
|
||||
|
||||
disable() {
|
||||
if omarchy-hw-external-monitors; then
|
||||
if omarchy-hyprland-toggle-disabled "$TOGGLE" && omarchy-hyprland-toggle-disabled "$MIRROR_TOGGLE"; then
|
||||
omarchy-hyprland-toggle --enabled-notification " Laptop display disabled" "$TOGGLE"
|
||||
fi
|
||||
else
|
||||
if ! omarchy-hw-external-monitors; then
|
||||
notify-send -u low " Can't disable the only active display"
|
||||
exit 1
|
||||
fi
|
||||
if omarchy-hyprland-toggle-disabled "$TOGGLE" && omarchy-hyprland-toggle-disabled "$MIRROR_TOGGLE"; then
|
||||
echo "monitor=$INTERNAL,disable" >"$TOGGLE_FLAG"
|
||||
notify-send -u low " Laptop display disabled"
|
||||
hyprctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
recover() {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Disable the internal laptop monitor
|
||||
monitor=eDP-1,disable
|
||||
Reference in New Issue
Block a user