aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/output
AgeCommit message (Collapse)Author
2018-12-20Combine output_by_name and output_by_identifierBrian Ashworth
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.
2018-11-28Introduce a way to show config warnings in swaynagBrian Ashworth
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.
2018-11-05Add relative output transformRyan Walklin
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.
2018-09-28Handle shell special characters in bg file pathBrian Ashworth
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.
2018-09-14Address ianyfan's commentsBrian Ashworth
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.
2018-09-13Escape spaces in background file pathBrian Ashworth
2018-09-13Allow spaces in background file pathsBrian Ashworth
2018-09-03Change _XOPEN_SOURCE defines to _POSIX_C_SOURCEsghctoma
2018-08-30Fix feature macros for FreeBSDsghctoma
On FreeBSD, snprintf and vsnprintf are visible only if _XOPEN_SOURCE >= 600.
2018-08-08Don't call swaynag_log for bg when not readingBrian Ashworth
2018-08-08Allow a fallback color to be specified for swaybgBrian Ashworth
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.
2018-07-23Switch to using a function to parse booleansBrian Ashworth
2018-07-10Add get_config message type to ipcIan Fan
2018-07-09Update for swaywm/wlroots#1126emersion
2018-07-02cmd_background: fix leak on errorDominique Martinet
Found through static analysis.
2018-07-02output commands: move !argc checks after argc gets decrementedDominique Martinet
Found through static analysis.
2018-06-26cleanup output-background subcommand handlingael-code
- 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
2018-06-26fix memleak on background cmd errorael-code
- src must be free after join_args() - wordfree must bee used after wordexp
2018-06-22bugfix: avoid access after freeael-code
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.
2018-06-03Address review comments for output subcommandsBrian Ashworth
2018-06-03Refactor cmd_output to use config_subcommandBrian Ashworth