diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2023-05-26 21:46:19 +1200 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2023-05-26 21:46:19 +1200 |
| commit | 27137ec9d29c36df8117869773203b243849896c (patch) | |
| tree | 8f457bcc0862ecd176f5fc748b06f66e46082a2e /config.cpp | |
| parent | da3b5b2131d2b4ff5cb127e92090fca568376835 (diff) | |
| download | YATwm-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.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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() |
