summaryrefslogtreecommitdiff
path: root/config.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-05-26 21:46:19 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-05-26 21:46:19 +1200
commit27137ec9d29c36df8117869773203b243849896c (patch)
tree8f457bcc0862ecd176f5fc748b06f66e46082a2e /config.cpp
parentda3b5b2131d2b4ff5cb127e92090fca568376835 (diff)
downloadYATwm-27137ec9d29c36df8117869773203b243849896c.tar.gz
YATwm-27137ec9d29c36df8117869773203b243849896c.zip
feat: Made keybinds work (I hope)
Note: the config file reloading keybinds isn't quite working, though, need to ungrab the keys
Diffstat (limited to 'config.cpp')
-rw-r--r--config.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/config.cpp b/config.cpp
index 101af24..6d8215c 100644
--- a/config.cpp
+++ b/config.cpp
@@ -1,5 +1,6 @@
#include "config.h"
#include "commands.h"
+#include "error.h"
#include <X11/Xlib.h>
@@ -66,6 +67,7 @@ const void Config::focChange(const CommandArg* argv)
}
const void Config::reload(const CommandArg* argv)
{
+ // Note: this is kinda broken cos it doesn't ungrab keys, i'll do that later.
cout << "Reloading config" << endl;
reloadFile();
}
@@ -116,14 +118,14 @@ Config::Config(CommandsModule& commandsModule)
commandsModule.addCommand("addworkspace", &Config::addWorkspaceCmd, 2, addWorkspaceArgs, this);
}
-void Config::reloadFile()
+Err Config::reloadFile()
{
if(!loaded)
- return;
- loadFromFile(file);
+ return {CFG_ERR_NON_FATAL, "Not loaded config yet"};
+ return loadFromFile(file);
}
-void Config::loadFromFile(string path)
+Err Config::loadFromFile(string path)
{
file = path;
//Set defaults
@@ -152,6 +154,7 @@ void Config::loadFromFile(string path)
line++;
}
loaded = true;
+ return {NOERR, ""};
}
Config::~Config()