]> git.lizzy.rs Git - bspwm.git/commitdiff
Make the modifier notation compact and uniform
authorBastien Dejean <nihilhill@gmail.com>
Tue, 17 Nov 2015 10:02:06 +0000 (11:02 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 17 Nov 2015 10:02:06 +0000 (11:02 +0100)
We want to avoid irregular notations: STATES and FLAGS should translate
directly into modifiers.

doc/bspwm.1
doc/bspwm.1.asciidoc
query.c

index 867d0c71fadb621375b1442e07c7c7c32e1054fa..25d924cbf2be8b764ab5300efd8ca2a93a852f3e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 11/15/2015
+.\"      Date: 11/17/2015
 .\"    Manual: Bspwm Manual
 .\"    Source: Bspwm 0.9
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "11/15/2015" "Bspwm 0\&.9" "Bspwm Manual"
+.TH "BSPWM" "1" "11/17/2015" "Bspwm 0\&.9" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -84,6 +84,8 @@ PRIMARY_SELECTOR[\&.MODIFIER]*
 .\}
 .sp
 For obvious reasons, neither desktop nor monitor names may be valid descriptive selectors\&.
+.sp
+An exclamation mark can be prepended to certain modifiers in order to reverse their meaning\&.
 .SS "Window"
 .sp
 Select a window\&.
@@ -93,7 +95,7 @@ Select a window\&.
 .\}
 .nf
 WINDOW_SEL := <window_id>
