added exec-once

This commit is contained in:
vaxerski 2021-11-30 20:10:37 +01:00
parent f32c0abcf2
commit 09bafd05a1
3 changed files with 15 additions and 0 deletions

View file

@ -9,6 +9,11 @@ gaps_out=20
rounding=0 rounding=0
max_fps=60 # max fps for updates of config & animations 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 config
Bar { Bar {
height=20 height=20

View file

@ -35,6 +35,10 @@ void ConfigManager::init() {
configValues["anim.speed"].floatValue = 1; configValues["anim.speed"].floatValue = 1;
configValues["anim.enabled"].intValue = 1; configValues["anim.enabled"].intValue = 1;
if (!g_pWindowManager->statusBar) {
isFirstLaunch = true;
}
loadConfigLoadVars(); loadConfigLoadVars();
applyKeybindsToX(); applyKeybindsToX();
} }
@ -257,6 +261,9 @@ void parseLine(std::string& line) {
} else if (COMMAND == "exec") { } else if (COMMAND == "exec") {
handleRawExec(COMMAND, VALUE); handleRawExec(COMMAND, VALUE);
return; return;
} else if (COMMAND == "exec-once" && ConfigManager::isFirstLaunch) {
handleRawExec(COMMAND, VALUE);
return;
} else if (COMMAND == "status_command") { } else if (COMMAND == "status_command") {
handleStatusCommand(COMMAND, VALUE); handleStatusCommand(COMMAND, VALUE);
return; return;
@ -315,6 +322,7 @@ void ConfigManager::loadConfigLoadVars() {
} }
loadBar = true; loadBar = true;
isFirstLaunch = false;
} }
void ConfigManager::applyKeybindsToX() { void ConfigManager::applyKeybindsToX() {

View file

@ -17,6 +17,8 @@ namespace ConfigManager {
inline bool isBar = false; // If true we send the command to the bar parser inline bool isBar = false; // If true we send the command to the bar parser
inline bool isFirstLaunch = false;
void init(); void init();
void loadConfigLoadVars(); void loadConfigLoadVars();
void tick(); void tick();