diff --git a/example/hypr.conf b/example/hypr.conf index c51a1d9..35ba4c5 100644 --- a/example/hypr.conf +++ b/example/hypr.conf @@ -6,10 +6,14 @@ gaps_in=5 border_size=1 gaps_out=20 -bar_height=15 +bar_height=20 max_fps=60 +# colors +col.active_border=0x77ff3333 +col.inactive_border=0x77222222 + # keybinds bind=SUPER,R,exec,dmenu_run bind=SUPER,Q,exec,kitty diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 346e8cc..f1215d2 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -19,6 +19,11 @@ void ConfigManager::init() { configValues["bar_monitor"].intValue = 0; configValues["bar_height"].intValue = 15; + + // Set Colors ARGB + configValues["col.active_border"].intValue = 0x77FF3333; + configValues["col.inactive_border"].intValue = 0x77222222; + loadConfigLoadVars(); } @@ -88,7 +93,12 @@ void parseLine(std::string& line) { auto& CONFIGENTRY = ConfigManager::configValues.at(COMMAND); if (CONFIGENTRY.intValue != -1) { try { - CONFIGENTRY.intValue = stoi(VALUE); + if (VALUE.find("0x") == 0) { + // Values with 0x are hex + const auto VALUEWITHOUTHEX = VALUE.substr(2); + CONFIGENTRY.intValue = stoi(VALUEWITHOUTHEX, nullptr, 16); + } else + CONFIGENTRY.intValue = stoi(VALUE); } catch (...) { Debug::log(WARN, "Error reading value of " + COMMAND); } diff --git a/src/windowManager.cpp b/src/windowManager.cpp index cf94b5a..cf8e70a 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -149,7 +149,7 @@ void CWindowManager::setupManager() { updateBarInfo(); // start its' update thread - Events::setThread(); + //Events::setThread(); Debug::log(LOG, "Bar done."); @@ -312,11 +312,10 @@ void CWindowManager::refreshDirtyWindows() { Values[0] = (int)ConfigManager::getInt("border_size"); xcb_configure_window(DisplayConnection, window.getDrawable(), XCB_CONFIG_WINDOW_BORDER_WIDTH, Values); - Values[0] = 0xFF3333; // RED :) + Values[0] = ConfigManager::getInt("col.active_border"); xcb_change_window_attributes(DisplayConnection, window.getDrawable(), XCB_CW_BORDER_PIXEL, Values); } else { - - Values[0] = 0x222222; // GRAY :) + Values[0] = ConfigManager::getInt("col.inactive_border"); xcb_change_window_attributes(DisplayConnection, window.getDrawable(), XCB_CW_BORDER_PIXEL, Values); } @@ -332,10 +331,10 @@ void CWindowManager::setFocusedWindow(xcb_drawable_t window) { xcb_set_input_focus(DisplayConnection, XCB_INPUT_FOCUS_POINTER_ROOT, window, XCB_CURRENT_TIME); // Fix border from the old window that was in focus. - Values[0] = 0x555555; // GRAY :) + Values[0] = ConfigManager::getInt("col.inactive_border"); xcb_change_window_attributes(DisplayConnection, LastWindow, XCB_CW_BORDER_PIXEL, Values); - Values[0] = 0xFF3333; // RED :) + Values[0] = ConfigManager::getInt("col.active_border"); xcb_change_window_attributes(DisplayConnection, window, XCB_CW_BORDER_PIXEL, Values); LastWindow = window;