aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-03-27 12:41:42 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-03-27 12:41:42 -0400
commiteacf3d0396ab96ef1ce3e8e9433fa87850143cc6 (patch)
tree15bf2f3547563122d8486c3953eb3cff1c244551
parentUpdate sway(1) (diff)
downloadsway-eacf3d0396ab96ef1ce3e8e9433fa87850143cc6.tar.gz
sway-eacf3d0396ab96ef1ce3e8e9433fa87850143cc6.tar.zst
sway-eacf3d0396ab96ef1ce3e8e9433fa87850143cc6.zip
Loosen restrictions on commands, update docs
Closes #531
-rw-r--r--config2
-rw-r--r--sway/commands.c6
-rw-r--r--sway/sway-input.5.txt4
-rw-r--r--sway/sway.5.txt26
4 files changed, 22 insertions, 16 deletions
diff --git a/config b/config
index d1c323df..0686af2e 100644
--- a/config
+++ b/config
@@ -18,7 +18,7 @@ set $menu dmenu_run
18 18
19### Output configuration 19### Output configuration
20# 20#
21# Default wallpaper - CC-BY-NC from Netzlemming http://netzlemming.deviantart.com/art/Field-of-Barley-05240017-307176737 21# Default wallpaper (more resolutions are available in /usr/share/sway/)
22output * bg /usr/share/sway/Sway_Wallpaper_Blue_1920x1080.png fill 22output * bg /usr/share/sway/Sway_Wallpaper_Blue_1920x1080.png fill
23# 23#
24# Example output configuration: 24# Example output configuration:
diff --git a/sway/commands.c b/sway/commands.c
index e251f167..4d0da26e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -215,11 +215,8 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) {
215 struct cmd_results *error = NULL; 215 struct cmd_results *error = NULL;
216 if ((error = checkarg(argc, "bindsym", EXPECTED_MORE_THAN, 1))) { 216 if ((error = checkarg(argc, "bindsym", EXPECTED_MORE_THAN, 1))) {
217 return error; 217 return error;
218 } else if (!config->reading) {
219 return cmd_results_new(CMD_FAILURE, "bindsym", "Can only be used in config file.");
220 } 218 }
221 219
222
223 struct sway_binding *binding = malloc(sizeof(struct sway_binding)); 220 struct sway_binding *binding = malloc(sizeof(struct sway_binding));
224 binding->keys = create_list(); 221 binding->keys = create_list();
225 binding->modifiers = 0; 222 binding->modifiers = 0;
@@ -283,11 +280,8 @@ static struct cmd_results *cmd_bindcode(int argc, char **argv) {
283 struct cmd_results *error = NULL; 280 struct cmd_results *error = NULL;
284 if ((error = checkarg(argc, "bindcode", EXPECTED_MORE_THAN, 1))) { 281 if ((error = checkarg(argc, "bindcode", EXPECTED_MORE_THAN, 1))) {
285 return error; 282 return error;
286 } else if (!config->reading) {
287 return cmd_results_new(CMD_FAILURE, "bindcode", "Can only be used in config file.");
288 } 283 }
289 284
290
291 struct sway_binding *binding = malloc(sizeof(struct sway_binding)); 285 struct sway_binding *binding = malloc(sizeof(struct sway_binding));
292 binding->keys = create_list(); 286 binding->keys = create_list();
293 binding->modifiers = 0; 287 binding->modifiers = 0;
diff --git a/sway/sway-input.5.txt b/sway/sway-input.5.txt
index 1ef1dbf8..05dcbeef 100644
--- a/sway/sway-input.5.txt
+++ b/sway/sway-input.5.txt
@@ -11,8 +11,8 @@ sway-input - input configuration file and commands
11Description 11Description
12----------- 12-----------
13 13
14Sway allows for configuration of libinput devices. 14Sway allows for configuration of libinput devices through _input { }_ blocks in
15 15your config file.
16 16
17Commands 17Commands
18-------- 18--------
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index d626df48..1bb5cd3b 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -16,7 +16,8 @@ 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
19Some of the commands can also or only be sent at runtime with **sway-msg**(1). 19These commands can be executed in your config file, via **sway-msg**(1), or via
20the bindsym command.
20 21
21Commands 22Commands
22-------- 23--------
@@ -26,13 +27,14 @@ The following commands may only be used in the configuration file.
26**bar** <block of commands>:: 27**bar** <block of commands>::
27 Append _{_ to this command, the following lines will be commands that 28 Append _{_ to this command, the following lines will be commands that
28 configure **swaybar**, and _}_ on its own line to close the block. 29 configure **swaybar**, and _}_ on its own line to close the block.
30 +
31 See **sway-bar**(5) for details.
29 32
30**bindsym** <key combo> <command>:: 33**input** <input device> <block of commands>::
31 Binds _key combo_ to execute _command_ when pressed. You may use XKB key 34 Append _{_ to this command, the following lines will be commands to configure
32 names here (**xev**(1) is a good tool for discovering them). An example 35 the named input device, and _}_ on its own line will close the block.
33 bindsym command would be _bindsym Mod1+Shift+f exec firefox_, which would 36 +
34 execute Firefox if the alt, shift, and F keys are pressed together. Any 37 See **sway-input**(5) for details.
35 valid sway command is eligible to be bound to a key combo.
36 38
37**set** <name> <value>:: 39**set** <name> <value>::
38 Creates a substitution for _value_ that can be used with $_name_ in other 40 Creates a substitution for _value_ that can be used with $_name_ in other
@@ -107,6 +109,16 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
107The following commands may be used either in the configuration file 109The following commands may be used either in the configuration file
108or triggered at runtime. 110or triggered at runtime.
109 111
112**bindsym** <key combo> <command>::
113 Binds _key combo_ to execute _command_ when pressed. You may use XKB key
114 names here (**xev**(1) is a good tool for discovering them). An example
115 bindsym command would be _bindsym Mod1+Shift+f exec firefox_, which would
116 execute Firefox if the alt, shift, and F keys are pressed together. Any
117 valid sway command is eligible to be bound to a key combo.
118 +
119 **bindcode** <code> <command> is also available for binding with key codes
120 instead of key names.
121
110**debuglog** <on|off|toggle>:: 122**debuglog** <on|off|toggle>::
111 Enables, disables or toggles logging for debug. The toggle argument cannot 123 Enables, disables or toggles logging for debug. The toggle argument cannot
112 be used in the configuration file. 124 be used in the configuration file.