aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Denis Doria <denisdoria@gmail.com>2016-06-06 09:17:01 +0200
committerLibravatar Denis Doria <denisdoria@gmail.com>2016-06-06 09:17:01 +0200
commitcdd8664198009c705716df728fcfa1450620f18b (patch)
treea18924024087a5834808618e6d47bae9f69e7fea
parentMerge branch 'master' into variables_corner_cases (diff)
parentMerge pull request #699 from roosemberth/master (diff)
downloadsway-cdd8664198009c705716df728fcfa1450620f18b.tar.gz
sway-cdd8664198009c705716df728fcfa1450620f18b.tar.zst
sway-cdd8664198009c705716df728fcfa1450620f18b.zip
Merge branch 'master' into variables_corner_cases
-rw-r--r--common/readline.c7
-rw-r--r--sway/sway.5.txt12
2 files changed, 19 insertions, 0 deletions
diff --git a/common/readline.c b/common/readline.c
index 76ed6926..5106172c 100644
--- a/common/readline.c
+++ b/common/readline.c
@@ -5,17 +5,24 @@
5char *read_line(FILE *file) { 5char *read_line(FILE *file) {
6 size_t length = 0, size = 128; 6 size_t length = 0, size = 128;
7 char *string = malloc(size); 7 char *string = malloc(size);
8 char lastChar = '\0';
8 if (!string) { 9 if (!string) {
9 return NULL; 10 return NULL;
10 } 11 }
11 while (1) { 12 while (1) {
12 int c = getc(file); 13 int c = getc(file);
14 if (c == '\n' && lastChar == '\\'){
15 --length; // Ignore last character.
16 lastChar = '\0';
17 continue;
18 }
13 if (c == EOF || c == '\n' || c == '\0') { 19 if (c == EOF || c == '\n' || c == '\0') {
14 break; 20 break;
15 } 21 }
16 if (c == '\r') { 22 if (c == '\r') {
17 continue; 23 continue;
18 } 24 }
25 lastChar = c;
19 if (length == size) { 26 if (length == size) {
20 char *new_string = realloc(string, size *= 2); 27 char *new_string = realloc(string, size *= 2);
21 if (!new_string) { 28 if (!new_string) {
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index ffa181f7..397b6d87 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -16,6 +16,12 @@ on startup. These commands usually consist of setting your preferences and
16setting key bindings. An example config is likely present in /etc/sway/config 16setting key bindings. An example config is likely present in /etc/sway/config
17for you to check out. 17for you to check out.
18 18
19Lines in the configuration file might be extended through multiple lines by
20adding a '\' character at the end of line. e.g.:
21
22 bindsym Shift+XF86AudioRaiseVolume exec pactl set-sink-volume \
23 $(pactl list sinks | grep -B 1 RUNNING | sed '1q;d' | sed 's/[^0-9]\+//g') +5%
24
19These commands can be executed in your config file, via **sway-msg**(1), or via 25These commands can be executed in your config file, via **sway-msg**(1), or via
20the bindsym command. 26the bindsym command.
21 27
@@ -140,6 +146,12 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
140The following commands may be used either in the configuration file 146The following commands may be used either in the configuration file
141or triggered at runtime. 147or triggered at runtime.
142 148
149**assign** <criteria> [→] <workspace>::
150 Assigns views matching _criteria_ (see **Criteria** section below) to
151 _workspace_. The → (U+2192) is optional and purely for aesthetics. This
152 command is exactly equivalent to "for_window <criteria> move container to
153 workspace <workspace>".
154
143**bindsym** <key combo> <command>:: 155**bindsym** <key combo> <command>::
144 Binds _key combo_ to execute _command_ when pressed. You may use XKB key 156 Binds _key combo_ to execute _command_ when pressed. You may use XKB key
145 names here (**xev**(1) is a good tool for discovering them). An example 157 names here (**xev**(1) is a good tool for discovering them). An example