----------------------------------------------
focus left|right|down|up
focus parent|child|floating|tiling|mode_toggle
-focus output left|right|up|down|<output>
+focus output left|right|up|down|primary|<output>
----------------------------------------------
*Examples*:
# Focus the big output
bindsym $mod+x focus output HDMI-2
+
+# Focus the primary output
+bindsym $mod+x focus output primary
-------------------------------------------------
+-------------------------------
+Note that you might not have a primary output configured yet. To do so, run:
+-------------------------
+xrandr --output <output> --primary
+-------------------------
+
=== Moving containers
Use the +move+ command to move a container.
*Syntax*:
------------------------------------------------------------
-move container to output left|right|down|up|current|<output>
-move workspace to output left|right|down|up|current|<output>
+move container to output left|right|down|up|current|primary|<output>
+move workspace to output left|right|down|up|current|primary|<output>
------------------------------------------------------------
*Examples*:
# Put this window on the presentation output.
bindsym $mod+x move container to output VGA1
+
+# Put this window on the primary output.
+bindsym $mod+x move container to output primary
--------------------------------------------------------
+-------------------------------
+Note that you might not have a primary output configured yet. To do so, run:
+-------------------------
+xrandr --output <output> --primary
+-------------------------
+
=== Moving containers/windows to marks
To move a container to another container with a specific mark (see <<vim_like_marks>>),
*/
Output *get_output_by_name(const char *name) {
Output *output;
- TAILQ_FOREACH(output, &outputs, outputs)
- if (output->active &&
- strcasecmp(output->name, name) == 0)
- return output;
+ bool get_primary = (strcasecmp("primary", name) == 0);
+ TAILQ_FOREACH(output, &outputs, outputs) {
+ if ((output->primary && get_primary) ||
+ (output->active && strcasecmp(output->name, name) == 0)) {
+ return output;
+ }
+ }
return NULL;
}