mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
Merge branch 'master' into variables_corner_cases
This commit is contained in:
commit
cdd8664198
|
@ -5,17 +5,24 @@
|
||||||
char *read_line(FILE *file) {
|
char *read_line(FILE *file) {
|
||||||
size_t length = 0, size = 128;
|
size_t length = 0, size = 128;
|
||||||
char *string = malloc(size);
|
char *string = malloc(size);
|
||||||
|
char lastChar = '\0';
|
||||||
if (!string) {
|
if (!string) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
while (1) {
|
while (1) {
|
||||||
int c = getc(file);
|
int c = getc(file);
|
||||||
|
if (c == '\n' && lastChar == '\\'){
|
||||||
|
--length; // Ignore last character.
|
||||||
|
lastChar = '\0';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (c == EOF || c == '\n' || c == '\0') {
|
if (c == EOF || c == '\n' || c == '\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c == '\r') {
|
if (c == '\r') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
lastChar = c;
|
||||||
if (length == size) {
|
if (length == size) {
|
||||||
char *new_string = realloc(string, size *= 2);
|
char *new_string = realloc(string, size *= 2);
|
||||||
if (!new_string) {
|
if (!new_string) {
|
||||||
|
|
|
@ -16,6 +16,12 @@ on startup. These commands usually consist of setting your preferences and
|
||||||
setting key bindings. An example config is likely present in /etc/sway/config
|
setting key bindings. An example config is likely present in /etc/sway/config
|
||||||
for you to check out.
|
for you to check out.
|
||||||
|
|
||||||
|
Lines in the configuration file might be extended through multiple lines by
|
||||||
|
adding a '\' character at the end of line. e.g.:
|
||||||
|
|
||||||
|
bindsym Shift+XF86AudioRaiseVolume exec pactl set-sink-volume \
|
||||||
|
$(pactl list sinks | grep -B 1 RUNNING | sed '1q;d' | sed 's/[^0-9]\+//g') +5%
|
||||||
|
|
||||||
These commands can be executed in your config file, via **sway-msg**(1), or via
|
These commands can be executed in your config file, via **sway-msg**(1), or via
|
||||||
the bindsym command.
|
the bindsym command.
|
||||||
|
|
||||||
|
@ -140,6 +146,12 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
|
||||||
The following commands may be used either in the configuration file
|
The following commands may be used either in the configuration file
|
||||||
or triggered at runtime.
|
or triggered at runtime.
|
||||||
|
|
||||||
|
**assign** <criteria> [→] <workspace>::
|
||||||
|
Assigns views matching _criteria_ (see **Criteria** section below) to
|
||||||
|
_workspace_. The → (U+2192) is optional and purely for aesthetics. This
|
||||||
|
command is exactly equivalent to "for_window <criteria> move container to
|
||||||
|
workspace <workspace>".
|
||||||
|
|
||||||
**bindsym** <key combo> <command>::
|
**bindsym** <key combo> <command>::
|
||||||
Binds _key combo_ to execute _command_ when pressed. You may use XKB key
|
Binds _key combo_ to execute _command_ when pressed. You may use XKB key
|
||||||
names here (**xev**(1) is a good tool for discovering them). An example
|
names here (**xev**(1) is a good tool for discovering them). An example
|
||||||
|
|
Loading…
Reference in a new issue