Add way to toggle on/off internal display on laptops
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Toggle the internal laptop display on/off.
|
||||||
|
# Useful when connected to an external monitor and you want to close the lid
|
||||||
|
# or just use the external display only.
|
||||||
|
|
||||||
|
INTERNAL=$(hyprctl monitors all -j | jq -r '.[] | select(.name | startswith("eDP")) | .name')
|
||||||
|
|
||||||
|
if [[ -z $INTERNAL ]]; then
|
||||||
|
notify-send -u low " No internal display found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DISABLED=$(hyprctl monitors all -j | jq -r --arg m "$INTERNAL" '.[] | select(.name == $m) | .disabled')
|
||||||
|
|
||||||
|
if [[ $DISABLED == "true" ]]; then
|
||||||
|
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
||||||
|
notify-send -u low " Internal display on"
|
||||||
|
else
|
||||||
|
hyprctl keyword monitor "$INTERNAL,disable"
|
||||||
|
notify-send -u low " Internal display off"
|
||||||
|
fi
|
||||||
+2
-1
@@ -168,7 +168,7 @@ show_share_menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show_toggle_menu() {
|
show_toggle_menu() {
|
||||||
case $(menu "Toggle" " Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Display Scaling") in
|
case $(menu "Toggle" " Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Laptop Display") in
|
||||||
|
|
||||||
*Screensaver*) omarchy-toggle-screensaver ;;
|
*Screensaver*) omarchy-toggle-screensaver ;;
|
||||||
*Nightlight*) omarchy-toggle-nightlight ;;
|
*Nightlight*) omarchy-toggle-nightlight ;;
|
||||||
@@ -178,6 +178,7 @@ show_toggle_menu() {
|
|||||||
*Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;;
|
*Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;;
|
||||||
*Gaps*) omarchy-hyprland-window-gaps-toggle ;;
|
*Gaps*) omarchy-hyprland-window-gaps-toggle ;;
|
||||||
*Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
|
*Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
|
||||||
|
*Laptop*) omarchy-hyprland-monitor-internal-toggle ;;
|
||||||
*) back_to show_trigger_menu ;;
|
*) back_to show_trigger_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user