diff --git a/example/hypr.conf b/example/hypr.conf index 77cd364..6cf666d 100644 --- a/example/hypr.conf +++ b/example/hypr.conf @@ -9,6 +9,11 @@ gaps_out=20 rounding=0 max_fps=60 # max fps for updates of config & animations + +# Execs +# exec-once=/home/me/MyEpicShellScript # will exec the script only when the WM launches +# exec=/home/me/MyEpicShellScript # will exec the script every time the config is reloaded + # Bar config Bar { height=20 diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 090189f..6e59245 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -35,6 +35,10 @@ void ConfigManager::init() { configValues["anim.speed"].floatValue = 1; configValues["anim.enabled"].intValue = 1; + if (!g_pWindowManager->statusBar) { + isFirstLaunch = true; + } + loadConfigLoadVars(); applyKeybindsToX(); } @@ -257,6 +261,9 @@ void parseLine(std::string& line) { } else if (COMMAND == "exec") { handleRawExec(COMMAND, VALUE); return; + } else if (COMMAND == "exec-once" && ConfigManager::isFirstLaunch) { + handleRawExec(COMMAND, VALUE); + return; } else if (COMMAND == "status_command") { handleStatusCommand(COMMAND, VALUE); return; @@ -315,6 +322,7 @@ void ConfigManager::loadConfigLoadVars() { } loadBar = true; + isFirstLaunch = false; } void ConfigManager::applyKeybindsToX() { diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index c617d9e..18bdd28 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -17,6 +17,8 @@ namespace ConfigManager { inline bool isBar = false; // If true we send the command to the bar parser + inline bool isFirstLaunch = false; + void init(); void loadConfigLoadVars(); void tick();