Commit Graph

402 Commits

Author SHA1 Message Date
Tony Crisci 88b7cbe314 Implement `focus child` command
The `focus child` command focuses the child container within the selected
container.
2016-07-27 22:48:46 -04:00
Tony Crisci 0d461ad988 Put ipc command result json in an array
For compatibility with i3, put the command result into an array.

Returning multiple command results is still unsupported.
2016-07-23 23:13:09 -04:00
Mykyta Holubakha 976e48d79f Initial work on window events 2016-07-21 21:51:20 +03:00
David Eklov d9eb49f3b1 Add missing entry to list of accepted arguments for the move command 2016-07-17 22:52:39 -05:00
David Eklov d202ca2fd7 Do not crash when handling the command 'move position'
Sway expected 'move position' to be 'move position mouse'. If mouse is not
present in the command, Sway crashes.
2016-07-17 22:50:15 -05:00
Drew DeVault 3bb880bf20 Implement configurable wrapping on bar ws scroll 2016-07-17 11:26:38 -04:00
D.B ad7605675e refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed 2016-07-16 15:34:43 +02:00
D.B ee67cd0ba1 Fix tabbed/stacked corner case #742
Tabbed/stacked containers are now created only if a view is present on
the workspace. If a view is created on previously empty tabbed/stacked
workspace, it gets wrapped in a container.
2016-07-07 22:28:57 +02:00
Zandr Martin d5e4fff345
resize command updates (#713) 2016-07-03 12:11:21 -05:00
Zandr Martin aced6daa19
match i3 syntax for `resize set` 2016-07-03 07:05:10 -05:00
Drew DeVault 71f710cf0f Minor fix to warning messages 2016-06-19 10:01:15 -04:00
Zandr Martin 889618d3ee
implement resize command for absolute dimensions 2016-06-11 17:02:16 -05:00
Zandr Martin 2298143d09
cleanup + add timeouts for pid_workspace list 2016-06-11 12:43:34 -05:00
Zandr Martin 66caee645c Merge branch 'master' into assign-command 2016-06-11 09:33:24 -05:00
Zandr Martin b00feb25ea
trigger bg change on config reload 2016-06-10 07:12:25 -05:00
Zandr Martin 0f1859ed25 messy, unfinished version 2016-06-06 06:58:53 -05:00
Denis Doria 3c3e98b1a3 Merge branch 'master' into variables_corner_cases 2016-06-05 07:49:33 +02:00
Zandr Martin 3746542462 add documentation for client commands 2016-06-04 10:43:23 -05:00
Denis Doria 29eb3bf746 Put w to uppercase just to keep consistency between warnings 2016-06-03 11:28:10 +02:00
Denis Doria bf2298e0a5 Includes $ for variables without it 2016-06-03 11:26:47 +02:00
thuck f55b5a4982 Fix identation issue 2016-06-03 00:36:41 +02:00
thuck e4f80877be Fix output command when varible not set
This should fix the corner case where a variable is not assigned, but used anyway.
This should solve partially the issue #681.
2016-06-03 00:05:10 +02:00
thuck 1ab3e1023e Including error message when variable do not start with $ 2016-06-02 23:23:04 +02:00
Denis Doria b692a6d31a Initial implementation for floating_maximum_size 2016-06-02 17:35:02 +02:00
Denis Doria 0ad7857f90 Included option floating_minimum_size
Values cannot be negative or 0; if so uses the default 75x50.
Uses the same syntax as i3: floating_minimum_size <width> x <height>, although the x can be anything.
2016-06-01 13:37:50 +02:00
Drew DeVault 3b1c125e18 Remove bar position left:right from docs
And adds a warning about using them (currently these are not supported
by swaybar).
2016-05-29 11:53:13 -04:00
Zandr Martin d291a29f30 enforce workspace output assignents
when creating a new output, move to that output all extant workspaces
that are assigned to that output.

(unrelated) remove comment that was no longer applicable, fix spacing in
an assignment
2016-05-28 18:18:46 -05:00
Zandr Martin 7df38ce9da remove alphabetic sorting from sort_workspaces
also add a couple missing spaces to container.c (unrelated)
2016-05-28 08:35:58 -05:00
Mykyta Holubakha 16dc31f33b Concatenate output cmd args, fixes #654 2016-05-23 13:09:18 -04:00
Mykyta Holubakha e73dde3b10 Support floating_scroll sideways 2016-05-14 23:42:02 +03:00
Mikkel Oscar Lyderik c80ad015ff Prevent changing layout when focusing float window
The layout command should only work with titled windows, thus it should
have no effect when a floating window has focus.

Should fix #643
2016-05-09 15:55:06 +02:00
Mykyta Holubakha 500ee0a731 Allow to set relative path for wallpapers in config 2016-05-08 22:59:06 +03:00
Mykyta Holubakha 0c495eecde Remove FSB_GAPS_INNER and FSB_GAPS_OUTER 2016-05-08 17:17:35 +03:00
Mykyta Holubakha 0423c41a0f Implemented configurable floating scroll behavior 2016-05-07 20:49:51 +03:00
Raman Varabets a9123c38b2 fix a typo (horiziontal -> horizontal) 2016-05-02 19:18:33 +08:00
Eric Engestrom e53ba08626 sway: fix potential buffer overflow 2016-05-01 13:57:23 +01:00
Jasen Borisov de007c9b58 Add input cmd for setting pointer accel profile. 2016-05-01 11:02:44 +01:00
Daniel Lockyer 5a7099eee0 sway/commands.c: add some free calls to release allocated memory 2016-04-29 16:16:47 +01:00
Drew DeVault 3be3867474 Fix oversight in ebdce71 2016-04-29 11:01:49 -04:00
Drew DeVault ebdce719b4 Fix -Wunused-result problems 2016-04-29 10:59:43 -04:00
Mikkel Oscar Lyderik 1fb9489032 Fix bindcode by offsetting xkb keycode by 8
The bindcode has to be offset by 8 to match the keycode we get from wlc.

https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon.h#L160
2016-04-28 21:05:38 +02:00
Mikkel Oscar Lyderik 6c7ed7e7cb Add title to nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 3e1f78ab26 Add support for nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik e226b20bd8 Reapply prev layout when exiting tabbed/stacked 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik d26658fb35 Correctly determine default layout 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 8d700fe008 Fix problems with floating windows
Makes any tabbed/stacked layout a container to separate from floating
windows which may be attached to a workspace.
2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik ec7ff769c7 Tabbed and stacked layout 2016-04-25 00:00:49 +02:00
Mykyta Holubakha 09d69f606a Renamed pango_markup config options 2016-04-24 20:39:41 +03:00
Mykyta Holubakha 0f1cfdec61 Renamed to pango_markup 2016-04-24 20:35:21 +03:00
Mykyta Holubakha 53b53dd8c2 Added plaintext markup configuration 2016-04-24 19:57:35 +03:00
Kevin Hamacher b6e2b6add9 Add border color commands 2016-04-03 17:14:14 +02:00
Eric Engestrom 3e8081514d Fix spelling mistakes 2016-04-02 16:00:05 +01:00
Mikkel Oscar Lyderik 7be476c115 Add cmds new_window and new_float
Makes it possible to set default layout style for new windows and new
floating windows.

Close #556
2016-03-31 12:42:20 +02:00
Mikkel Oscar Lyderik 63474aa04d Make pango: optional for bar font 2016-03-30 16:38:04 +02:00
Drew DeVault 4bf10d7771 Merge pull request #551 from mikkeloscar/window-borders
Implement Window borders
2016-03-30 07:41:13 -04:00
Mikkel Oscar Lyderik 948c594132 Allow surrounding spaces in mode name
This makes it possible to define a mode name with surrounding spaces if
so desired. e.g.:

    mode "   hello   " {  }
2016-03-30 12:58:50 +02:00
Mikkel Oscar Lyderik 5a13cb0ed1 Implement borders
The borders are implemented as a surface/buffer attached to each view
which is sent to and rendered by wlc in the view_pre_render callback.

All the drawing logic is handled in sway/border.c and all the logic for
calculating the geometry of the border/view is handled in
`update_geometry` in sway/layout.c (same place as gaps are calculated).
2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 3b05f92f76 Add border <none|normal|toggle|pixel> config 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 86ea79ea6d Implement parsing of hide_edge_borders 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik da567317ab Make pango: prefix optional for font config 2016-03-30 00:47:58 +02:00
Drew DeVault eacf3d0396 Loosen restrictions on commands, update docs
Closes #531
2016-03-27 12:41:42 -04:00
Mikkel Oscar Lyderik b5f34cc27d Load correct config on reload 2016-03-26 16:37:56 +01:00
Mikkel Oscar Lyderik 71a5350b68 Implement include command
The include command (`include <path>`) makes it possible to include sub
config files from the main config file (or from within other sub config
files).

The include command uses the following rules for including config files:

* the `path` can be either a full path or a path that is relative to the
  parent config. Shell expansion is supported, so it's possible to do
  `include ~/.config/sway.d/*`.
* The same config file can only be included once (to prevent include
  cycles). If a config is included multiple times it will just be
  ignored after it has been included once.
* Including a sub config file is the same as inserting the content of
  that file into the parent config, thus rules about overwriting
  bindsyms etc. works the same as for a single config.

Implement #542
2016-03-26 16:37:50 +01:00
Drew DeVault ca400e84f5 Merge pull request #525 from mikkeloscar/fix-clang-warning
Use correct type for keycode
2016-03-20 07:46:06 -04:00
Mikkel Oscar Lyderik c1f91c4f5e Use correct type for keycode 2016-03-20 12:41:26 +01:00
Mikkel Oscar Lyderik 2935e24cf5 Implement 'smart_gaps' feature from i3-gaps 2016-03-20 12:29:47 +01:00
Mikkel Oscar Lyderik 8c7bdfc004 Allow legal non-x11 keycodes 2016-03-19 13:36:37 +01:00
Mikkel Oscar Lyderik 9a04f9d8d6 Add config option workspace_layout
This implements the config parsing of
`workspace_layout <default|stacking|tabbed>`

http://i3wm.org/docs/userguide.html#_layout_mode_for_new_containers
2016-03-19 00:54:33 +01:00
Mikkel Oscar Lyderik 99f26c61a5 Don't strip quotes from exec args
Before passing a command to a command handler the quotes are stripped
from each argument in the command. This is usually the wanted behavior
but causes a problem in the case of `exec` where quoted arguments can be
required when passing the exec command to `/bin/sh -c`.

This patch makes `exec` a special case and doesn't strip quotes from the
arguments. It will just pass the exec command verbatim to the exec
command handler.

Fix #518
2016-03-18 10:02:18 +01:00
Mikkel Oscar Lyderik e15a8a0376 Improve how swaybars are spawned 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik bad4e22f3b Make sway spawn only one bar per bar config 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 5e253fdd9a Correctly exit sway on errors.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).

