Commit Graph

354 Commits

Author SHA1 Message Date
Aidin 03285e8589
Comment and documentation improvement (#3943)
* Added that the timer timeout is in seconds

* Contrasted the differences of autostart and call_now

* A minor grammatical change

* Spread comments in multiple lines so lines would be shorter

* Used three dashes instead of one for documentation

* Included available cursor names as an ldoc files, and also added
a new file named 'cursor_c_lua.ldoc' which uses awesome comments
syntax, because the existing 'cursor_c.ldoc' could not be compiled.

* Fixed typo

* Fixed formatting and file names
2024-09-05 16:27:43 +02:00
Madhur Ahuja 151bb6d169
Correct typo (#3927)
Correct type in table.lua
2024-08-18 12:22:16 +00:00
Aaron Dill 220ae797e9
fix: call ret:emit_signal("timeout") instead of args.callback (#3933)
This ensures that the timer gets passed on the first call of callback.
fixes: #3904

Signed-off-by: aarondill <aaronsacks2006@gmail.com>
2024-08-18 12:20:19 +00:00
Emmanuel Lepage Vallée e6f5c79808
Merge pull request #3879 from Elv13/2023_xmas_commits_pr1
Fix the documentation warnings
2024-01-20 16:34:06 -08:00
Peter Anderson 0dcfc86167
Update object.lua 2024-01-11 10:09:54 +00:00
Emmanuel Lepage Vallée 00ba63b44e
gears.surface: Add crop (#3882)
* added surface crop function

* added busted tests

* added devShell Flake

* Revert "added devShell Flake"

This reverts commit 0acb3d4e43.

* general purpose crop added

* cleanup

* merged functions, added tests

* replaced gdebug.print_error with error

* clearer error message for crop

Co-authored-by: Lucas Schwiderski <4508454+sclu1034@users.noreply.github.com>

* make error message shorter

* surface.crop: Fix doc warnings.

---------

Co-authored-by: Paul Schneider <74120050+paulhersch@users.noreply.github.com>
Co-authored-by: Paul Schneider <paul.schneider2@student.uni-halle.de>
Co-authored-by: Lucas Schwiderski <4508454+sclu1034@users.noreply.github.com>
2023-12-31 15:15:50 -08:00
Emmanuel Lepage Vallee 3cb42b7a33 doc: Fix warnings in `awful.screenshot` and `gears.shape`.
Those were written before the doc linting was merged.
2023-12-30 14:21:13 -08:00
Denis Efremov dfe6a47893
Added gears.string.psplit function to support patterns (#3839) 2023-11-18 17:14:35 -08:00
Brian Sobulefsky 52e0242ec6 Move some filesystem related logic in the screenshot lib to gears
request from awesome maintainers.
2022-11-13 16:53:32 -08:00
Emmanuel Lepage Vallée 26032bf018
shape: Add a "solid shadow" shape. (#3489)
This is an useful client shape to get "client side solid shadows".
2022-10-16 02:29:09 -07:00
Emmanuel Lepage Vallee 11ce8fd77c gears.timer: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 52c481babc gears.color: Update the property documentation. 2022-08-29 22:49:47 -07:00
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
Emmanuel Lepage Vallee f3987f43b6 doc: More proof reading fixes. 2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallee f8f11a23f5 doc: Add some @see to the shape doc.
The `transform` function was unclear.
2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallee f6f57e7ba0 gears.color: Add a function to apply the alpha to a color.
Some code in awesome concatenate color strings. This means it blows
up when the pattern are used instead of color, with this, it fails
gracefully (by returning the unmodified pattern).
2022-08-29 22:48:36 -07:00
Emmanuel Lepage Vallee 18468d32dd widget: Fix saving a widget to a file.
Previously, if `beautiful.fg_normal` wasn't black, it would not render
correctly.
2022-08-29 22:48:36 -07:00
Emmanuel Lepage Vallee 91fe314e0b gears.color: Fix color serialization.
Some widgets like the tasklist serialize the theme colors to use them
in Pango markup. If the theme color were already converted to pattern,
that blew up. With this fix, pattern can be converted back into strings
correctly.
2022-08-29 22:48:36 -07:00
Emmanuel Lepage Vallee 75019c3f6f Implement fixes for Luacheck 0.26.1
* Rename or mute parameters starting with _
 * Replace `not (>=)` with `<`
2022-08-28 16:59:14 -07:00
Pepijn Krijnsen 53b70b4585 Update documentation for gears.color.parse_color(col) method
Lua comments now accurately describe the return values of this method.
Added a more comprehensive example, too. Issue #3555
2022-02-12 21:04:21 +00:00
SystematicError 86b6c49a0f
Fix typo (#3562)
Co-authored-by: SystematicError <systematicerror@users.noreply.github.com>
2022-02-07 11:08:08 -08:00
Emmanuel Lepage Vallée 1413f0c4b9
Merge pull request #3513 from necauqua/fix-timer
Signalled error: bad argument #3 to 'timeout_add' (number has no integer representation)
2021-12-22 12:52:07 -08:00
Lucas Schwiderski e55d1d41f3
docs(g.timer): Fix typo 2021-12-21 10:46:43 +01:00
Lucas Schwiderski b343cb8111
docs(g.timer): Improve wording 2021-12-21 09:09:09 +01:00
Anton Bulakh 71d08ab6ec
Use gmath.round 2021-11-23 08:45:52 +02:00
Anton Bulakh e64446082b
Fix timer errors 2021-11-22 12:24:20 +02:00
Emmanuel Lepage Vallee 9db62b824c gears.matcher: Add `fallback` rules.
Right now, all rules are additive, they are squashed into one big
array of properties. This is normally fine, but sometime you want
explicit rules for some objects, but also default rules if nothing
matches.

While this can be expressed in the current system by overriding
*all* properties, this require more effort than having "special"
and "fallback" rules.
2021-10-22 22:26:12 -07:00
Emmanuel Lepage Vallee 005c2d61a0 gears.matcher: Fix `rule_every`.
It really didn't do the right thing and didn't work anyway.
2021-10-22 22:26:12 -07:00
Emmanuel Lepage Vallee 3f2db184ad gears.wallpaper: Deprecate. 2021-09-24 08:42:42 -07:00
Emmanuel Lepage Vallee b0a2d82d8f compat: Do not require to pass pattern._native to the wallpaper.
It makes the shims impossible to implement without a double free,
a memory leak or a crash. Using `capi` should not require to
destroy the LGI wrappers.

Another example, not fixed in this commit, are the client shapes.
2021-09-24 08:42:42 -07:00
Emmanuel Lepage Vallee cefd4f843e gears.filesystem: Improve get_random_file_from_dir.
Previously, only a filename was returned. Getting the path was
inconvinient when used within a declarative construct.

It was also misbehaving then the directory didn't exist. Finally,
the extention list now accept extension names starting with a dot.
2021-09-24 08:38:13 -07:00
Lucas Schwiderski dc0d5df4da
doc: Implement review suggetions
Co-authored-by: Aire-One <Aire-One@users.noreply.github.com>
2021-06-20 12:25:11 +02:00
Lucas Schwiderski 3cefcfffe3
doc(g.timer): Improve documentation for helpers
Clarifies behaviour for the convenience constructor functions.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-17 15:37:29 +02:00
Lucas Schwiderski 33b2fdfbf6
doc: Fix typos
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-17 15:37:28 +02:00
Lucas Schwiderski 16df93370f
doc(g.table): Improve documentation
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-17 15:37:27 +02:00
Lucas Schwiderski 1182552783
bug(a.keygrabber): Stop timer when stopping keygrabber
When stopping a keygrabber with a timeout manually or through the stop
key, the timer would continue and call the stop callback again some time
later.

The error message in `gears.timer:stop` is removed, since there actually
is no harm in just returning immediately. And the timer implementation
itself calls `:stop` in certain places without checking for `.started`,
which lead to a situation where the internal call to `stop` triggered
the error message.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-11 08:59:58 +02:00
Aire-One 3a6fa10754 doc(@supermodule): gears.object inheritable doc 2021-04-02 19:24:07 +02:00
mergify[bot] 7a8fa9d27a
Merge pull request #3294 from sclu1034/feature/count_keys
Add utility to count table keys
2021-04-01 07:42:25 +00:00
Lucas Schwiderski f68939bfc1
chore(g.table): Add missing modeline 2021-03-31 08:29:00 +02:00
Lucas Schwiderski ec3788bf73
docs(g.table): Improve parameter descriptions 2021-03-31 08:27:08 +02:00
Yauhen Kirylau 6ef3a8f059
fix(gears: colors: recolor_image): always duplicate the surface (#3233) 2021-03-27 23:48:48 -07:00
Lucas Schwiderski e7d55567a6
Remove redundant assignment
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-27 14:08:47 +01:00
Lucas Schwiderski afced71a9a
Add example for gears.table.count_keys
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:55:40 +01:00
Lucas Schwiderski 058190a3c0
Add missing modelines
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:24:56 +01:00
Lucas Schwiderski 07df24f7d0
Add utility to count table keys
See #3293.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:24:55 +01:00
Daniel Hahler dab84c2662
fix(doc): gears.table.keys: s/integer keys/integer/ (#3293) 2021-03-22 12:05:17 -07:00
Lucas Schwiderski ca066e8d0f
Respect line column limit 2021-03-07 11:09:45 +01:00
Lucas Schwiderski a8d830f1e6
Improve gears.shape module description.
Fixes #3270.
2021-03-06 17:10:20 +01:00
Grumph f6a2306d1a Protect endswith and startswith from nil str
A nil parameter can mean an empty string (e.g. client.name), so we
just return false.
2021-01-26 17:58:25 +01:00