aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-07-20 21:46:56 -0400
committerGitHub <noreply@github.com>2018-07-20 21:46:56 -0400
commit51730a059778e1d91e2f4b412f39e77a66f48155 (patch)
tree1d043b7551e251f1b662e952e9f62be72877a7cc /sway/commands
parenta2b2146f7fb8d5e868880daff9484145a68ab4a3 (diff)
parent37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5 (diff)
downloadsway-51730a059778e1d91e2f4b412f39e77a66f48155.tar.xz
Merge pull request #2317 from RyanDwyer/force-display-urgency-hint
Implement force_display_urgency_hint
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/force_display_urgency_hint.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/commands/force_display_urgency_hint.c b/sway/commands/force_display_urgency_hint.c
new file mode 100644
index 00000000..5e5e2d55
--- /dev/null
+++ b/sway/commands/force_display_urgency_hint.c
@@ -0,0 +1,23 @@
+#include "sway/commands.h"
+#include "sway/config.h"
+
+struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "force_display_urgency_hint",
+ EXPECTED_AT_LEAST, 1))) {
+ return error;
+ }
+
+ char *err;
+ int timeout = (int)strtol(argv[0], &err, 10);
+ if (*err) {
+ if (strcmp(err, "ms") != 0) {
+ return cmd_results_new(CMD_INVALID, "force_display_urgency_hint",
+ "Expected 'force_display_urgency_hint <timeout> ms'");
+ }
+ }
+
+ config->urgent_timeout = timeout > 0 ? timeout : 0;
+
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}