Mandate missing monitor.conf check only for functions that depend on it.
This commit is contained in:
+8
-4
@@ -140,23 +140,27 @@ if [[ $(whereis kscreen-doctor) != *"kscreen-doctor" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Import monitor.conf values
|
import_config() {
|
||||||
if source "$CONFIG_FILE"; then
|
if source "$CONFIG_FILE"; then
|
||||||
if [[ $MONITOR == "" ]] || [[ $NATIVE_RES == "" ]] || [[ $TEMP_RES == "" ]]; then
|
if [[ $MONITOR == "" ]] || [[ $NATIVE_RES == "" ]] || [[ $TEMP_RES == "" ]]; then
|
||||||
echo "Error: monitor.conf has not been configured."
|
echo "Error: monitor.conf has not been configured."
|
||||||
exit -2
|
exit -2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Error: monitor.conf file not found. Please ensure it's been properly setup."
|
echo "Error: monitor.conf file not found. Please ensure it's been properly setup."
|
||||||
exit -3
|
exit -3
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Handle Args
|
# Handle Args
|
||||||
if [[ $1 == "-e" ]] || [[ $1 == "--enable" ]]; then
|
if [[ $1 == "-e" ]] || [[ $1 == "--enable" ]]; then
|
||||||
|
import_config
|
||||||
enable_hdr
|
enable_hdr
|
||||||
elif [[ $1 == "-d" ]] || [[ $1 == "--disable" ]]; then
|
elif [[ $1 == "-d" ]] || [[ $1 == "--disable" ]]; then
|
||||||
|
import_config
|
||||||
disable_hdr
|
disable_hdr
|
||||||
elif [[ $1 == "-s" ]] || [[ $1 == "--status" ]]; then
|
elif [[ $1 == "-s" ]] || [[ $1 == "--status" ]]; then
|
||||||
|
import_config
|
||||||
show_hdr_status
|
show_hdr_status
|
||||||
elif [[ $1 == "-v" ]] || [[ $1 == "--version" ]]; then
|
elif [[ $1 == "-v" ]] || [[ $1 == "--version" ]]; then
|
||||||
show_version
|
show_version
|
||||||
|
|||||||
Reference in New Issue
Block a user