]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #1771 from Airblader/feature-1769
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Tue, 30 Jun 2015 20:52:54 +0000 (13:52 -0700)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Tue, 30 Jun 2015 20:52:54 +0000 (13:52 -0700)
Implement new criterion 'workspace'.

1  2 
src/commands.c
src/config_directives.c

diff --combined src/commands.c
index 49cb09fefd8d4e6c537db87e6cc4a4e7f14be531,53921e8654849d94b96ef78690c5e5119ed305f6..62adcc6536ab87b36dd02c45ce50d555e1292200
@@@ -411,6 -411,11 +411,11 @@@ void cmd_criteria_add(I3_CMD, char *cty
          return;
      }
  
+     if (strcmp(ctype, "workspace") == 0) {
+         current_match->workspace = regex_new(cvalue);
+         return;
+     }
      ELOG("Unknown criterion: %s\n", ctype);
  }
  
@@@ -1123,14 -1128,14 +1128,14 @@@ void cmd_unmark(I3_CMD, char *mark) 
              FREE(con->mark);
              con->mark_changed = true;
          }
 -        DLOG("removed all window marks");
 +        DLOG("Removed all window marks.\n");
      } else {
          Con *con = con_by_mark(mark);
          if (con != NULL) {
              FREE(con->mark);
              con->mark_changed = true;
          }
 -        DLOG("removed window mark %s\n", mark);
 +        DLOG("Removed window mark \"%s\".\n", mark);
      }
  
      cmd_output->needs_tree_render = true;
@@@ -1934,7 -1939,7 +1939,7 @@@ void cmd_title_format(I3_CMD, char *for
   */
  void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) {
      if (strncasecmp(new_name, "__", strlen("__")) == 0) {
 -        LOG("Cannot rename workspace to \"%s\": names starting with __ are i3-internal.", new_name);
 +        LOG("Cannot rename workspace to \"%s\": names starting with __ are i3-internal.\n", new_name);
          ysuccess(false);
          return;
      }
diff --combined src/config_directives.c
index 3db33d2e9d8942e8cd3a56552d0eddcb533c3957,91f408d5e76ba860a3c719795e7150bfbcee3a43..5b85012cbe6b8e7f0f7cf2ee849162f5080b45f5
@@@ -137,6 -137,11 +137,11 @@@ CFGFUN(criteria_add, const char *ctype
          return;
      }
  
+     if (strcmp(ctype, "workspace") == 0) {
+         current_match->workspace = regex_new(cvalue);
+         return;
+     }
      ELOG("Unknown criterion: %s\n", ctype);
  }
  
@@@ -372,7 -377,7 +377,7 @@@ CFGFUN(focus_on_window_activation, cons
          return;
      }
  
 -    DLOG("Set new focus_on_window_activation mode = %i", config.focus_on_window_activation);
 +    DLOG("Set new focus_on_window_activation mode = %i.\n", config.focus_on_window_activation);
  }
  
  CFGFUN(show_marks, const char *value) {
@@@ -452,7 -457,7 +457,7 @@@ CFGFUN(assign, const char *workspace) 
          ELOG("Match is empty, ignoring this assignment\n");
          return;
      }
 -    DLOG("new assignment, using above criteria, to workspace %s\n", workspace);
 +    DLOG("New assignment, using above criteria, to workspace \"%s\".\n", workspace);
      Assignment *assignment = scalloc(sizeof(Assignment));
      match_copy(&(assignment->match), current_match);
      assignment->type = A_TO_WORKSPACE;
@@@ -466,7 -471,7 +471,7 @@@ CFGFUN(no_focus) 
          return;
      }
  
 -    DLOG("new assignment, using above criteria, to ignore focus on manage");
 +    DLOG("New assignment, using above criteria, to ignore focus on manage.\n");
      Assignment *assignment = scalloc(sizeof(Assignment));
      match_copy(&(assignment->match), current_match);
      assignment->type = A_NO_FOCUS;