Commit Graph

1044 Commits

Author SHA1 Message Date
Drew DeVault
062c74b7d0 Add command line to swaygrab
Also modifies IPC client so that we can work with persistent
connections.
2015-11-27 10:10:29 -05:00
Drew DeVault
59e97c2788 Add swaygrab(1) man page 2015-11-27 10:06:24 -05:00
Drew DeVault
7c04cd4fc8 Add swaygrab subproject 2015-11-27 09:53:50 -05:00
Drew DeVault
27f03c705d Move IPC client into common, refactor IPC 2015-11-27 09:50:04 -05:00
Drew DeVault
5ae359279b Fix build warnings 2015-11-27 09:42:24 -05:00
Drew DeVault
d95447fdd9 Fix mistake in CONTRIBUTING.md
3 commits should do it, right?
2015-11-27 09:19:18 -05:00
Drew DeVault
87e3778125 Update CONTRIBUTING.md 2015-11-27 09:18:46 -05:00
Drew DeVault
1e753e3a74 Write down style guidelines 2015-11-27 09:16:48 -05:00
Drew DeVault
d1012c497b Style enforcement 2015-11-27 08:59:21 -05:00
Drew DeVault
f8f0bcd4d3 Don't use the _t postfix on non-typedef structures 2015-11-27 08:52:59 -05:00
Drew DeVault
53d353e6b4 Add "variant": "sway" to IPC version response 2015-11-26 16:49:36 -05:00
Drew DeVault
4e7dccf631 Add swaymsg(1) man page 2015-11-26 15:14:23 -05:00
Drew DeVault
a1018f3280 Implement swaymsg IPC behavior 2015-11-26 15:06:41 -05:00
Drew DeVault
9a15371ba3 Parse command line args for swaymsg 2015-11-26 14:31:29 -05:00
Drew DeVault
d69cbeabc0 Add swaymsg subproject 2015-11-26 12:41:24 -05:00
Drew DeVault
206606b32c Merge pull request #261 from christophgysin/exec
Call swaybg without invoking a shell
2015-11-25 18:59:35 -05:00
Drew DeVault
a713686daa Merge pull request #260 from christophgysin/scale
implement background scaling
2015-11-25 18:58:23 -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
Christoph Gysin
be3fae148b swaybg: implement scaling mode "fit" 2015-11-25 22:32:02 +02:00
Christoph Gysin
8630bc3752 swaybg: implement scaling mode "tile" 2015-11-25 22:31:39 +02:00
Christoph Gysin
621062f18d swaybg: implement scaling mode "center" 2015-11-25 22:31:35 +02:00
Christoph Gysin
81a87ec7a7 swaybg: implement scaling mode "fill" 2015-11-25 22:29:49 +02:00
Christoph Gysin
904983c375 swaybg: implement scaling mode "stretch" 2015-11-25 21:36:48 +02:00
Christoph Gysin
504ac84cbc swaybg: check for exact number of arguments 2015-11-25 21:00:23 +02:00
Christoph Gysin
78c2e29328 swaybg: make argv const 2015-11-25 21:00:23 +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
Drew DeVault
964b4d2ddb Merge pull request #259 from christophgysin/lineno
config: print line number
2015-11-25 09:09:05 -05:00
S. Christoffer Eliesen
5483fe1883 criteria: Code formatting. 2015-11-25 14:59:07 +01:00
Drew DeVault
0976bf7f68 Merge pull request #258 from christophgysin/whitespace
config: remove trailing whitespace
2015-11-25 08:53:33 -05:00
Christoph Gysin
eeb7f5c036 config: print line number 2015-11-25 15:48:27 +02:00
Christoph Gysin
71f28fae57 config: remove trailing whitespace 2015-11-25 15:48:13 +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
Drew DeVault
402c9f4bf0 Merge pull request #255 from christophgysin/ninja
cmake: fix ninja build
2015-11-25 08:19:34 -05:00
Drew DeVault
d4ac0df906 Merge pull request #257 from christophgysin/missing-include
extensions: add missing include
2015-11-25 07:44:06 -05:00
Christoph Gysin
1b5e0020c3 cmake: fix ninja build
When using the ninja generator:

  $ cmake -G Ninja <dir>
  $ ninja -C <dir>

This commit fixes the warning:

ninja: warning: multiple rules generate bin/wayland-desktop-shell-protocol.c.  builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
2015-11-25 14:39:14 +02:00
Christoph Gysin
a99aa92bc6 extensions: add missing include
This fixes a compiler warning:

../sway/extensions.c: In function ‘set_background’:
../sway/extensions.c:16:37: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
  struct background_config *config = malloc(sizeof(struct background_config));
                                     ^
../sway/extensions.c:16:37: warning: incompatible implicit declaration of built-in function ‘malloc’
../sway/extensions.c:16:37: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
2015-11-25 14:39:09 +02:00
taiyu
a0b5953aa8 Merge pull request #254 from christophgysin/typo
cmake: Fix typo
2015-11-25 04:38:20 -08:00
Christoph Gysin
590c46aa69 cmake: Fix typo 2015-11-25 14:09:26 +02:00
Drew DeVault
a642827dfb Merge pull request #253 from sce/add_sibling_handle_floating_alt1
Handle floating views in layout code
2015-11-24 16:10:01 -05:00
S. Christoffer Eliesen
e31a899841 layout: get_swayc_in_direction_under: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen
b5ddad4bf6 layout: swap_container: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen
ed1b0bffbc layout: replace_child: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen
8aef255d5f layout: add_sibling: Handle floating views properly.
This should fix #241.
2015-11-24 21:34:24 +01:00
Drew DeVault
53ec7a74b6 Merge pull request #252 from sce/fix_binding_cmp
sway_binding_cmp_keys: Differentiate between modifier keys.
2015-11-24 15:32:35 -05: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
Drew DeVault
8ad8ceeeb9 Merge pull request #250 from sce/initial_support_for_criteria_strings
Initial support for criteria strings
2015-11-24 10:56:29 -05:00
S. Christoffer Eliesen
db92920cf9 handle_command: Skip commands that has a criteria string.
We can't handle them currently (the criteria needs to e.g. be passed to
each command handler which then needs to do the right thing), so it's
better to just do nothing than to create unexpected results (because the
command was executed on the wrong view).

(Before this patch any command list with a criteria string would simply
fail to parse, so this is at least a step in the right direction.)
2015-11-24 16:29:28 +01:00
S. Christoffer Eliesen
b7e3d05ace stringop: Properly handle criteria strings.
A criteria string (e.g. '[class="something" title="something"]') is now
correctly treated as a single argument.
2015-11-24 16:12:37 +01:00
Drew DeVault
e7c0573a98 Merge pull request #249 from sce/extra_view_metadata
Extra view metadata
2015-11-24 10:12:08 -05:00
S. Christoffer Eliesen
4367e6d3e3 container: Store app_id attribute for views. 2015-11-24 16:00:41 +01:00