-            | (DIR|CYCLE_DIR|biggest|last|focused|older|newer)[\&.manual|\&.automatic][\&.tiled|nontiled][\&.pseudotiled|\&.nonpseudotiled][\&.floating|\&.nonfloating][\&.fullscreen|\&.nonfullscreen][\&.below|\&.normal|\&.above][\&.local|\&.foreign][\&.like|\&.unlike][\&.focused|\&.unfocused][\&.urgent|\&.nonurgent][\&.sticky|\&.nonsticky][\&.public|\&.private][\&.locked|\&.unlocked]
+            | (DIR|CYCLE_DIR|biggest|last|focused|older|newer)[\&.[!]automatic][\&.[!](tiled|pseudo_tiled|floating|fullscreen)][\&.below|\&.normal|\&.above][\&.[!]local][\&.[!]same_class][\&.[!]focused][\&.[!](urgent|sticky|private|locked)]
 .fi
 .if n \{\
 .RE
@@ -151,139 +153,39 @@ Selects the window newer than the focused window in the history\&.
 \fBModifiers\fR
 .RS 4
 .PP
-tiled
-.RS 4
-Only consider tiled windows\&.
-.RE
-.PP
-nontiled
-.RS 4
-Only consider non tiled windows\&.
-.RE
-.PP
-pseudotiled
-.RS 4
-Only consider pseudo\-tiled windows\&.
-.RE
-.PP
-nonpseudotiled
-.RS 4
-Only consider non pseudo\-tiled windows\&.
-.RE
-.PP
-floating
-.RS 4
-Only consider floating windows\&.
-.RE
-.PP
-nonfloating
-.RS 4
-Only consider non floating windows\&.
-.RE
-.PP
-fullscreen
-.RS 4
-Only consider fullscreen windows\&.
-.RE
-.PP
-nonfullscreen
-.RS 4
-Only consider non fullscreen windows\&.
-.RE
-.PP
-manual
-.RS 4
-Only consider windows in manual splitting mode\&.
-.RE
-.PP
-automatic
-.RS 4
-Only consider windows in automatic splitting mode\&.
-.RE
-.PP
-focused
-.RS 4
-Only consider focused windows\&.
-.RE
-.PP
-unfocused
-.RS 4
-Only consider unfocused windows\&.
-.RE
-.PP
-below
-.RS 4
-Only consider windows of the BELOW layer\&.
-.RE
-.PP
-normal
+[!](tiled|pseudo_tiled|floating|fullscreen)
 .RS 4
-Only consider windows of the NORMAL layer\&.
+Only consider windows having or not having the given state\&.
 .RE
 .PP
-above
+[!]automatic
 .RS 4
-Only consider windows of the ABOVE layer\&.
+Only consider windows in automatic or manual insertion mode\&.
 .RE
 .PP
-like
+[!]focused
 .RS 4
-Only consider windows that have the same class as the current window\&.
+Only consider focused or unfocused windows\&.
 .RE
 .PP
-unlike
+[!]same_class
 .RS 4
-Only consider windows that have a different class than the current window\&.
+Only consider windows that have or don\(cqt have the same class as the current window\&.
 .RE
 .PP
-local
+[!]local
 .RS 4
-Only consider windows of the current desktop\&.
+Only consider windows in or not in the current desktop\&.
 .RE
 .PP
-foreign
+[!](private|urgent|sticky|locked)
 .RS 4
-Only consider windows outside of the current desktop\&.
+Only consider windows that have or don\(cqt have the given flag set\&.
 .RE
 .PP
-private
+below|normal|above
 .RS 4
-Only consider private windows\&.
-.RE
-.PP
-public
-.RS 4
-Only consider non private windows\&.
-.RE
-.PP
-urgent
-.RS 4
-Only consider urgent windows\&.
-.RE
-.PP
-nonurgent
-.RS 4
-Only consider non urgent windows\&.
-.RE
-.PP
-sticky
-.RS 4
-Only consider sticky windows\&.
-.RE
-.PP
-nonsticky
-.RS 4
-Only consider non sticky windows\&.
-.RE
-.PP
-locked
-.RS 4
-Only consider locked windows\&.
-.RE
-.PP
-unlocked
-.RS 4
-Only consider non locked windows\&.
+Only consider windows of the given layer\&.
 .RE
 .RE
 .SS "Desktop"
@@ -296,7 +198,7 @@ Select a desktop\&.
 .nf
 DESKTOP_SEL := <desktop_name>
              | [MONITOR_SEL:]^<n>
-             | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[\&.occupied|\&.free][\&.urgent|\&.nonurgent][\&.local|\&.foreign]
+             | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[\&.[!]occupied][\&.[!]urgent][\&.[!]local]
 .fi
 .if n \{\
 .RE
@@ -354,34 +256,19 @@ Selects the desktop newer than the focused desktop in the history\&.
 \fBModifiers\fR
 .RS 4
 .PP
-occupied
-.RS 4
-Only consider occupied desktops\&.
-.RE
-.PP
-free
-.RS 4
-Only consider free desktops\&.
-.RE
-.PP
-urgent
-.RS 4
-Only consider urgent desktops\&.
-.RE
-.PP
-nonurgent
+[!]occupied
 .RS 4
-Only consider non urgent desktops\&.
+Only consider occupied or free desktops\&.
 .RE
 .PP
-local
+[!]urgent
 .RS 4
-Only consider desktops of the current monitor\&.
+Only consider urgent or non urgent desktops\&.
 .RE
 .PP
-foreign
+[!]local
 .RS 4
-Only consider desktops outside of the current monitor\&.
+Only consider inside or outside of the current monitor\&.
 .RE
 .RE
 .SS "Monitor"
@@ -394,7 +281,7 @@ Select a monitor\&.
 .nf
 MONITOR_SEL := <monitor_name>
              | ^<n>
-             | (DIR|CYCLE_DIR|last|primary|focused|older|newer)[\&.occupied|\&.free]
+             | (DIR|CYCLE_DIR|last|primary|focused|older|newer)[\&.[!]occupied]
 .fi
 .if n \{\
 .RE
@@ -462,14 +349,9 @@ Selects the monitor newer than the focused monitor in the history\&.
 \fBModifiers\fR
 .RS 4
 .PP
-occupied
-.RS 4
-Only consider monitors where the focused desktop is occupied\&.
-.RE
-.PP
-free
+[!]occupied
 .RS 4
-Only consider monitors where the focused desktop is free\&.
+Only consider monitors where the focused desktop is occupied or free\&.
 .RE
 .RE
 .SH "WINDOW STATES"
index d0163e19fa8d83cbf371517c677746f4b69393e6..4878190b1d1e438c26321f8dc27235bf9bdf6df0 100644 (file)
@@ -59,6 +59,8 @@ of non-conflicting modifiers as follows:
 For obvious reasons, neither desktop nor monitor names may be valid descriptive
 selectors.
 
+An exclamation mark can be prepended to certain modifiers in order to reverse their meaning.
+
 Window
 ~~~~~~
 
@@ -66,7 +68,7 @@ Select a window.
 
 ----
 WINDOW_SEL := <window_id> 
-            | (DIR|CYCLE_DIR|biggest|last|focused|older|newer)[.manual|.automatic][.tiled|nontiled][.pseudotiled|.nonpseudotiled][.floating|.nonfloating][.fullscreen|.nonfullscreen][.below|.normal|.above][.local|.foreign][.like|.unlike][.focused|.unfocused][.urgent|.nonurgent][.sticky|.nonsticky][.public|.private][.locked|.unlocked]
+            | (DIR|CYCLE_DIR|biggest|last|focused|older|newer)[.[!]automatic][.[!](tiled|pseudo_tiled|floating|fullscreen)][.below|.normal|.above][.[!]local][.[!]same_class][.[!]focused][.[!](urgent|sticky|private|locked)]
 ----
 
 Primary Selectors
@@ -96,86 +98,26 @@ newer::
 Modifiers
 ^^^^^^^^^
 
-tiled::
-       Only consider tiled windows.
-
-nontiled::
-       Only consider non tiled windows.
-
-pseudotiled::
-       Only consider pseudo-tiled windows.
-
-nonpseudotiled::
-       Only consider non pseudo-tiled windows.
-
-floating::
-       Only consider floating windows.
-
-nonfloating::
-       Only consider non floating windows.
-
-fullscreen::
-       Only consider fullscreen windows.
-
-nonfullscreen::
-       Only consider non fullscreen windows.
-
-manual::
-       Only consider windows in manual splitting mode.
-
-automatic::
-       Only consider windows in automatic splitting mode.
-
-focused::
-       Only consider focused windows.
-
-unfocused::
-       Only consider unfocused windows.
-
-below::
-       Only consider windows of the BELOW layer.
+[!](tiled|pseudo_tiled|floating|fullscreen)::
+       Only consider windows having or not having the given state.
 
-normal::
-       Only consider windows of the NORMAL layer.
+[!]automatic::
+       Only consider windows in automatic or manual insertion mode.
 
-above::
-       Only consider windows of the ABOVE layer.
+[!]focused::
+       Only consider focused or unfocused windows.
 
-like::
-       Only consider windows that have the same class as the current window.
+[!]same_class::
+       Only consider windows that have or don't have the same class as the current window.
 
-unlike::
-       Only consider windows that have a different class than the current window.
+[!]local::
+       Only consider windows in or not in the current desktop.
 
-local::
-       Only consider windows of the current desktop.
+[!](private|urgent|sticky|locked)::
+       Only consider windows that have or don't have the given flag set.
 
-foreign::
-       Only consider windows outside of the current desktop.
-
-private::
-       Only consider private windows.
-
-public::
-       Only consider non private windows.
-
-urgent::
-       Only consider urgent windows.
-
-nonurgent::
-       Only consider non urgent windows.
-
-sticky::
-       Only consider sticky windows.
-
-nonsticky::
-       Only consider non sticky windows.
-
-locked::
-       Only consider locked windows.
-
-unlocked::
-       Only consider non locked windows.
+below|normal|above::
+       Only consider windows of the given layer.
 
 Desktop
 ~~~~~~~
@@ -185,7 +127,7 @@ Select a desktop.
 ----
 DESKTOP_SEL := <desktop_name>
              | [MONITOR_SEL:]^<n>
-             | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[.occupied|.free][.urgent|.nonurgent][.local|.foreign]
+             | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[.[!]occupied][.[!]urgent][.[!]local]
 ----
 
 Primary Selectors
@@ -215,23 +157,14 @@ newer::
 Modifiers
 ^^^^^^^^^
 
-occupied::
-       Only consider occupied desktops.
-
-free::
-       Only consider free desktops.
+[!]occupied::
+       Only consider occupied or free desktops.
 
-urgent::
-       Only consider urgent desktops.
-
-nonurgent::
-       Only consider non urgent desktops.
+[!]urgent::
+       Only consider urgent or non urgent desktops.
 
-local::
-       Only consider desktops of the current monitor.
-
-foreign::
-       Only consider desktops outside of the current monitor.
+[!]local::
+       Only consider inside or outside of the current monitor.
 
 Monitor
 ~~~~~~~
@@ -241,7 +174,7 @@ Select a monitor.
 ----
 MONITOR_SEL := <monitor_name>
              | ^<n>
-             | (DIR|CYCLE_DIR|last|primary|focused|older|newer)[.occupied|.free]
+             | (DIR|CYCLE_DIR|last|primary|focused|older|newer)[.[!]occupied]
 ----
 
 Primary Selectors
@@ -277,11 +210,8 @@ newer::
 Modifiers
 ^^^^^^^^^
 
-occupied::
-       Only consider monitors where the focused desktop is occupied.
-
-free::
-       Only consider monitors where the focused desktop is free.
+[!]occupied::
+       Only consider monitors where the focused desktop is occupied or free.
 
 
 Window States
diff --git a/query.c b/query.c
index 767d10d55867f0d6def34f753d4d1a3f107e3df8..6592dc9ed6f65e77859477bdfd11202c226e4990 100644 (file)
--- a/query.c
+++ b/query.c
@@ -185,51 +185,51 @@ bool node_from_desc(char *desc, coordinates_t *ref, coordinates_t *dst)
                tok++;
                if (streq("tiled", tok)) {
                        sel.tiled = OPTION_TRUE;
-               } else if (streq("nontiled", tok)) {
+               } else if (streq("!tiled", tok)) {
                        sel.tiled = OPTION_FALSE;
-               } else if (streq("pseudotiled", tok)) {
+               } else if (streq("pseudo_tiled", tok)) {
                        sel.pseudo_tiled = OPTION_TRUE;
-               } else if (streq("nonpseudotiled", tok)) {
+               } else if (streq("!pseudo_tiled", tok)) {
                        sel.pseudo_tiled = OPTION_FALSE;
                } else if (streq("floating", tok)) {
                        sel.floating = OPTION_TRUE;
-               } else if (streq("nonfloating", tok)) {
+               } else if (streq("!floating", tok)) {
                        sel.floating = OPTION_FALSE;
-               } else if (streq("like", tok)) {
+               } else if (streq("same_class", tok)) {
                        sel.same_class = OPTION_TRUE;
-               } else if (streq("unlike", tok)) {
+               } else if (streq("!same_class", tok)) {
                        sel.same_class = OPTION_FALSE;
                } else if (streq("automatic", tok)) {
                        sel.automatic = OPTION_TRUE;
-               } else if (streq("manual", tok)) {
+               } else if (streq("!automatic", tok)) {
                        sel.automatic = OPTION_FALSE;
                } else if (streq("fullscreen", tok)) {
                        sel.fullscreen = OPTION_TRUE;
-               } else if (streq("nonfullscreen", tok)) {
+               } else if (streq("!fullscreen", tok)) {
                        sel.fullscreen = OPTION_FALSE;
                } else if (streq("urgent", tok)) {
                        sel.urgent = OPTION_TRUE;
-               } else if (streq("nonurgent", tok)) {
+               } else if (streq("!urgent", tok)) {
                        sel.urgent = OPTION_FALSE;
                } else if (streq("local", tok)) {
                        sel.local = OPTION_TRUE;
-               } else if (streq("foreign", tok)) {
+               } else if (streq("!local", tok)) {
                        sel.local = OPTION_FALSE;
                } else if (streq("private", tok)) {
                        sel.private = OPTION_TRUE;
-               } else if (streq("public", tok)) {
+               } else if (streq("!private", tok)) {
                        sel.private = OPTION_FALSE;
                } else if (streq("sticky", tok)) {
                        sel.sticky = OPTION_TRUE;
-               } else if (streq("nonsticky", tok)) {
+               } else if (streq("!sticky", tok)) {
                        sel.sticky = OPTION_FALSE;
                } else if (streq("locked", tok)) {
                        sel.locked = OPTION_TRUE;
-               } else if (streq("unlocked", tok)) {
+               } else if (streq("!locked", tok)) {
                        sel.locked = OPTION_FALSE;
                } else if (streq("focused", tok)) {
                        sel.focused = OPTION_TRUE;
-               } else if (streq("unfocused", tok)) {
+               } else if (streq("!focused", tok)) {
                        sel.focused = OPTION_FALSE;
                } else if (streq("below", tok)) {
                        sel.layer = malloc(sizeof(stack_layer_t));
@@ -296,17 +296,17 @@ bool desktop_from_desc(char *desc, coordinates_t *ref, coordinates_t *dst)
        while ((tok = strrchr(desc, CAT_CHR)) != NULL) {
                tok[0] = '\0';
                tok++;
-               if (streq("free", tok)) {
+               if (streq("occupied", tok)) {
                        sel.occupied = OPTION_FALSE;
-               } else if (streq("occupied", tok)) {
+               } else if (streq("!occupied", tok)) {
                        sel.occupied = OPTION_TRUE;
                } else if (streq("urgent", tok)) {
                        sel.urgent = OPTION_TRUE;
-               } else if (streq("nonurgent", tok)) {
+               } else if (streq("!urgent", tok)) {
                        sel.urgent = OPTION_FALSE;
                } else if (streq("local", tok)) {
                        sel.local = OPTION_TRUE;
-               } else if (streq("foreign", tok)) {
+               } else if (streq("!local", tok)) {
                        sel.local = OPTION_FALSE;
                }
        }
@@ -355,9 +355,9 @@ bool monitor_from_desc(char *desc, coordinates_t *ref, coordinates_t *dst)
        while ((tok = strrchr(desc, CAT_CHR)) != NULL) {
                tok[0] = '\0';
                tok++;
-               if (streq("free", tok)) {
+               if (streq("occupied", tok)) {
                        sel.occupied = OPTION_FALSE;
-               } else if (streq("occupied", tok)) {
+               } else if (streq("!occupied", tok)) {
                        sel.occupied = OPTION_TRUE;
                }
        }