Commit graph

815 commits

Author SHA1 Message Date
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
Mikkel Oscar Lyderik e2774aee3c Add default border colors 2016-03-30 00:47:58 +02:00
Drew DeVault b903f7f655 Implement some more on borders
Note that this segfaults ALL THE TIME in wlc code. Paging @Cloudef for
help, I'm at a loss.
2016-03-30 00:47:58 +02:00
Drew DeVault a8e084433d Window borders proof of concept 2016-03-30 00:47:58 +02:00
Drew DeVault 4611bba3db Initial setup of window border rendering
Please don't complain to me about the performance of this
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
Drew DeVault 59a1c5c28c Update sway(1) 2016-03-27 12:24:06 -04:00
Mikkel Oscar Lyderik cdc73fd95e Don't try to read config if not a file. 2016-03-26 17:54:50 +01:00
Mikkel Oscar Lyderik 44ea92ea60 Add config path to error msg 2016-03-26 16:50:47 +01:00
Mikkel Oscar Lyderik b5f34cc27d Load correct config on reload 2016-03-26 16:37:56 +01:00
Mikkel Oscar Lyderik 39df452dc1 Document include command 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
Mikkel Oscar Lyderik 938ff29b7b Gracefully exit when config is not found
This makes sure that sway will gracefully exit if the config is not
found or sway is unable to read it.
2016-03-24 22:20:25 +01:00
Drew DeVault 06107bb44e Make the nvidia warning louder 2016-03-24 16:48:53 -04:00
Drew DeVault fd061d4dc4 Don't set WLC_DIM on startup 2016-03-24 14:09:18 -04:00
Drew DeVault 5c85c018b4 Update to new WLC API 2016-03-24 14:08:53 -04: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 bb32cba795 Make key handling less strict
Sway has been very strict when it comes to key handling. Only on an
exact match would a bindsym be triggered.

This patch makes it less strict by for instance allowing the key combo
`$mod+1+2` to act as `$mod+2` if 2 was the last pressed key and `$mod+1`
if 1 was the last pressed key.

The new key handling uses the following algorithm:

1. List of bindings sorted by number of keys in binding (already the
default)
2. Find all bindings covered by the current keyboard state and list them
by same order as in 1.
3. Select the first binding from the list where the last pressed key is
part of the binding.

Addresses #452
2016-03-19 14:06:46 +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 f63512480c Remove unused panel_size (and fix rearrange)
desktop_shell.panel_size was only used to determine if sway should
rearrange the output when rendering the panel in the output_pre_render
hook. This is not needed since the output will have been arranged at
that point.
It also caused sway to rearrange all the time when running with two
or more different monitors/resolutions because panel_size kept changing
with every output_pre_render callback.

Should fix #514
2016-03-17 23:47:42 +01:00
Mikkel Oscar Lyderik c1d5791482 Focus correct swaylock view in multimonitor setup
Swaylock spawns and focuses a view for each output in sway. This can
sometimes move the focus to a new output after locking and unlocking the
screens.

This patch makes sure that the output which had focus when swaylock
was invoked, will regain focus once swaylock is closed/unlocked.

Fix #499
2016-03-17 17:02:17 +01:00
Mikkel Oscar Lyderik db7697b830 Document swaybar commands
Documents most of the bar commands in sway-bar(5) manpage.

The following command has not been document because they haven't been
fully implemented yet:
 * mode
 * hidden_state
 * modifier
 * tray_output
 * tray_padding

Close #375
2016-03-17 15:41:24 +01:00
Mikkel Oscar Lyderik 9faa4ba0a0 Schedule render when adding bg and panel.
This should be a real fix for #509

