summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-19 17:00:52 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-19 17:00:52 +0100
commitdba7bbdcf35a123e6106b420d9cc6064528080e0 (patch)
treef73a93f91aefe54274311c862af43fffa02ce7a2 /src/config/ConfigManager.cpp
parent0c88c0310e0b27d6e5cfbaf9896451131f3883c9 (diff)
patches
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index f48f1dcd..ff37f42e 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -22,6 +22,18 @@ CConfigManager::CConfigManager() {
void CConfigManager::init() {
loadConfigLoadVars();
+ const char* const ENVHOME = getenv("HOME");
+
+ const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf");
+
+ struct stat fileStat;
+ int err = stat(CONFIGPATH.c_str(), &fileStat);
+ if (err != 0) {
+ Debug::log(WARN, "Error at statting config, error %i", errno);
+ }
+
+ lastModifyTime = fileStat.st_mtime;
+
isFirstLaunch = false;
}
@@ -86,8 +98,8 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
curitem = argZ.substr(0, idx);
argZ = argZ.substr(idx + 1);
} else {
- argZ = "";
curitem = argZ;
+ argZ = "";
}
};
@@ -268,6 +280,8 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name) {
if (found)
return *found;
+ Debug::log(WARN, "No rule found for %s, trying to use the first.", name.c_str());
+
for (auto& r : m_dMonitorRules) {
if (r.name == "") {
found = &r;
@@ -278,5 +292,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name) {
if (found)
return *found;
+ Debug::log(WARN, "No rules configured. Using the default hardcoded one.");
+
return SMonitorRule{.name = "", .resolution = Vector2D(1280, 720), .offset = Vector2D(0, 0), .mfact = 0.5f, .scale = 1};
} \ No newline at end of file