aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output
Commit message (Collapse)AuthorAge
* output_cmd_background: fix no file + valid modeLibravatar Brian Ashworth2019-02-11
| | | | | | | | | | | | | If output_cmd_background is given a valid mode as the first argument, then there is no file given and an error should be returned. join_args should not be called with an argc of zero since it sets the last character to the null terminator. With an argc of zero, the length is zero causing a heap buffer overflow when setting the byte before the start of argv to '\0'. This probably will not ever generate a segfault, but may cause data corruption to whatever is directly before it in memory. To make other such cases easier to detect, this also adds a sway_assert in join_args when argc is zero.
* Use sway_log_errno instead of strerrorLibravatar Ian Fan2019-01-24
|
* Don't allow noop output to be configuredLibravatar Ryan Dwyer2019-01-22
|
* Prevent noop output from being enabledLibravatar Ryan Dwyer2019-01-22
|
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Don't escape swaybg arguments anymoreLibravatar emersion2019-01-18
| | | | | | | swaybg used to be invoked with sh, which made escaping necessary. This is no longer necessary. Fixes https://github.com/swaywm/sway/issues/3456
* Remove now-unused "input" argument of cmd_results_newLibravatar M Stoeckl2019-01-14
| | | | | | | | | Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
* Combine output_by_name and output_by_identifierLibravatar Brian Ashworth2018-12-20
| | | | | | | | This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list.
* Introduce a way to show config warnings in swaynagLibravatar Brian Ashworth2018-11-28
| | | | | | | | | | Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that handlers can add warnings to the swaynag config log in a uniform way. The formatting is identical to errors and include the line number, line, and config path. This also alters the background file access warning to use the function and introduces a warning for duplicate bindings.
* Add relative output transformLibravatar Ryan Walklin2018-11-05
| | | | | | | | | | | | | | | | | | | | | This commit enhances the output transform command with options for a relative transform, i.e. the provided transform will be applied as an offset to the current transform. Append `clockwise` to rotate clockwise from the current rotation, or `anticlockwise` to rotate in the opposite direction. For example, if the output LVDS-1 is rotated 90 degrees clockwise, the command `output LVDS-1 transform 90 clockwise` will rotate the display to 180 degrees. All transform options are supported, including flipped transforms. Relative transforms can only be applied to a single output and cannot be used with a wildcard (*) output specifier.
* Handle shell special characters in bg file pathLibravatar Brian Ashworth2018-09-28
| | | | | | | | | | | This changes it back so the path given to swaybg is enclosed in quotes. Additionally, the only character that is escaped in the path stored is double quotes now. This makes it so we don't need to keep an exhaustive list of characters that need to be escaped. The end user will still need to escape these characters in their config or when passed to swaybg.
* Address ianyfan's commentsLibravatar Brian Ashworth2018-09-14
| | | | | | | | | | | | | | wordexp p is now initialized to {0} to prevent a segfault on wordfree in the failure case. File paths with single quotes and double quotes are now supported. The quote can either be wrapped in the other quote or escaped with three backslashes. Additionally to make passing file paths with double quotes to swaybg easier, instead of enclosing the path given to swaybg in quotes, all spaces, single quotes, and double quotes in the resulting path are now escaped with a single backslash.
* Escape spaces in background file pathLibravatar Brian Ashworth2018-09-13
|
* Allow spaces in background file pathsLibravatar Brian Ashworth2018-09-13
|
* Change _XOPEN_SOURCE defines to _POSIX_C_SOURCELibravatar sghctoma2018-09-03
|
* Fix feature macros for FreeBSDLibravatar sghctoma2018-08-30
| | | | | On FreeBSD, snprintf and vsnprintf are visible only if _XOPEN_SOURCE >= 600.
* Don't call swaynag_log for bg when not readingLibravatar Brian Ashworth2018-08-08
|
* Allow a fallback color to be specified for swaybgLibravatar Brian Ashworth2018-08-08
| | | | | | This allows for a color to be set when the wallpaper does not fill the entire output. If specified, the fallback color is also used when the image path is inaccessible.
* Switch to using a function to parse booleansLibravatar Brian Ashworth2018-07-23
|
* Add get_config message type to ipcLibravatar Ian Fan2018-07-10
|
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* cmd_background: fix leak on errorLibravatar Dominique Martinet2018-07-02
| | | | Found through static analysis.
* output commands: move !argc checks after argc gets decrementedLibravatar Dominique Martinet2018-07-02
| | | | Found through static analysis.
* cleanup output-background subcommand handlingLibravatar ael-code2018-06-26
| | | | | | | | - fixes a double-free error when access() failed. - refactor code to make memory managment (alloc/free) more straightforward - do not bring the temporary wordexp_t struct around - do not postpone errors handling
* fix memleak on background cmd errorLibravatar ael-code2018-06-26
| | | | | - src must be free after join_args() - wordfree must bee used after wordexp
* bugfix: avoid access after freeLibravatar ael-code2018-06-22
| | | | | | | | | | | | if src is NULL due to a previous error we cannot use it in the command result string. Moreover if `src` points to `p.we_wordv[0]` we cannot use it after `wordfree(&p)` in the command result string. Bonus feature: If there was an error accessing the file, the string rapresentation of the error is now included in the command result string.
* Address review comments for output subcommandsLibravatar Brian Ashworth2018-06-03
|
* Refactor cmd_output to use config_subcommandLibravatar Brian Ashworth2018-06-03