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
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

View file

@ -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() {

View file

@ -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();