Mandate missing monitor.conf check only for functions that depend on it.

This commit is contained in:
2025-10-08 23:41:01 +01:00
parent 4e16d193f7
commit dd0abcf958
+5 -1
View File
@@ -140,7 +140,7 @@ if [[ $(whereis kscreen-doctor) != *"kscreen-doctor" ]]; then
fi
# Import monitor.conf values
import_config() {
if source "$CONFIG_FILE"; then
if [[ $MONITOR == "" ]] || [[ $NATIVE_RES == "" ]] || [[ $TEMP_RES == "" ]]; then
echo "Error: monitor.conf has not been configured."
@@ -150,13 +150,17 @@ else
echo "Error: monitor.conf file not found. Please ensure it's been properly setup."
exit -3
fi
}
# Handle Args
if [[ $1 == "-e" ]] || [[ $1 == "--enable" ]]; then
import_config
enable_hdr
elif [[ $1 == "-d" ]] || [[ $1 == "--disable" ]]; then
import_config
disable_hdr
elif [[ $1 == "-s" ]] || [[ $1 == "--status" ]]; then
import_config
show_hdr_status
elif [[ $1 == "-v" ]] || [[ $1 == "--version" ]]; then
show_version