Commit graph

262 commits

Author SHA1 Message Date
Drew DeVault 9aed9d9359 UnGNUify the codebase 2017-03-10 23:41:24 -05:00
Drew DeVault 74d4f1bec9 Further indentation corrections 2017-03-10 21:41:14 -05:00
Drew DeVault 126ce571da Read configs from /etc/sway/security.d/* 2017-02-20 07:51:31 -05:00
Drew DeVault b10721b89e Add initial support code for new IPC security 2017-02-20 06:11:56 -05:00
Drew DeVault 7c636da8a3 Fix format error 2017-01-08 11:07:45 -05:00
Drew DeVault 36e48fcf8d Update default swaybar command
Fixes #988
2016-12-23 11:21:18 -05:00
Drew DeVault 1172566d4e Change how security config is loaded 2016-12-17 15:21:57 -05:00
Drew DeVault 10c8b73075 Handle calloc failures 2016-12-15 19:01:41 -05:00
Drew DeVault d75a747a3d Handle config-related allocation failures 2016-12-15 19:01:41 -05:00
Drew DeVault 4c6c65e70c Handle malloc failures from read_line 2016-12-15 19:01:40 -05:00
Drew DeVault c8dc4925d1 Add IPC security policy command handlers 2016-12-02 17:34:26 -05:00
Drew DeVault e9e1a6a409 Add IPC policy to config
Also reduces enum abuse, cc @minus7
2016-12-02 16:08:45 -05:00
Drew DeVault f23880b1fd Add support for command policies in config file 2016-12-02 08:10:03 -05:00
Drew DeVault 44cc0ef125 Add config related code and initial headers 2016-12-01 19:38:36 -05:00
D.B 3d1b472b83 swap unnecessary function for strndup 2016-11-03 06:43:12 +01:00
D.B 58eb7ac19f change bar colors from char[10] to *char
This commit removes has_* booleans from bar color struct. It also
generalizes of functions in commands/bar/colors.c.
2016-11-02 21:07:04 +01:00
D.B 39ee0ec552 use urgent_ws color in swaybar if binding_mode is undefined 2016-11-02 18:58:33 +01:00
Michał Winiarski e8d8abfbb5 Add left_handed support for input devices
Some users may want to switch buttons on their input devices, turns out
libinput already supports it. Let's add a support for it in our config.

Signed-off-by: Michał Winiarski <knr@hardline.pl>
2016-10-25 22:06:23 +02:00
Mykyta Holubakha 2a24772c4b config: set pango_markup default to false 2016-10-20 16:43:38 +03:00
Ryan Dwyer e4cb4d1b5c Fix swaybar when running on named outputs.
When using a bar on a named output, load_swaybars() requires the
output to be active (ie. in the root container), but this is not the case if
the bar is added to the last output. To fix this, load_swaybars() is now
called after the output has been added to the root container.

After fixing that, swaybar would segfault due to using the wrong index
variable when loading outputs and config.
2016-09-17 17:25:45 +10:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
James Murphy 8af49eb696 Avoid dereferencing null configuration
Fixes: https://github.com/SirCmpwn/sway/issues/865
2016-08-20 16:24:08 +00:00
D.B ce98569fbc Handle output disabling during runtime
Output now gets disabled if disable command is invoked via bindsym or
IPC.
2016-08-10 18:52:49 +02:00
minus b246799548 fixed uninitialized bar.wrap_scroll 2016-08-02 22:02:39 +02:00
Drew DeVault 11e7ca044c Update hidpi support to latest wlc API 2016-07-28 14:36:49 -04:00
Drew DeVault 6ea02f3064 Initial pass on HiDPI support 2016-07-28 14:36:49 -04:00
minus 50b09937b2 clean up apply_input_config 2016-07-18 20:12:49 +02:00
Drew DeVault 6d971af5c3 Turn swaybg into a shell surface 2016-07-17 11:55:05 -04:00
Zandr Martin 9ecb43ea3b
couple small fixes 2016-06-11 15:29:04 -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
thuck 3710cd6963 Fix segfault when using include with *
This should fix the issue #681
2016-06-06 22:20:27 +02:00
Zandr Martin 0f1859ed25 messy, unfinished version 2016-06-06 06:58:53 -05:00
Denis Doria b692a6d31a Initial implementation for floating_maximum_size 2016-06-02 17:35:02 +02:00
Denis Doria 009eaccd42 Clean up not used variables 2016-06-01 14:44: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
Denis Doria f1d5b89d3e Initial work for floating view with sane values 2016-05-31 14:59:33 +02:00
Mykyta Holubakha e73dde3b10 Support floating_scroll sideways 2016-05-14 23:42:02 +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
Daniel Lockyer b41097c085 sway/config.c: fix double free issue as we need to store path in list 2016-05-05 23:50:12 +01:00
Jasen Borisov de007c9b58 Add input cmd for setting pointer accel profile. 2016-05-01 11:02:44 +01:00
Daniel Lockyer 682efbb7dd sway/config.c: Initialise struct value 2016-04-30 01:12:41 +01:00
Daniel Lockyer e1fa51a152 sway/config.c: Move the wordfree call before the if statement so it is always called 2016-04-29 18:36:29 +01:00
Daniel Lockyer 06986e58b8 sway/config.c: Change to the useful free_cmd_results helper method 2016-04-29 18:31:21 +01:00
Daniel Lockyer 01c2b5f2d6 sway/config.c: move free call to after sway_log 2016-04-29 18:27:49 +01:00
Daniel Lockyer b8722ecd5f sway/config.c: Leading on from cdf017c, we need to free path 2016-04-29 18:09:56 +01:00
Daniel Lockyer e077ebdc72 sway/config.c: res->input is a malloc'ed section which wasn't freed 2016-04-29 18:08:28 +01:00
Daniel Lockyer cdf017ceea sway/config.c: wordexp has a corresponding wordfree which was never used
I had to change the assignment to path to be wrapped by strdup as we
pass the data out of the method.
2016-04-29 18:07:38 +01:00
Daniel Lockyer c225bcacee sway/config.c: config_home is the result of a malloc but was never freed 2016-04-29 18:06:21 +01: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
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
Drew DeVault a12850444d New feature: adjust gaps with floating_mod+scroll
I made this configurable but I didn't make the command for it. That's
left as an exercise to an eager contributor.

    mod_scroll_behavior [gaps inner|gaps outer]

Would merge implementions of more behaviors for mod+scroll, if anyone
has some neato ideas.
2016-03-30 08:34:32 -04: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
Mikkel Oscar Lyderik e2774aee3c Add default border colors 2016-03-30 00:47:58 +02: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 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
Mikkel Oscar Lyderik 2935e24cf5 Implement 'smart_gaps' feature from i3-gaps 2016-03-20 12:29:47 +01: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 bad4e22f3b Make sway spawn only one bar per bar config 2016-02-27 22:12:35 +01: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
Yacine Hmito c487cf71a5 Fix issue #455
CMAKE_INSTALL_FULL_SYSCONFIG is not actually passed to
the C preprocessor. I remember it working, so I must have
messed up somewhere last time I touched this.
This is fixed by manually passing its value to the C preprocessor
through the SYSCONFDIR definition
2016-01-21 21:08:18 +01:00
Drew DeVault d969a1dec0 Fix memory leak in config.c
Thanks @jollywho
2016-01-21 11:18:13 -05:00
Cole Mickens 28081b7689 libinput 2016-01-19 06:51:36 -08: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 32cd3f70eb Add function for duplication a sway_binding 2016-01-08 03:03:55 +01: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 7727c9efbc Detect bar modifier pressed/released 2016-01-05 00:49:44 +01:00
Yacine Hmito f02cf75ff3 Use SYSCONFDIR as recommended
- swaylock config path not hardcoded anymore
- the unusual and weird FALLBACK_CONFIG_DIR is no more
2015-12-23 12:22:48 +01:00
Drew DeVault 91c102a897 Merge pull request #393 from robotanarchy/musl-libc-compatibility
musl libc compatibility
2015-12-21 20:42:08 -05:00
robotanarchy c3e9ee5e43 replace non-standard qsort_r with qsort
I've tried to make as few changes, as possible.

Usually the reason for using qsort_r is, that you can pass an extra userdata pointer to the
compare function. However, in sway list_sort wrapped qsort_r and always called a wrapper
function for comparing, the wrapper function then had the real compare function as argument.
The only thing, that the wrapper function does, is dereferencing the 'left' and 'right' function
arguments before passing them to the real compare function.

I have renamed list_sort to list_qsort to avoid confusion (so nobody tries to use list_qsort like
list_sort) and removed the wrapper functionality. Now the dereferencing must be done in the
compare function, that gets passed.

Some compare functions were used in both list_sort and list_seq_find. To make the difference
clear, I've added a '_qsort' suffix to the compare functions, that are intended to be used with
the new list_qsort. (In other words: list_qsort is not compatible anymore with list_seq_find).

- Changed and renamed function (it isn't used anywhere but in commands.c, and only for sorting):
	compare_set -> compare_set_qsort
- New wrapper functions:
	sway_binding_cmp_qsort (for sway_binding_cmp)
	sway_mouse_binding_cmp_qsort (for sway_mouse_binding_cmp)
2015-12-22 00:38:18 +01:00
Drew DeVault fc71c6303c Fix default swaybar font 2015-12-21 05:07:19 -05:00
Drew DeVault 33fb648938 Merge pull request #372 from sce/fix_swaybar_output_name_test
config: load_swaybars: Fix name comparison.
2015-12-20 09:23:34 -05:00
S. Christoffer Eliesen 6ace37d0b1 config: load_swaybars: Fix name comparison. 2015-12-20 12:53:56 +01:00
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