Commit graph

131 commits

Author SHA1 Message Date
S. Christoffer Eliesen
2779559b15 config: free_bar: Check if outputs is NULL.
bar_config.outputs is NULL if no output is explicitly defined in config
(ie. use for for all outputs).
2015-12-20 10:14:36 +01:00
Mikkel Oscar Lyderik
207678e809 Add support for running swaybar_command 2015-12-19 01:03:39 +01:00
Drew DeVault
b9f14cee41 Merge pull request #359 from mikkeloscar/i3bar-command
Add bar option: swaybar_command <command>
2015-12-18 18:19:59 -05:00
Mikkel Oscar Lyderik
9d7f1afdfb Add bar option: swaybar_command <command> 2015-12-19 00:13:51 +01:00
Mikkel Oscar Lyderik
90ff36cab8 Terminate children when freeing output container 2015-12-18 18:27:54 +01:00
Mikkel Oscar Lyderik
ede27eabc5 Reload swaybar/swaybg on config reload.
This works by tracking the pids of the child processes in the related
output container and terminating the processes and spawning new ones on
a config reload.

Should solve: #347
2015-12-18 18:27:44 +01:00
Drew DeVault
03787871d0 Fix bar invocation for multihead setup 2015-12-16 19:36:31 -05:00
Drew DeVault
1a365f19c9 Use system swaybar instead of local swaybar 2015-12-16 19:30:38 -05:00
Drew DeVault
60c204a09b Invoke swaybar when an output matches a bar config 2015-12-16 19:29:47 -05:00
Drew DeVault
01798a5ae2 Merge pull request #338 from mikkeloscar/bar-separator-symbol
Implement bar option: separator_symbol
2015-12-16 07:47:00 -05:00
Mikkel Oscar Lyderik
053fb09d1e Use free_flat_list for simple char* list.
No need to reimplement free_flat_list functionality.
2015-12-16 13:06:54 +01:00
Mikkel Oscar Lyderik
2fd7dd64ec Implement bar option: separator_symbol 2015-12-16 13:01:11 +01:00
Mikkel Oscar Lyderik
47f4aea9e7 Correctly free bindings list 2015-12-15 22:16:54 +01:00
Mikkel Oscar Lyderik
f59f5d27aa Implement bar option: output <output> 2015-12-15 22:01:53 +01:00
Mikkel Oscar Lyderik
05e7334106 Fix active_workspace_border color definition 2015-12-15 15:08:41 +01:00
Mikkel Oscar Lyderik
6834a33290 Add bar height option (Airblader/i3) 2015-12-15 15:02:13 +01:00
Mikkel Oscar Lyderik
de1f625c27 Add rgba support for bar colors 2015-12-15 13:45:04 +01:00
Mikkel Oscar Lyderik
8c1d56812b Implement bar option: colors {} 2015-12-15 13:12:55 +01:00
Drew DeVault
242da783f4 Merge pull request #324 from mikkeloscar/free-bar-bindings
Free bar->bindings
2015-12-14 19:58:41 -05:00
Mikkel Oscar Lyderik
95de999922 Free bar->bindings 2015-12-15 01:53:34 +01:00
Mikkel Oscar Lyderik
0513322c03 Move default bar config to bar creation.
Get rid of `config->bar` and define the default bar config options when
a bar is initialized.
2015-12-15 01:05:00 +01:00
Yacine Hmito
87126a9fc2 Added bar_cmd_bindsym
Defined a sway_mouse_binding for clicks on the swaybar
2015-12-15 00:15:32 +01:00
Mikkel Oscar Lyderik
0aeee6963d Make mouse key used for drag/resize configurable
This makes it possible to define what mouse button key (left|right) to
use for dragging/resizing.
2015-12-14 22:31:34 +01:00
Mikkel Oscar Lyderik
211bc71599 Use tabs instead of spaces 2015-12-14 16:38:49 +01:00
Drew DeVault
4d17aa9919 Revert "Make mouse key used for drag/resize configurable"
This reverts commit 22916e9ebc.
2015-12-14 08:57:00 -05:00
Mikkel Oscar Lyderik
0a8ec26383 Implement bar option: tray_padding <px> [px] 2015-12-14 12:56:59 +01:00
Mikkel Oscar Lyderik
74152043f4 Implement 'bar { }' block parsing 2015-12-14 12:56:45 +01:00
Drew DeVault
19fd979af4 Merge pull request #300 from mikkeloscar/configure-mouse-btn
[RFC] Make mouse key used for drag/resize configurable
2015-12-12 12:28:56 -05:00
Drew DeVault
bffbe11e53 Fix config.c strlen error 2015-12-11 14:22:28 -05:00
Mikkel Oscar Lyderik
22916e9ebc Make mouse key used for drag/resize configurable
This makes it possible to define what mouse button key (left|right) to
use for dragging/resizing.
2015-12-11 18:04:27 +01:00
Yacine Hmito
f3f77f9ff1 FALLBACK_CONFIG_DIR did not work. Fixed.
- Flag was ignored. Now it's taken into account.
- Missing trailing slashes in path now behaves properly.
2015-12-01 19:41:44 +01:00
Yacine Hmito
09feef89ee Can customize config fallback directory
CMake takes a `FALLBACK_CONFIG_DIR` flag which is the directory where the
standard configuration file `config` is copied at installation.
If loading from typical configuration directories fails, sway loads
FALLBACK_CONFIG_DIR/config (/etc/sway/config by default).
2015-12-01 01:07:48 +01:00
Drew DeVault
44d0f731c3 Add framework for switching command sets
This will allow the bar {} block to have a different command set (and
also bar { colors { } }.
2015-11-29 17:20:27 -05:00
Drew DeVault
4f89735fc4 Add bar config struct and defaults 2015-11-29 17:05:04 -05:00
Christoph Gysin
b1bd3ae6f3 cmd_output: Merge instead of replace output config 2015-11-29 23:17:56 +02:00
Drew DeVault
5a369b3132 Only strip comments at the start of a line
This is necessary because i3 config files use CSS notation for colors
(i.e. #rrggbb).
2015-11-29 14:02:58 -05:00
Christoph Gysin
ffdfaaa985 apply_output_config: use list_seq_find() to find config 2015-11-29 15:31:58 +02:00
Christoph Gysin
7d82cd9c0a cmd_output: Use list_seq_find() to find matching config 2015-11-29 15:29:06 +02:00
Drew DeVault
1661edee28 Allow output config for output named *
Which will match any output.
2015-11-28 10:18:37 -05:00
Drew DeVault
2f192cceca Improve config file loading
This also makes it so that your i3 config is used before
/etc/sway/config.
2015-11-28 10:00:53 -05:00
Christoph Gysin
e362f871d9 Call swaybg without invoking a shell
This makes escaping the arguments obsolete.

Also avoid dynamic memory allocation for the output id. It only supported ids up
to 99. Now we support up to 999, and take 4 bytes off the stack instead.
2015-11-25 23:19:11 +02:00
Drew DeVault
9fb020d04c Merge pull request #251 from sce/criteria_1
criteria: Add. Learn for_window command.
2015-11-25 09:28:43 -05:00
Christoph Gysin
eeb7f5c036 config: print line number 2015-11-25 15:48:27 +02:00
S. Christoffer Eliesen
a06cb7cd01 criteria: Add. Learn for_window command.
A criteria is a string in the form of `[class="regex.*" title="str"]`.
It is stored in a struct with a list of *tokens* which is a
attribute/value pair (stored as a `crit_token` struct). Most tokens will
also have a precompiled regex stored that will be used during criteria
matching.

for_window command: When a new view is created its metadata is tested
against all stored criteria, and if a match is found the associated
command list is executed.

Unfortunately some metadata is not available in sway at the moment
(specifically `instance`, `window_role` and `urgent`). Any criteria
string that tries to match an unsupported attribute will fail.

(Note that while the criteria code can be used to parse any criteria
string it is currently only used by the `for_window` command.)
2015-11-25 14:34:33 +01:00
S. Christoffer Eliesen
a6c9f40b9a sway_binding_cmp_keys: Differentiate between modifier keys.
Compare modifiers as well as keys when number of modifiers+keys are the
same (so that e.g. mod1+x != mod4+x).
2015-11-24 19:26:43 +01:00
taiyu
9d50f88cef fix list sorting 2015-11-24 00:30:02 -08:00
S. Christoffer Eliesen
a0c5a0bb30 cmd_bindsym: Detect/handle duplicates.
Also replace `bindsym_sort` with function `sway_binding_cmp` that takes
all data into account when comparing.
2015-11-22 21:17:36 +01:00
S. Christoffer Eliesen
5531dbe1b2 cmd_workspace: Don't fill up config->workspace_outputs with duplicates.
This also fixes a bug where issuing a new "workspace a output b" command
for an already assigned workspace would not work (the old config would
be found first and used instead).
2015-11-22 11:08:08 +01:00
Drew DeVault
2100d7bfef Fix #240 2015-11-19 20:04:03 -05:00
Drew DeVault
5728307520 Add wallpapers to output command 2015-11-19 18:55:17 -05:00