A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-26 09:42:21 +01:00
Mikkel Oscar Lyderik 739ba902e0 Prevent crash when showing scratchpad on new ws.
Fix #469
2016-02-25 11:43:07 +01:00
Mikkel Oscar Lyderik be6455b295 Squash trailing whitespace 2016-02-08 12:31:13 +01:00
Mikkel Oscar Lyderik bacd40d6db Fix clang warnings 2016-02-08 12:30:42 +01:00
crondog 7916eb70b9 commands: move position mouse
Bounds checking works ok except it overlaps the bar. Just like with
normal floating. Should be fixed once swaybar is fixed.
2016-01-28 22:10:56 +11:00
crondog 0ee5547406 font: Allow adding font to the config. In prep for border titles
v2: Give default font and make bar use it if no bar font
2016-01-27 20:53:31 +11:00
Mikkel Oscar Lyderik 32ae26e519 Add quotes to multiword arguments.
This adds quotes around multiword arguments before they are passed to
`/bin/sh -c` in an exec command.

Example:

I connect to irc like this:

    exec termite -e "mosh server tmux a"

Without this patch the arguments are passed to sh as:

    termite -e mosh server tmux a

When it should be:

    termite -e "mosh server tmux a"

For the command to work.
2016-01-25 00:14:13 +01:00
Drew DeVault a416715372 Revert "s/numlen/log10/g"
This reverts commit 038bb8cc7c.
2016-01-23 16:35:32 -05:00
Drew DeVault 038bb8cc7c s/numlen/log10/g 2016-01-23 15:51:38 -05:00
Quentin Glidic 449617f104 commands: Fix memory allocation in assign
Also use the safer snprintf since we just computed the size.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-01-23 20:22:51 +01:00
Quentin Glidic 43483d8fee commands: Fix usage of arrow in assign
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-01-23 20:22:51 +01:00
Mikkel Oscar Lyderik ac740271a5 Strip stray whitespace 2016-01-21 17:03:21 +01:00
Cole Mickens 28081b7689 libinput 2016-01-19 06:51:36 -08:00
crondog 81caf89ff8 cmd_assign
This implements cmd_assign. Basically a copy and paste from
cmd_for_window however it has → handling and injects a `move container to
workspace`
2016-01-15 16:03:34 +11:00
Mikkel Oscar Lyderik 0ba3f08f52 Strip quotes from workspace name v2
This is a more general fix for #444

