Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#65 add ON_CHANGE_CMD to run a shell command in handle_success #162

Merged
merged 21 commits into from
Apr 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bc91418
add spawn_async function
PaideiaDilemma Mar 29, 2024
7dbb2ed
add ON_CHANGE_CMD config
PaideiaDilemma Mar 29, 2024
f1a2a3d
spawn on_change_cmd in handle_success
PaideiaDilemma Mar 29, 2024
afb57ba
adapt marshalling tests
PaideiaDilemma Mar 29, 2024
cfbe233
isolate the spawed process a bit more
PaideiaDilemma Apr 1, 2024
82191fa
ignore adaptive sync changes
PaideiaDilemma Apr 2, 2024
41cd743
add a test for the change command
PaideiaDilemma Apr 2, 2024
e2f3456
add ON_CHANGE_CMD to cfg.yaml
PaideiaDilemma Apr 2, 2024
e63e344
sanitary fixes
PaideiaDilemma Apr 2, 2024
76169f3
wrap spawn_async and simplify the on_change_cmd test
PaideiaDilemma Apr 7, 2024
6a68451
fix mem leak due to creating the default config twice
PaideiaDilemma Apr 7, 2024
8a85133
rename to CHANGE_SUCCESS_CMD
PaideiaDilemma Apr 9, 2024
2b1e78d
add cli set and delete for CHANGE_SUCCESS_CMD
PaideiaDilemma Apr 9, 2024
1351215
add CHANGE_SUCCESS_CMD to print_cfg and print_cfg_commands
PaideiaDilemma Apr 9, 2024
32fa9a9
add cfg merge tests for change_success_cmd
PaideiaDilemma Apr 9, 2024
3ae2d9c
revision spawn command
PaideiaDilemma Apr 15, 2024
b490c60
add CHANGE_SUCCESS_CMD to cli usage
PaideiaDilemma Apr 15, 2024
a0264d2
add CHANGE_SUCCESS_CMD to man
alex-courtis Apr 16, 2024
afe995e
prepare for next minor release
alex-courtis Apr 16, 2024
637b104
setup signal handlers in the server to avoid zombie processes
PaideiaDilemma Apr 16, 2024
7eefc79
add compound command example, unify man and cfg.yaml
alex-courtis Apr 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add CHANGE_SUCCESS_CMD to print_cfg and print_cfg_commands
  • Loading branch information
PaideiaDilemma committed Apr 9, 2024
commit 1351215b387d2c31d04ef4c575091ed91d8045db
11 changes: 11 additions & 0 deletions src/info.c
Original file line number Diff line number Diff line change
@@ -205,6 +205,11 @@ void print_cfg(enum LogThreshold t, struct Cfg *cfg, bool del) {
}
}

if (cfg->change_success_cmd) {
log_(t, " Change success command:");
log_(t, " %s", cfg->change_success_cmd);
}

if (cfg->laptop_display_prefix) {
log_(t, " Laptop display prefix: %s", cfg->laptop_display_prefix);
}
@@ -293,6 +298,12 @@ void print_cfg_commands(enum LogThreshold t, struct Cfg *cfg) {
print_newline(t, &newline);
log_(t, "way-displays -s VRR_OFF '%s'", (char*)i->val);
}

newline = true;
if (cfg->change_success_cmd) {
print_newline(t, &newline);
log_(t, "way-displays -s CHANGE_SUCCESS_CMD '%s'", cfg->change_success_cmd);
}
}

void print_head_current(enum LogThreshold t, struct Head *head) {