Commit Graph

52 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 86d1b1c22c doc: Add a mandatory `@noreturn` for functions and methods.
The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
2022-08-29 22:49:45 -07:00
Emmanuel Lepage Vallee 4bd90f0f35 doc: Add documentation linting and fix all issues it found. 2022-08-29 22:48:54 -07:00
Actionless Loveless 9ca7bb487a
style(beautiful: gtk; hotkeys_popup): make new luacheck a bit happier (#3651) 2022-06-30 08:32:45 -07:00
actionless e833da0303 fix(beautiful: gtk): don't crash when both gtk3 and gtk4 are installed 2021-03-25 00:21:04 +01:00
Emmanuel Lepage Vallee 04c757322c client: Turn `rc.lua` logic into a new `request::border` signal.
The default `rc.lua` was using the focus/unfocus signals to set
the border color along with `awful.rules`. This logic block was
no longer aligned with the rest of `rc.lua` since it was
the only place where `beautiful` variables where only used by
`rc.lua`.

On top of this, the new request handler also has extra contexts
for the urgent and floating/maximixed use cases. So it can be used
by themes to implement much smarter borders than just focus based
ones. They were previously limited by the fact most of the
(un-monkey-patchable) logic was in `rc.lua`.

Note that this commit also shuffle the awful.rules order between
the titlebar and the border and changes the tests accordignly.
After some consideration, I came to the conclusion the previous
behavior was bogus and the fact that the placement tests required
to know about the titlebar height is simply a proof of that. The
change was required in this commit because since the border is no
longer in the default rules, a new buggy edge case surfaced.
2020-01-11 15:43:11 -08:00
Emmanuel Lepage Vallée b795671817
doc: Fix invalid HTML (#2817)
Fix #2812
2019-07-09 17:42:01 -04:00
Emmanuel Lepage Vallee 90a29f92eb doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Emmanuel Lepage Vallee cdeafeff94 doc: Add a section for theme related libraries 2019-06-08 18:13:42 -04:00
Alphonse Mariya 00d38b1a2d
beatiful.theme_assets: recolor titlebar icons for `active` and `inactive` states 2019-02-19 23:33:18 +01:00
Sorky 366be2105a beautiful.init: Fix return values and improve doco. fixes: #2588 #2592
squashing updates from review by blueyed

Added busted tests

Fixed test files EOF

Remove Travis warning
2019-01-25 22:56:41 +11:00
Uli Schlachter 3145272292 beautiful.init(): reset theme_path if called with a table
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-14 09:18:58 +01:00
Uli Schlachter 69a0de3f03 Make beautiful.theme_path actually work
Commit ac8af66005 added beautiful.theme_path, which is used to save the
directory that contains the theme file that was loaded. Just two months
later, commit ca12473584 broke this code by adding a __newindex
metamethod. This caused the assignment to beautiful.theme_path to be
redirected to the theme. However, the theme is immediately replaced by
beautiful.init() after setting up the theme_path, so this assignment got
lost.

Fix this by using rawset() to bypass the metamethod.

Fixes: https://github.com/awesomeWM/awesome/issues/2573
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-14 09:18:40 +01:00
Emmanuel Lepage Vallee 491a46875c doc: Merge the beautiful documentation
Given they are all small, it makes more sense to just merge them like
we did for the client API

For some reasons GTK doesn't want to be merged. To be investigated.
2018-12-31 17:49:44 -05:00
Mak Kolybabi 24df2ecd6b
Grammar correction. 2018-08-14 06:47:41 -05:00
Sam Banks 6e393917e4 Correct descriptions of border colors 2018-07-12 14:30:46 +10:00
Yauhen Kirylau 4bd5b1940d feat(themes; beautiful): add partial support for GTK+3 themes (#2129) 2018-06-26 10:43:20 -04:00
Yauhen Kirylau 19a1ee6c16 fix(beautiful: xresources): don't return fallback colorscheme if only some of the values are missing (#2151)
related to #2150
2018-01-17 22:43:15 -05:00
Emmanuel Lepage Vallee 14c074fb6b screen: Disable trying to auto-compute the DPI by default.
As long as Awesome provides APIs that uses pixels are points, this
cannot be enabled by default.

For example, a wibar size defined in pixels may be too small to
render the text once a dense display is connected.
2017-11-23 23:28:32 -05:00
Uli Schlachter a137655791 Add & use a dpi property on screen objects
Once upon a time, beautiful.xresources.get_dpi was added to query
Xft.dpi. That made sense since this queried an xresources property. Over
time, other, non-xresources-based ways to query DPI were added to this
function. Now, it makes no more sense to have this function here.

Also, recently it became possible to add new properties to C objects
from Lua code. Thus, we no longer need to have a get_dpi() function
somewhere, but can add s.dpi directly.

Thus, this commit adds s.dpi and makes everything use it. No functional
changes are intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-08 12:30:21 +02:00
actionless 5fdb2c6298 feat(beatiful: theme_assets; themes: xresources): recolor titlebar icons for `hover` and `press` states 2017-07-02 19:48:59 +02:00
Uli Schlachter ca12473584 Make beautiful.foo = bar work properly
Without this, users would modify the beautiful table directly instead of
the theme. This made a difference for code using beautiful.get() to get
the theme.

Reference: https://github.com/awesomeWM/awesome/pull/1854
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 10:05:32 +02:00
Uli Schlachter e7a1745b86 Fix Luacheck warnings (#1798)
This fixes warnings that were introduced with f22ef5014d /
https://github.com/awesomeWM/awesome/pull/1477.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-26 15:33:56 +02:00
Emmanuel Lepage Vallée 27c3b96a08 Merge pull request #1477 from Oblomov/dpifallback
Fall back to reported DPI if Xft.dpi is not present
2017-05-25 16:41:26 -04:00
Emmanuel Lepage Vallee ac8af66005 beautiful: Save the theme path
Fix #1508
2017-05-25 04:40:45 -04:00
Daniel Hahler c9bfd934e7 beautiful.load_font: handle font height of 0 (#1782)
This might happen if no fonts are installed.  It now falls back to the
size from the font description.
2017-05-14 20:14:18 +02:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00
Uli Schlachter 5191fcbdd2 beautiful.theme_assets: Use screen geometry instead of workarea (#1462)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-28 15:05:53 +01:00
Giuseppe Bilotta f22ef5014d Make beautiful fallback properly if Xft.dpi is missing
As documented in
<https://keithp.com/~keithp/talks/xtc2001/paper/xft.html#sec-editing>,
the fallback value for Xft.dpi should be the vertical DPI reported by X.
On Xorg, this will generally be 96, unless the user has overridden the
value by either forcing Xorg to report the EDID-derived DPI, or by
setting the DPI themselves (via configuration, command line, or xrandr).
The 96 value is kept as ultimate fallback if anything goes wrong.
2017-01-27 13:02:49 +01:00
Uli Schlachter c2759077d6 beautiful: Reset theme when theme loading fails (#1470)
Commit c50d62749b added an empty table as a default theme. However,
when loading the actual theme fails, we will end up with theme having
value nil. This commit fixes this by reverting back to an empty table.

Fixes: https://github.com/awesomeWM/awesome/issues/1417
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 23:06:15 +01:00
Yauhen Kirylau 316734a681 move `theme_assets` from xresources theme to `beautiful` module. (#1219) 2017-01-14 04:09:54 +01:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Emmanuel Lepage Vallee be8f0c376b doc: Document the basic variables. 2016-09-26 00:40:20 -04:00
Daniel Hahler 8966c73599 Minor doc fixes 2016-03-06 14:46:13 +01:00
Daniel Hahler f874b0ad2e Merge pull request #712 from psychon/protected_calls
Protected calls (gears.protected_call)
2016-02-28 22:16:13 +01:00
Daniel Hahler 2bcff5af27 Merge pull request #708 from psychon/less_screen_indicies2
Less screen indicies
2016-02-28 22:15:37 +01:00
Uli Schlachter 8560c6d2af Use gears.protected_call where applicable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 12:28:55 +01:00
Uli Schlachter 20e13602de beautiful.xresources: Support screen objects
This commit makes beautiful accept a screen object everywhere where a screen
index is accepted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-26 18:19:24 +01:00
Uli Schlachter f3091154f6 Make beautiful work directly under unit tests
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-21 17:09:08 +01:00
Uli Schlachter f2cf4a6385 Fix luacheck warnings in beautiful and menubar
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-11 21:55:32 +01:00
Uli Schlachter 2ab98f5e4a Merge branch 'rgb-xresources' of https://github.com/actionless/awesome 2016-01-17 16:00:11 +01:00
Uli Schlachter 720cd879f3 Add timestamps to messages on stderr (#602)
Closes https://github.com/awesomeWM/awesome/pull/606.
Fixes https://github.com/awesomeWM/awesome/issues/602.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-31 15:38:17 +01:00
actionless 2d7fc8bc49 feat(beautiful: xresources): read rgb: and argb: prefixed colors 2015-12-07 09:38:22 +01:00
Daniel Hahler 4bffa7e47e doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
Daniel Hahler 11473aa490 Use awful.util.round in beautiful.xresources.apply_dpi 2015-08-12 14:18:57 +02:00
Daniel Hahler b028a0ba1d xresources.apply_dpi: use "round" instead of "ceil"
Given an outcome of e.g. 1.01 its more sane to use 1 than 2, especially
for `border_width`.

This uses the method from `wibox.layout.flex`.

Closes https://github.com/awesomeWM/awesome/pull/389.
2015-08-04 20:48:17 +02:00
Daniel Hahler 9835f73a01 doc: fix invalid @see references to URLs 2015-07-24 01:56:36 +02:00
Daniel Hahler b28cda2ac6 beautiful.xresources.apply_dpi: use `math.ceil`
Closes https://github.com/awesomeWM/awesome/pull/330.
2015-07-24 01:52:51 +02:00
Daniel Hahler 1f3ad814c9 beautiful.xresources: allow to set/get DPI per screen
This adds an optional screen argument to get_dpi/apply_dpi and set_dpi
to store DPI values per screen.

This can be used in your config to manage different DPI values for an
internal and external display:

    beautiful.xresources.set_dpi(125, 1)
    beautiful.xresources.set_dpi(94, 2)

This is meant to be the foundation for more evolved DPI handling in
awesome.

Closes https://github.com/awesomeWM/awesome/pull/336.
2015-07-24 01:48:03 +02:00
Daniel Hahler 173545bc72 Add beautiful.get_merged_font; fix doc / load_font
This is meant to get a new font (copy) with adjusted attributes, e.g.

    font_focus = beautiful.get_font_copy(theme.font, "bold")

Closes https://github.com/awesomeWM/awesome/pull/308.
2015-07-22 13:59:05 +02:00