This reverts part of commit 222f0d44fc.
2016-01-11 03:42:45 +01:00
Mikkel Oscar Lyderik fc8e5703a5 Strip quotes of each argv when handling command 2016-01-11 03:39:34 +01:00
Mikkel Oscar Lyderik 222f0d44fc Strip quotes from workspace name.
Fix #444

This is a temporary fix, the real fix is to store the commands as a
formatted argv array, so they don't have to be reformatted all over the
place.
2016-01-11 03:13:36 +01:00
Mikkel Oscar Lyderik f8b260d4a1 Add support for bincode command
If a bindsym and bincode maps to the same combination, the last one will
overwrite any previous mappings.
2016-01-09 18:07:47 +01:00
Mikkel Oscar Lyderik cb8ac7fd4a Unescape string after doing var replacement
Fix #426
2016-01-08 23:30:18 +01:00
Mikkel Oscar Lyderik 55f63935ab Implement bindsym --release
This is a "simple" version of --release (same as i3) that only supports
a binding that contain one normal key. e.g.:

    bindsym --release $mod+x exec somthing-fun

I didn't bother implementing it for a combination like `$mod+x+z` since
it is a bit tricky to get right and also a bit weird to actually do on a
keyboard.
2016-01-07 21:43:00 +01:00
Drew DeVault 8f5de70c93 Merge pull request #434 from mikkeloscar/detect-modifier
Send IPC modifier event on bar_modifier up/down
2016-01-06 07:26:54 -05:00
Mikkel Oscar Lyderik 843e2ad2c1 Only send modifier event once for active modifiers
This makes sure that a modifier event is only sent for active bar
modifiers, and that it is only sent once for each of those modifiers.

