diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 15c88b6..8f50b5e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,6 +49,7 @@ enum action_state { SET_NORMAL, GETOUTPUTS, SET_FULLSCREEN, + SET_APP_ON_OUTPUT, }; static struct action { @@ -61,6 +62,7 @@ static struct action { { SET_FLOAT, "FLOAT" }, { SET_NORMAL, "NORMAL" }, { SET_FULLSCREEN, "FULLSCREEN" }, + { SET_APP_ON_OUTPUT, "ON_OUTPUT" }, }; static int @@ -87,7 +89,7 @@ help(char **argv) { fprintf(stderr, "Usage: %s [-a action] [-p app_id] [-o output_name] [-l]\n", argv[0]); - fprintf(stderr, "\t-a -- action activate|deactivate|float|normal|getoutputs|fullscreen\n"); + fprintf(stderr, "\t-a -- action activate|deactivate|float|normal|getoutputs|fullscreen|on_output\n"); fprintf(stderr, "\t-p -- app_id application_id\n"); fprintf(stderr, "\t-o -- output_name one of the outputs from getoutputs action\n"); fprintf(stderr, "\t-l -- continuously listen for window state events\n"); @@ -194,6 +196,18 @@ int main(int argc, char *argv[]) fprintf(stderr, "Fullscreened application '%s'\n", app_id); client->SetAppFullscreen(std::string(app_id)); break; + case SET_APP_ON_OUTPUT: + if (!app_id) { + fprintf(stderr, "AppOnOutput require an app_id\n"); + help(argv); + } + if (!output) { + fprintf(stderr, "AppOnOutput require an output\n"); + help(argv); + } + fprintf(stderr, "Putting application '%s' on output '%s'\n", app_id, output); + client->SetAppOnOutput(std::string(app_id), std::string(output)); + break; case SET_NORMAL: if (!app_id) { fprintf(stderr, "Normal/maximized require an app_id\n"); |