From aa1500fea32db04c9e4fe72786ebd7e3479b6a8a Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sat, 4 Jan 2025 15:14:05 +1300 Subject: feat: Commands restructure + home manager module now makes config Commands module is now a separate libraray that the flake includes. The home manager module will now auto generate the config and has options for different things such as keybinds, gaps, workspaces, etc. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index da1ae9b..3e01b4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,7 +36,8 @@ #include "config.h" #include "util.h" #include "ewmh.h" -#include "error.h" +//TODO: FIX THIS +#include using std::cout; using std::string; -- cgit v1.2.3 From 63005f5fc81e9b641f07eadb5f07bc7c532d40c7 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sat, 4 Jan 2025 20:50:44 +1300 Subject: feat: Added new command line option --config (-c) The new options allows you to specify the location of the config file in the arguments to the program. --- src/main.cpp | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3e01b4d..291151f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include @@ -36,8 +35,7 @@ #include "config.h" #include "util.h" #include "ewmh.h" -//TODO: FIX THIS -#include +#include "error.h" using std::cout; using std::string; @@ -1030,13 +1028,15 @@ int main(int argc, char** argv) { int versionFlag = 0; bool immediateExit = false; + string configLocation = ""; while(1) { static option long_options[] = {{"version", no_argument, &versionFlag, 1}, + {"config", required_argument, NULL, 'c'}, {0, 0, 0, 0}}; int optionIndex; - char c = getopt_long(argc, argv, "v", long_options, &optionIndex); + char c = getopt_long(argc, argv, "c:v", long_options, &optionIndex); if(c == -1) break; @@ -1048,8 +1048,12 @@ int main(int argc, char** argv) break; //Option had arg break; + case 'c': + configLocation = string(optarg); + break; case 'v': versionFlag = 1; + break; case '?': //Error?? break; @@ -1124,16 +1128,19 @@ int main(int argc, char** argv) std::vector cfgErr; cout << "Registered commands" << endl; - - char* confDir = getenv("XDG_CONFIG_HOME"); - if(confDir != NULL) - { - cfgErr = cfg.loadFromFile(string(confDir) + "/YATwm/config"); - } + + if(configLocation != "") + cfgErr = cfg.loadFromFile(configLocation); else { - string home = getenv("HOME"); - cfgErr = cfg.loadFromFile(home + "/.config/YATwm/config"); + char* confDir = getenv("XDG_CONFIG_HOME"); + if(confDir != NULL) + cfgErr = cfg.loadFromFile(string(confDir) + "/YATwm/config"); + else + { + string home = getenv("HOME"); + cfgErr = cfg.loadFromFile(home + "/.config/YATwm/config"); + } } cout << "Done config" << endl; @@ -1234,7 +1241,6 @@ int main(int argc, char** argv) } if(ready == -1) { - cout << "E" << endl; log("ERROR"); } } -- cgit v1.2.3 From 74c58cdf74c4921071da93c4cbfaf22f672242a5 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Thu, 6 Mar 2025 21:26:04 +1300 Subject: feat: Added the "S" modifier to the emacs bind mode You can now use S as a modifier for shift when binding with emacs mode if you're unable to capatilise the key to be bound. --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 291151f..45e4eba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3