An active bar modifier is a modifier defined for a bar with `mode hide`
and `hidden_state hide`.
2016-01-05 23:18:59 +01:00
Mikkel Oscar Lyderik 95e0f44c73 Move modifier name table to common/util.c
Lookup of modifier names is required in several places, thus it makes
sense to move it to a general place.
2016-01-05 18:36:24 +01:00
Mikkel Oscar Lyderik c20c63b677 Send IPC modifier event on bar_modifier up/down
Detects when a bar modifier key is pressed/released and sends a modifier
IPC event to any listeners (usually swaybars).

This way a swaybar can listen on the modifier event and hide/show the
bar accordingly (not implemented yet)

The modifier event looks like this:

    {
      "change": "pressed", // or released
      "modifier": "Mod4"
    }
2016-01-05 02:25:56 +01:00
crondog b755fd073e Return focus to fullscreen view
This fixes https://github.com/SirCmpwn/sway/issues/431 by returning
focus to the fullscreen view. Also it fixes the issue with the
fullscreen view pointer not being set which did my head in
2016-01-05 10:55:29 +11:00
Mikkel Oscar Lyderik aa2f754c64 swaybar: Implement binding_mode_indicator 2016-01-03 22:16:36 +01:00
crondog 397b58e88f split toggle
Not sure if you will accept this, but i find it useful (I use it when
opening new terminal windows on a workspace

v2: add short hand command and docs
2015-12-31 11:14:06 +11:00
crondog 596c4d9428 Dont try and fullscreen a workspace with no views
Found this completely by accident
2015-12-30 13:50:50 +11:00
Mikkel Oscar Lyderik 16b8c2e915 Handle SIGTERM sent to sway
This makes sway handle and gracefully shut down everything when
receiving a SIGTERM.

Fix #416
2015-12-29 13:03:53 +01:00