]> git.sur5r.net Git - i3/i3/blobdiff - src/cfgparse.y
ipc: also send workspace event when initializing a workspace for an output
[i3/i3] / src / cfgparse.y
index 3879cf97421e3b82e2308205eaa5447bcd4652e4..b9fae726c9dbfc7802d23f59383a3d03e0200432 100644 (file)
@@ -197,6 +197,7 @@ void parse_file(const char *f) {
 %token <string>STR "<string>"
 %token <string>STR_NG "<string (non-greedy)>"
 %token <string>HEX "<hex>"
+%token <string>OUTPUT "<RandR output>"
 %token TOKBIND
 %token TOKTERMINAL
 %token TOKCOMMENT "<comment>"
@@ -209,7 +210,7 @@ void parse_file(const char *f) {
 %token TOKFLOATING_MODIFIER "floating_modifier"
 %token QUOTEDSTRING "<quoted string>"
 %token TOKWORKSPACE "workspace"
-%token TOKSCREEN "screen"
+%token TOKOUTPUT "output"
 %token TOKASSIGN "assign"
 %token TOKSET
 %token TOKIPCSOCKET "ipc_socket"
@@ -220,6 +221,7 @@ void parse_file(const char *f) {
 %token TOKNEWCONTAINER "new_container"
 %token TOKNEWWINDOW "new_window"
 %token TOKFOCUSFOLLOWSMOUSE "focus_follows_mouse"
+%token TOKWORKSPACEBAR "workspace_bar"
 %token TOKCONTAINERMODE "default/stacking/tabbed"
 %token TOKSTACKLIMIT "stack-limit"
 
@@ -227,6 +229,7 @@ void parse_file(const char *f) {
 
 lines: /* empty */
         | lines WHITESPACE line
+        | lines error
         | lines line
         ;
 
@@ -237,6 +240,7 @@ line:
         | new_container
         | new_window
         | focus_follows_mouse
+        | workspace_bar
         | workspace
         | assign
         | ipcsocket
@@ -427,15 +431,23 @@ focus_follows_mouse:
         }
         ;
 
+workspace_bar:
+        TOKWORKSPACEBAR WHITESPACE bool
+        {
+                DLOG("workspace bar = %d\n", $<number>3);
+                config.disable_workspace_bar = !($<number>3);
+        }
+        ;
+
 workspace:
-        TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen optional_workspace_name
+        TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKOUTPUT WHITESPACE OUTPUT optional_workspace_name
         {
                 int ws_num = $<number>3;
                 if (ws_num < 1) {
                         DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
                 } else {
                         Workspace *ws = workspace_get(ws_num - 1);
-                        ws->preferred_screen = sstrdup($<string>7);
+                        ws->preferred_output = sstrdup($<string>7);
                         if ($<string>8 != NULL)
                                 workspace_set_name(ws, $<string>8);
                 }
@@ -446,6 +458,7 @@ workspace:
                 if (ws_num < 1) {
                         DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
                 } else {
+                        DLOG("workspace name to: %s\n", $<string>5);
                         if ($<string>5 != NULL)
                                 workspace_set_name(workspace_get(ws_num - 1), $<string>5);
                 }
@@ -463,13 +476,6 @@ workspace_name:
         | WORD               { $<string>$ = $<string>1; }
         ;
 
-screen:
-        NUMBER              { asprintf(&$<string>$, "%d", $<number>1); }
-        | NUMBER 'x'        { asprintf(&$<string>$, "%d", $<number>1); }
-        | NUMBER 'x' NUMBER { asprintf(&$<string>$, "%dx%d", $<number>1, $<number>3); }
-        | 'x' NUMBER        { asprintf(&$<string>$, "x%d", $<number>2); }
-        ;
-
 assign:
         TOKASSIGN WHITESPACE window_class WHITESPACE optional_arrow assign_target
         {
@@ -535,8 +541,8 @@ exec:
 terminal:
         TOKTERMINAL WHITESPACE STR
         {
-                DLOG("The terminal option is DEPRECATED and has no effect. "
-                    "Please remove it from your configuration file.");
+                ELOG("The terminal option is DEPRECATED and has no effect. "
+                    "Please remove it from your configuration file.\n");
         }
         ;