Add hypr_mon_guard

This commit is contained in:
clsty
2025-11-13 01:05:18 +08:00
parent 1844d12bc5
commit 6889185c3e
3 changed files with 33 additions and 4 deletions
+6 -3
View File
@@ -21,6 +21,8 @@ Options:
-h, --help Show this help message and exit
-c, --clean Clean all tester monitors and wayvnc sessions and exit
-d, --daemon Run in background
-g, --guard Enable hypr_mon_guard so it will be safe to
temporarily disable monitors using hyprctl.
For the syntax of following options, see also Hyprland Wiki:
https://wiki.hypr.land/Configuring/Monitors
@@ -29,7 +31,7 @@ For the syntax of following options, see also Hyprland Wiki:
--pos <pos> Position, by default ${STY_UNDERLINE}$VMON_POSITION${STY_RST}
Examples: ${STY_UNDERLINE}auto-left${STY_RST}, ${STY_UNDERLINE}0x-1080${STY_RST}
--sca <sca> Scale, by default ${STY_UNDERLINE}$VMON_SCALE${STY_RST}
--ext <ext> Extra args, e.g. ${STY_UNDERLINE}transform, 1${STY_RST}
--ext <ext> Extra properties, e.g. ${STY_UNDERLINE}transform, 1${STY_RST}
Tip: Recommended VNC client:
- Android: AVNC (https://github.com/gujjwal00/avnc)
@@ -39,8 +41,8 @@ Tip: Recommended VNC client:
}
# `man getopt` to see more
para=$(getopt \
-o hcd \
-l help,clean,daemon,res:,fps:,pos:,sca:,ext: \
-o hcdg \
-l help,clean,daemon,guard,res:,fps:,pos:,sca:,ext: \
-n "$0" -- "$@")
[ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1
#####################################################################################
@@ -58,6 +60,7 @@ while true ; do
case "$1" in
-c|--clean) CLEAN_TESTER_MONITORS=true;shift;;
-d|--daemon) RUNNING_IN_BACKGROUND=true;shift;;
-g|--guard) ENABLE_HYPR_MON_GUARD=true;shift;;
--res) VMON_RESOLUTION="$2";shift 2;;
--fps) VMON_FPS="$2";shift 2;;
--pos) VMON_POSITION="$2";shift 2;;