This schedules a render when a background or panel is added to sway
through the desktop shell interface, that makes sure the render isn't
scheduled before the bg or panel is ready and you don't end up with a
black screen until the cursor is moved.
2016-03-17 12:05:54 +01:00
Mikkel Oscar Lyderik 1349a44171 Revert "Render outputs as soon as wlc is ready"
This reverts commit 96458bf63c.
2016-03-17 12:05:32 +01:00
Mikkel Oscar Lyderik 96458bf63c Render outputs as soon as wlc is ready
This makes sure that the outputs are rendered when sway is launched, so
the user doesn't have to move the cursor before the background and bar
gets rendered on screen.

Fixes #509
2016-03-13 17:13:30 +01:00
Mikkel Oscar Lyderik eb82a500c8 Remove focus when switching to empty workspace
Fix #504
2016-03-05 15:39:28 +01:00
Drew DeVault 181b6b31a4 Merge pull request #502 from mikkeloscar/lock-reset-input
Reset input state when locking compositor
2016-03-04 13:47:08 -05:00
Mikkel Oscar Lyderik ceb0ef64c2 Reset input state when locking compositor
Fix #498
2016-03-04 17:10:43 +01:00
Mikkel Oscar Lyderik 8ddafeeaae Fix assigning workspaces to outputs
It's possible to assign workspaces to certain outputs using the command:

    workspace <name> output <output>

However, this did not work in some cases where the workspace was
assigned before the given output was made available to sway.

This patch fixes those cases.
2016-03-04 16:44:49 +01:00
Yacine Hmito 9437eca3eb Segregate between config and runtime cmds in doc
In anticipation for #375, reorganized and augmented slightly sway(5)
so it makes a difference between commands intended for configuration,
commands intended for control, and those that can serve as both.
2016-02-29 22:12:39 +01:00
progandy 33887e3955 sway: rearrange the whole ws on lock view setup 2016-02-28 21:24:12 +01:00
progandy 52ff89cecc sway: set lock view to floating after ws switch
This avoids calling swayc_active_workspace.
2016-02-28 21:22:57 +01:00
Mikkel Oscar Lyderik 6088c6cdf0 Correctly move focus from one output to a new one.
This patch aims to correctly handle moving focus <left|right|up|down>
between outputs.

For instance, if moving from one output to a new output at the left of
the current one, it should focus the right-most view/container on the
new output, and the opposite if moving from right to left. This should
happen regardless of the previously stored focus of the new output.

This also handles moving to a new output above or below the current one.
2016-02-28 18:20:18 +01:00
Drew DeVault 3453910c3e Merge pull request #492 from mikkeloscar/swaybar-multi-output
Display single swaybar on multiple outputs
2016-02-27 16:18:50 -05:00
Mikkel Oscar Lyderik 67bbcceba1 Free config before exiting sway.
Apart from freeing the sway_config struct, this also terminates the
swaybars spawned by sway, since they are linked by PID to the bar config
structs.
2016-02-27 22:13:15 +01:00
Mikkel Oscar Lyderik e15a8a0376 Improve how swaybars are spawned 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 212c6a18a2 Add outputs to bar_config ipc response 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 5ff3fb1c04 Set pointer pos before focusing view under it 2016-02-27 13:18:55 +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
Yacine Hmito c400ca8f88 Fix for when sway_abort doesn't exit
sway_terminate does an exit in case wlc_terminate doesn't
2016-02-25 23:46:27 +01:00
Yacine Hmito 8db417fafe Fixed swaymsg command name in sway(5) doc 2016-02-25 23:05:38 +01:00
Yacine Hmito e239fbbd88 No options when using sway as IPC client
Sway used to attempt sending an IPC command composed of every argument
after the first non-option argument encountered.
Now, raises an error if an option is encountered before the intended command.
Some options such as -h or -v take effect when parsing, so they still
apply.
2016-02-25 23:04:59 +01:00
Yacine Hmito 179192e222 Removed p as a valid CLI option
The get-socketpath long option had an undocumented short alternative
as `p`. It has been removed.
However, the code in the options array is still the 'p' char.
2016-02-25 21:50:24 +01:00