Commit Graph

3316 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 8bcdd0b794 placement: Add some extra checks to limit the risk of regressions.
Given noone understand this code, this will prevent some semi likely
regressions from going unnoticed. The main risk is the shims not
producing the exact same results as the real implementation and
cause different code paths to be taken.

As of this commit, both the "real" and "shim" implementation were given
the same set of tests with print() at every step of next_to. The
resulting log was then checksummed to ensure both are identical.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 89867386c5 tests: Add images to the tooltip documentation
It also add some properties such as `border_width`, `border_color`
and `preferred_alignments`.

It also fix a documentation bug where the `margin_topleft` was called
`margins_topleft`. To conform to the documentation, both are now valid
but one should be removed the next time the API changes.

Fixes #1978
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 52f62b712c tooltip: Allow the border to be configured.
Given the tooltip border is "client side" instead of X11 to allow
anti-aliasing to work when a shape is used, it doesn't use the wibox
border.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 2b52926b48 tooltip: Pass the parent object to awful.placement, not the position.
By passing the geometry, important information used by
awful.placement.next_to were "lost". Given `next_to` supports both
widget position, the mouse and client/wibox relative positioning, it
has to know the object type.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 68bfde45e1 tooltip: Cleanup the margin API.
Make it closer to other APIs across Awesome.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 3380fd85fc tooltip: Add alignment options.
It's a list of preferred alignments because sometime the best one wont
fit in the screen.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 7d6f52c4dc wibox: Add the wibox reference to `find_widgets`
This is necessary to compute the widget real position on screen
because it's the only way to know the border_width offset.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee d8a7782bf4 tests: Add an awful.placement.next_to test
It was overdue
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 33a39ce38d placement: Make sure `next_to` result is consistent across calls
It depended on a hash `pairs` iteration. This caused an issue only when
the primary position wasn't available.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee f1145af49d placement: Allow to configure the next_to anchors
They were previously hardcoded to match the classic context menu
behavior. It isn't flexible enough for some popup type.
2018-12-24 21:49:52 -05:00
Emmanuel Lepage Vallee 3fa42f3b1a placement: Fix `border_width` for `next_to`
All previous users used client side borders so the issue went
unnoticed. This code will be unit tested by the `popup` module
in a few commits.
2018-12-24 21:49:52 -05:00
mergify[bot] 7d0976912e
Merge pull request #2435 from PeterNerlich/fix-hotkeys_popup
stop keygrabber on hide through click
2018-12-20 04:06:17 +00:00
Yauhen Kirylau 820094c3c4 feat(awful: titlebar): expose fallback title (#2459)
feat(awful: titlebar): expose fallback title
2018-12-17 12:47:14 -05:00
Emmanuel Lepage Vallée de04cecf46
Merge pull request #2454 from Aire-One/add_widget_prompt_params
Add parameters to awful.widget.prompt constructor.
2018-12-17 10:45:54 -05:00
actionless 1da5554fdc fix(hotkeys_popup): rebase fix for keygrabber instance 2018-12-17 16:29:36 +01:00
Emmanuel Lepage Vallée 7231087bdb Update widget.lua 2018-12-17 16:29:36 +01:00
Peter Nerlich e55cc7c912 stop keygrabber on hide through click
fixes #2434
2018-12-17 16:29:36 +01:00
Michele Lazzeri 2308509f39 lib/awful/rules.lua fix requesting nil tag name (#2479)
Related PR: #2354 

We always passed a nil value, guess it's a typo.
2018-11-14 15:23:05 -05:00
mergify[bot] bf50daf94e
Merge pull request #2182 from blueyed/doc-gtable-iterate
doc: improve gears.table.iterate
2018-11-12 16:40:53 +00:00
Sergey Vlasov d266309ef8 awful.client: Fix c.requests_no_titlebar
The property was always false because of a typo.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-11-12 11:48:59 +03:00
Uli Schlachter 55639547a2 menubar.utils: Remove some (basically) dead code
This removes unused public functions from menubar.utils. This is not an
API break, because these functions were only added in commit
8d34201ec3, which is after v4.2. These new functions became
unused in commit e88f1e8735, not long after they were added.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-11-07 13:23:25 +01:00
Uli Schlachter c80bf6f46e wibox.layout.flex: Do not leave empty space behind
It is not possible to distribute 100px to three widgets equally. The
current version of wibox.layout.flex tries to do that anyway, by giving
each widget 33px and leaving one pixel outside of any widget. Thus, if
the widgets e.g. have a common background, this leads to a one pixel gap
in the background.

This patch changes the flex layout so that the extra pixel is assigned
to some widget instead. It does so by basically keeping a sum of
space_per_item for the widgets that was assigned so far. This sum is
rounded and when this leads to rounding, the corresponding child widget
gets an extra pixel.

More precisely, this tracks a pos as before. Widgets get their position
still assigned based on rounding pos. However, this now also remembers
this rounded position for the next iteration of the loop. This allows to
assign the size of widgets based on the difference between the current
and last rounded position.

(Possibly) fixes: https://github.com/awesomeWM/awesome/issues/2461
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-11-05 10:13:18 +01:00
actionless b6b6bc0bd6 feat(awful: hotkeys_popup): add args.show_awesome_keys option
Update lib/awful/hotkeys_popup/widget.lua

Update lib/awful/hotkeys_popup/widget.lua

fix(awful: hotkeys_popup): caching issue if showing the same widget instance with and without AwesomeWM hotkeys

doc(awful: hotkeys_popup): extend docstring for args.show_awesome_keys
2018-11-03 17:27:29 +01:00
tototest99 38505a00a2 doc(awful: spawn): Correct a typo in spawn.lua, Fixes #2456 (#2458) 2018-11-02 15:19:31 +01:00
Aire-One 1a96642615 format code and doc 2018-10-31 11:42:36 +01:00
Aire-One bc822c0af7 Add all parameters from awful.prompt to awful.widget.prompt constructor. 2018-10-31 11:35:56 +01:00
Aire-One d5f20a7e0b Add `done_callback` parameter to awful.widget.prompt constructor. 2018-10-31 09:00:18 +01:00
Emmanuel Lepage Vallée 2458f127f3
Merge pull request #2360 from Elv13/add_awful_tag_layouts
awful.tag: Add awful tag layouts
2018-10-22 14:40:16 -04:00
Uli Schlachter 4744a744f0 gears.table.join: Ignore nil arguments (#2440)
When calling join with e.g. arguments (nil, {"a"}), then everything past
the nil was ignored, because the code internally used ipairs() to
iterate over the arguments and this stops at the first nil it
encounters.

Fix this by using select() to iterate over the arguments.

This also adds a unit test for this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-16 10:17:45 -04:00
Emmanuel Lepage Vallée aa16d77d15
Merge pull request #2423 from Elv13/better_rules_doc
Better awful.rules doc
2018-10-16 08:44:58 -04:00
Emmanuel Lepage Vallée 35130169c9
keygrabber: Rename release_event to stop_event (#2422)
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.

The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
2018-10-16 08:42:56 -04:00
Emmanuel Lepage Vallee 990b1ddb9d awful.tag: Add a "tag centric" way to manage a layout list.
Previously, the layout list was global. However it wasn't covering all
possible use cases and make using `awful.widget.layoutlist` hard since
a layout could be excluded from the `awful.layout.layouts` but still
used for a tag (by setting it explicitly).
2018-10-15 16:10:18 -04:00
Emmanuel Lepage Vallee ae5fc042ae layout: Add a get_tag_layout_index function.
It helps check of the current tag layout is part of

    awful.layout.layouts
2018-10-15 14:21:24 -04:00
actionless 3cef72bb30 fix(awful: rules): don't raise every focusable client on awesome startup
re #2095
2018-10-14 20:41:45 +02:00
Emmanuel Lepage Vallee 43a82f34f0 doc: Add more examples about the spawn.easy_async
Ref #1373
Ref https://stackoverflow.com/questions/52634985/awesome-wm-os-execute-vs-afwul-spawn
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 845b9a930c doc: Refactor awful.spawn doc to have a property list. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b4e0363ac3 doc: Move the awful.rules to the header.
It's easier to find.
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b49f7e22dd doc: Add an index of valid properties to awful.spawn and awful.rules. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 90b17bdc09 awful.rules: Add proper documentation to the extra client properties.
Until now there wasn't much documentation available about how to use
these properties. With the new work on `awful.spawn` that rely more and
more on `awful.rules` integration, it is worth fixing.

This commit add a new documentation section and a future commit will
aggregate them to generate an index.
2018-10-10 01:58:18 -04:00
mergify[bot] 7020a9707f
Merge pull request #2421 from Elv13/fix_2419
Fix 2419
2018-10-08 16:46:46 +00:00
gabriel klawitter 7519c6966a dbus: fix nil notifications (#2180)
When mangling notifications via naughty.config.notify_callback it is
advised (1) to return nil to reject a notification. The underlaying dbus
library tries to access a field of that notification table and fails.

(1) https://awesomewm.org/doc/api/libraries/naughty.html
2018-10-07 16:09:12 +02:00
mergify[bot] 2f70fd6cce
Merge pull request #2409 from Elv13/spawn_once
A better run_or_raise/spawn.once/singleton API
2018-10-07 11:35:11 +00:00
Emmanuel Lepage Vallée 768184d152
Merge pull request #2368 from psychon/motif_hints
Add c.requests_no_titlebar based on motif hints
2018-10-06 22:00:03 -04:00
Emmanuel Lepage Vallee 789cf11d8d titlebar: Emit `request::titlebars` from `awful.titlebar`.
The toggle/show/hide function were incompatible with the current
`rc.lua` is `titlebars_enabled` was removed from the rules because
they were never created. This has always been the case but the
introduction os `request::titlebars` in Awesome 4.0 allows to solve
this longstanding issue. However until now it didn't.

Fix #2419
2018-10-06 18:46:50 -04:00
Alyssa Ross ee9670b1ea Gracefully fail when history file is inaccessible (#2410)
If the history file (or its parents) can't be created, running a command
will fail entirely. Since saving command history is not an integral part
of running a command, it would be nicer if it carried on, just without
saving history. This is what shells usually do.

This patch removes assertions in the history saving function and
instead adds an early return, so if the history isn't saved the command
invocation simply carries on.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2018-10-06 22:53:48 +02:00
Emmanuel Lepage Vallee 021a1feec8 awful.spawn: Add a `raise_or_spawn` method. 2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 0ac99a5dc5 awful.rules: Rename switchtotag to switch_to_tags.
First of all, it select many tags, so there is an "s". Also, Awesome
standardised naming to snake case in v4.0, but this was missed.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 927e7b2796 awful.spawn: Add an `once` and `single_instance` methods.
This commit adds a way to leverage the xproperty and startup_id APIs
to persist an execution token across restarts. It allows to use
`awful.rules` on clients that were executed by a previous Awesome
instance.

The main limitations of these methods is the lack of entropy used to
build the token. If the command is the same in multiple
`awful.spawn.once`, then it will not work as expected. To mitigate this
issue, the system try to concatenate the `awful.rules` table after the
command and hash the resulting string. Given rules are a table, it can
have loops and/or issues with keys ordering. The hash function sort and
limite recursion to prevent a stack overflow. Another issue is the
unreliability of startup notifications.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 9250610a77 activate: Add `switch_tag_tag` and `switch_to_tags`.
Also bring some consistency with `awful.rules` naming. A future commit
will add a `TODO v5` to resolve this naming issue.
2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee 9e45e016e9 tag.viewmore: Add an optional limit to the number of selection. 2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee da68b3cbaf table.join: Make deterministic.
`pairs` order isn't defined and `{...}` will always be ordered.
There is no reason to have random behavior where it can be
predicted at no additional cost.
2018-10-01 14:57:55 -04:00
Yauhen Kirylau 3931ae370c feat(menubar): expose menubar styling to beautiful (#2375) 2018-09-28 00:35:10 -04:00
Uli Schlachter 3927dbcf02 Fix incorrect @name annotation in gears.string
gears.string.xml_escape was annotated with "@name escape" and
gears.string.xml_unescape was annotated with "@name unescape".

Reference: https://github.com/awesomeWM/awesome/issues/2397#issuecomment-424630100
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-09-26 10:37:59 +02:00
Sergey Vlasov 61cdc40595 awful.placement: Fix no_offscreen when composed with other functions
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken.  The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.

All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.

This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov db11c7e9da awful.placement: Fix client size corruption in no_overlap
The awful.placement.no_overlap function was adding the window border
width to the client width and height (this is performed in
area_common(), which is called by geometry_common()), but did not
reverse this operation by calling remove_border() before returning the
final geometry; because of this, using no_overlap resulted in increasing
the window width and height by 2*border_width.

The bug was probably introduced in commit ebcc19844e (before
that commit no_overlap changed the window position directly instead of
relying on the new placement infrastructure), but was not noticed
because of other problems (e.g., in the default configuration the result
of no_overlap was overridden by the buggy no_offscreen).

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Michael Perlov b487826719
Check for non-empty utils.wm_name before checking OnlyShowIn attribute
Signed-off-by: Michael Perlov <perlovka@gmail.com>
2018-08-30 17:04:37 +03:00
Michael Perlov cbb8f41261
menubar.utils: Allow to add programs with OnlyShowIn option being set
Bug: https://github.com/awesomeWM/awesome/issues/2377

Signed-off-by: Michael Perlov <perlovka@gmail.com>
2018-08-29 22:39:07 +03:00
Emmanuel Lepage Vallee 96bbbc82f3 widget.common: Add custom sources for the taglist and tasklist.
The current taglist/tasklist allow filter function to remove elements
from the list. However they don't allow sorting or additional entries
to be listed.

This commit introduced such a concept. It will later be used by the
layoutlist where it becomes more relevant since layouts are used created
"objects".
2018-08-27 00:03:22 -04:00
Yauhen Kirylau e332e2d868 fix(menubar): apply both menu bg and fg, not only bg (#2372) 2018-08-26 12:35:14 -04:00
Uli Schlachter fa1728d749 Add c.requests_to_titlebar
This property is based on Motif WM hints and checks if the client
requests that it is not decorated with a titlebar.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 48d4a31b17 awful.rules: Support titlebars_enabled being a function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 3f958d60da Merge branch 'master' of https://github.com/mrschyte/awesome 2018-08-22 12:27:05 +02:00
Uli Schlachter 2383209e9a Merge branch 'naughty_icon_data_lifetime' of https://github.com/psychon/awesome 2018-08-22 12:26:49 +02:00
Uli Schlachter 4d6920c165 Merge branch 'rules_tag_by_screen' of https://github.com/psychon/awesome 2018-08-22 12:26:37 +02:00
Uli Schlachter 674cd21b81 Merge branch 'second-try-no-offcreen' of https://github.com/actionless/awesome 2018-08-22 12:26:05 +02:00
Peter Kasza 016be728b1 Remove unsatisifiable condition when destination screen is empty
This commit fixes the following issue: https://github.com/awesomeWM/awesome/issues/2365
2018-08-21 13:19:02 +02:00
Uli Schlachter 3301e9b0ff naughty.dbus: Duplicate surface data
When an icon is sent over dbus, we turn this into a cairo ImageSurface.
This is done by turning the actual icon data into a string and using
cairo.ImageSurface.create_for_data() to create a surface for this data.
However, this function only creates an ImageSurface that refers to this
data. It does not copy the data. Thus, when the Lua GC later frees the
string, we have a cairo surface that refers to already-freed data.

Fix this by duplicating the cairo surface, which makes cairo create a
copy of the data. Then, we finish the original surface. While doing
this, the string is kept alive in a local variable.

(Possibly) Fixes: https://github.com/awesomeWM/awesome/issues/2361
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-19 20:49:03 +02:00
mergify[bot] 81da3a2ce7
Merge pull request #2358 from Elv13/add_filter_section
doc: Add filter section for the taglist and tasklist
2018-08-19 07:02:06 +00:00
Emmanuel Lepage Vallee 250475d65c widget.common: Use the new ldoc filter section. 2018-08-18 18:14:24 -04:00
Uli Schlachter 5b45442c73 Fix documentation of awful.menu.new
Fixes: https://github.com/awesomeWM/awesome/issues/2348
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 14:20:31 +02:00
Uli Schlachter ea98919f61 awful.rules: Also check for tag on other screens
When a tag is specified by name, awful.rules only searched for the tag
on the client's screen. This commit extends the search to all screens,
but only if no specific screen was specified for the new client by some
rule.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 09:44:29 +02:00
Uli Schlachter bbc4fba3c0 Merge branch 'moue-typo' of https://github.com/psychon/awesome 2018-08-15 13:18:38 +02:00
Mak Kolybabi 24df2ecd6b
Grammar correction. 2018-08-14 06:47:41 -05:00
Uli Schlachter 8b5dd10f32 awful.menu: Fix typo "moue" -> "mouse"
The typo was introduced in commit a1941efc9.

Its effect should be minimal: :item_enter() itself does not care about
the 'mouse' option, but it forwards to :exec(). Here, an action is
invoked either if it was not caused by the mouse, or if it was caused by
the mouse and either auto_expand is enabled (which is the default), or
the item-to-be-executed is actually the active item.

In other words, it is quite non-trivial to come up with a case where
this typo made a difference. But of course that's no reason to leave the
typo in.

Fixes: https://github.com/awesomeWM/awesome/issues/2347
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-13 10:26:10 +02:00
Emmanuel Lepage Vallee 106fba6dd6 timer: Add a reminder to apply the existing naming conventions
Not now because changing things for the sake of changing things in
a point release is a bad idea, but eventually.
2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee efe82faf1c hotkey_popup: Use awful.keygrabber instead of capi.keygrabber 2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee 2bf930b044 keygrabber: Refactor to be an object instead of a function.
The old keygrabber API wasn't doing what the users want from a
keygrabber module. With tons of boilerplate code, everything could
be done, but it wasn't trivial.

This commit add a default grabber function that implements the
keybinding API already used by `awful.key` and `awful.prompt`.

It also add syntax candy left and right to make the module "feel"
like a native CAPI object.

Nothing is perfect and some parts, like adding root keybindings, are not
vevy pleasing. However it fulfill its goal when it comes to make
previously non-trivial use case very easy to implement and deploy.
2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallée aab582c0a0
Merge pull request #2329 from Elv13/fix_minimize_activate
Fix 3rd party toolbar unminimization and the default rc.lua focusable issue
2018-08-03 18:07:50 -04:00
mergify[bot] b9e981ba63
Merge pull request #2327 from laszloth/master
Add a beautiful option to remove borders when maximized
2018-07-30 06:39:38 +00:00
Emmanuel Lepage Vallee 091adca070 activate: Merge the old hardcoded focus filter with awful.ewmh one.
This code was attached to mouse::enter in `rc.lua` instead of being part
of the unified request::activate architecture.

There is currently no way to detach this focus filter because it is
generally correct.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 26e4856821 activate: Raise unfocusable clients.
I am sure there is corner cases where this is considered wrong, but it
allows to simplify rc.lua handling of such clients.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 69e9cc4cbd request::activate: Unminimize clients
Fixes #927
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 3c79f1c8d5 awful.key: Add more fields to the description
There is currently no centralized way to manage active keybindings so
the description data case be used to fill part of that role until an
official API is added.
2018-07-29 10:45:40 -04:00
Laszlo Toth 647756fd15 Add a beautiful option to remove borders when maximized
No intended change in previous behavior, so it's disabled by default.
2018-07-28 16:06:57 +02:00
Daniel Hahler 3876b18240 doc: Add missing C-object documentation and fix some papercuts.
Ref: https://github.com/awesomeWM/awesome/issues/1373
2018-07-25 18:26:11 -04:00
actionless 492d07a9cd fixup! fix(awful: placement: no_offsceen): use new placement infrastructure
doc(awful: placement: no_offscreen): update comment and print deprecation warning
2018-07-25 14:31:51 +02:00
actionless fec8d6aa8f fix(awful: placement: no_offsceen): use new placement infrastructure
fix(tests: examples: awful: placement: no_offscreen): uncomment context

fix(awful: placement): common function to remove border from geometries
2018-07-24 07:38:35 +02:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00
Uli Schlachter 3e24303f15 tile: Apply size hints correctly (#2305)
Layouts work with the client's geometry in "space on screen that is
assigned to this client". This means that the geometry should include
decoration (titlebar and borders) and useless gaps.

Everything else (especially the C code) works with client's geometry in
"space that the client can draw on". This means that the titlebar,
borders and the useless gaps are not included into this size.

Thus, when applying size hints, the tile layout has to convert between
these two representations. Otherwise, size hints are applied incorrectly
and to a wrong geometry.

Fixes: https://github.com/awesomeWM/awesome/issues/1418
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-21 20:53:30 +02: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
Emmanuel Lepage Vallée 25adaae594
Merge pull request #2266 from ZipFile/fix-no_overlap
Improve no_overlap placement
2018-06-26 10:05:49 -04:00
Uli Schlachter 13984af8aa awful.spawn.read_lines: Shrink input stream buffer when done (#2289)
I do not know how a GDataInputStream / GBufferedInputStream decides
about the size of its internal buffer when reading input by line, but in
issue #2288, an example where the output of date (about 30 bytes) was
read ten times per second caused ten megabytes of memory usage for this
internal buffer. Try to save some memory by explicitly shrinking the
buffer size when we are done reading from the stream.

Reference: https://github.com/awesomeWM/awesome/issues/2288
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-06-26 09:56:32 -04:00
Yauhen Kirylau b77ffa86e0 fix(naughty: core): don't attempt to upscale small icons (#2283) 2018-06-12 21:57:14 -04:00
Emmanuel Lepage Vallée 7e529eeab2
Merge pull request #2273 from Elv13/fix_doc_signals
Fix doc signals
2018-05-28 20:56:17 -04:00
Emmanuel Lepage Vallée 508b1f5ed5
Merge pull request #2272 from barlik/patch-3
Fix incwfact() error with maximized windows
2018-05-28 20:55:59 -04:00
Kevin Zander 05b8836b01 Fix minor issues with calendar_popup (#2269) 2018-05-28 20:54:58 -04:00
Kevin Zander 6615931a6e Enhance tooltip customization options (#2267) 2018-05-28 20:54:14 -04:00
Emmanuel Lepage Vallee c6491e169c doc: Remove the signal name hack 2018-05-28 14:11:41 -04:00
Rastislav Barlik 2d39e53ef3
Fix incwfact() error with maximized windows
When the window is maximized, calling incwfact() results in an error because `w` is nil, return instead.
2018-05-26 22:55:14 +01:00
Anatolii Aniskovych cbfe8274be awful.placement: Keep client position when no space available in no_overlap() (#2139) 2018-05-19 00:08:19 +03:00
Anatolii Aniskovych da418b56ab gears.geometry: Make area_intersect_area() public 2018-05-19 00:08:19 +03:00
Anatolii Aniskovych dd3658bb1c awful.placement: Ignore fullscreen/maximized clients in no_overlap()
Fullscreen/maximized client takes full workspace area making free space detection logic useless.
2018-05-19 00:08:11 +03:00
Kevin Zander 347238b57a Check for layout spacing before theme spacing. Fixes #2250 (#2253) 2018-04-29 20:12:04 -04:00
Alphonse Mariya 405c14496a wibox.layout.flex: remove exit condition (#2252) 2018-04-27 14:06:55 +02:00
Emmanuel Lepage Vallée b2f8c8df89
placement: Check if the stored screen is valid (#2246)
Fixes #2088
2018-04-26 20:47:33 -04:00
Emmanuel Lepage Vallée 5b9180fc1b
Merge pull request #2249 from Aire-One/fix_widget_slider_doc
Fix widget slider doc
2018-04-26 20:46:54 -04:00
Aire-One 7521a861e6 add documentation for signal "property::value" 2018-04-24 00:23:42 +02:00
Sagar Tewari 6617d786b3 program.Terminal is a boolean, not a string (#2239) 2018-04-22 02:06:38 -04:00
Emmanuel Lepage Vallée f2bac50198
Merge pull request #2236 from funtaps/patch-1
Allow use of custom completion callback in prompt widget
2018-04-22 02:06:14 -04:00
Jim Garrison 301d5b80c4 Move timezone determination to callback (#2229)
Patch by @psychon.  Fixes #2218.
2018-04-22 02:05:40 -04:00
Emmanuel Lepage Vallée c49095fc23
doc: Fix a tasklist/taglist documentation issue (#2228)
* doc: Fix a tasklist/taglist documentation issue
2018-04-22 02:04:01 -04:00
Reiner Herrmann e8c23bd9e7 Add categories path to icon lookup (#2224)
In #2112 the way of loading category icons was changed to use
utils.lookup_icon. However this function does not look in the
categories paths where the categories icons are located, and
so the category icons are no longer being displayed.
2018-04-22 02:03:28 -04:00
ma9e bed7abf5d1 Add support for gaps between snapped contents (#2208) 2018-04-22 02:02:52 -04:00
Kirill Funtov 38f7b17f0b
Added link to awful.prompt.run to documentation 2018-04-05 11:04:17 +03:00
Funtov Kirill 94856f48b4
Allow use of custom completion callback in prompt widget 2018-04-04 22:24:25 +03:00
Alphonse Mariya 5e6f534365 naughty: add notification max width and height (#2232) 2018-04-02 22:12:15 +02:00
Emmanuel Lepage Vallée 356d730b7d
Merge pull request #2216 from psychon/deprecate-get_dir
Deprecate gears.filesystem.get_dir
2018-03-12 22:55:33 -04:00
Uli Schlachter 44587cec35 awful.remote: Run code in a protected context (#2203)
This change makes errors messages show up in the replies, too.

Before (notice how the third command does not generate output):

$ awesome-client 'return 42' ; awesome-client 'sdfsdf' ; awesome-client 'error("foo")'
   double 42
   string "[string "sdfsdf"]:1: syntax error near <eof>"

After:

$ awesome-client 'return 42' ; awesome-client 'sdfsdf' ; awesome-client 'error("foo")'
   double 42
   string "[string "sdfsdf"]:1: syntax error near <eof>"
   string "Error during execution: [string "error("foo")"]:1: foo"

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-12 22:51:11 -04:00
Uli Schlachter f9eec13144 awful.tag.object.set_screen: Cope with screen being nil (#2202)
For "stuff around screen's 'removed' signal", it might make sense to
temporarily set a tags screen to nil. The idea is that it will only
later be assigned to a new screen, not immediately.

However, currently a tag with screen nil causes quite some problems in
the set_screen() function. This commit works around this with a generous
amount of "wrap this in if".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-12 22:50:44 -04:00
Uli Schlachter 675900407a Deprecate gears.filesystem.get_dir
It is a useless thin wrapper around other functions. It's better to use
these other functions directly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-11 16:08:07 +01:00
Uli Schlachter c8d6b7d28a Use get_cache_dir() where appropriate
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-11 16:08:07 +01:00
Emmanuel Lepage Vallée aabff6dac7
Merge pull request #1487 from Elv13/fix_1482
Add an awful.rules chain of responsibility
2018-03-04 16:42:05 -05:00
Emmanuel Lepage Vallee 6921dc9f4c doc: Add a titlebar example 2018-03-04 02:21:48 -05:00
Emmanuel Lepage Vallee 017077a33a spawn: Add a TODO to remove an useless/broken signal from v5
It has a race condition causing it to be useless.
2018-03-04 01:34:34 -05:00
Emmanuel Lepage Vallee 74508098de rules: Add a rule building chain of responsability
Before this commit, there was a conflict between the spawn and
awful.rules rules.

Also, modules such as Tryannical monkey-patched this function to
add their own rules to the mix. This commit introduce a proper
API to add handlers.

The order is crutial for this to work, so a dependency system is
also added.

Fix #1482
2018-03-04 01:34:33 -05:00
Emmanuel Lepage Vallee 4e0915674d gears: Add a new sort module
The first use case is a topological sort to handle dependency graphs

Closes #2159
2018-03-04 01:29:33 -05:00
Emmanuel Lepage Vallee cfaf7d8fe8 titlebar: Expose some previously private properties.
I am not happy with this API in general, I keep it undocumented
for now. In a perfect world, the whole client frame would be
a hierarchy.
2018-02-25 18:01:08 -05:00
Emmanuel Lepage Vallee 45135b28b1 shims: Use cairo PNG support instead of GDK
It is inferior, but at least doesn't print warnings on Travis due
to the lack of X server.
2018-02-25 18:01:08 -05:00
Uli Schlachter b2d1e8574f Merge branch 'gdkpixbuf' of https://github.com/psychon/awesome 2018-02-17 13:26:23 +01:00
Daniel Hahler c5f2aa8e83 doc: improve gears.table.iterate 2018-02-07 21:49:16 +01:00
Alexander Melnyk 584c5cedb1 Add support for resizing notification icon with respect to aspect (#2176)
* Add support for resizing notification icon with respect to aspect

Previously, if an icon was not exactly square, an icon size set in configuration
would cause the notification to pad the icon with empty space so dimensions are
equal.

Now behaviour is different: the bigger dimension of the icon is scaled to fit
the icon_size value, while smaller is scaled same amount to preserve aspect.

Also, ImageSurface is now not created as fixed size square, but it's dimensions
are computed in similar way.

* Round the computed dimensions of ImageSurface

Even one pixel off is still off.
2018-02-06 11:01:40 -05:00
Uli Schlachter cfe9231e59 awful.keygrabber.run: Fix example (#2169)
Fixes: https://github.com/awesomeWM/awesome/issues/2167
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-24 13:13:08 -05:00
Emmanuel Lepage Vallée 8d063f573e
Merge pull request #2165 from psychon/wallpaper_docs
Improve docs for gears.wallpaper and gears.color
2018-01-22 21:18:54 -05:00
Emmanuel Lepage Vallée 1182ad0f92
Merge pull request #2153 from otommod/master
Add set/get for textclock attributes
2018-01-22 17:44:03 -05:00
Uli Schlachter 28e8894f05 Give the docs for gears.color some improvements
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-22 11:53:39 +01:00
Uli Schlachter 0864829c0a Add some introductionary documentation to gears.wallpaper
Related-to: https://github.com/awesomeWM/awesome/issues/1373
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-22 11:22:05 +01:00
Otto Modinos 3687d198f2 textclock: mimick other widgets for docs/naming 2018-01-21 02:32:26 +02:00
Otto Modinos 1e685635a8 textclock: rename timeout to refresh 2018-01-21 02:06:24 +02:00
Otto Modinos 9d3a9547b1 Add set/get for textclock attributes
To allow "declarative" construction of clocks.
2018-01-21 02:04:12 +02:00
Uli Schlachter ee944f4da8 gears.surface: Use GdkPixbuf
This now does directly what previously awesome.load_image() did. Also,
this commit removes the only caller of awesome.load_image(), so that
function could (in theory) be removed now.

Fixes: https://github.com/awesomeWM/awesome/issues/1235
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-18 18:19:07 +01: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 Vallée ad68d3bf5b
Merge pull request #2156 from varingst/fix-icon-lookup
Fix: #2152
2018-01-16 21:16:34 -05:00
Uli Schlachter a4936c963c Fix 'creating new widgets' link (#2157)
This was broken ever since it was introduced in commit b1e69dba8c.
Yay. :-(

Fixes: https://github.com/awesomeWM/awesome/issues/1373#issuecomment-357891791
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-16 21:15:49 -05:00
get a65079b104 Fix icon path resolution in menubar.utils
Issue #2152

Rewrites get_icon_lookup_path to find icons and themes in
$HOME/.icons. Also adds 'scalable' as the top priority icon size.
2018-01-15 23:25:31 +01:00
Uli Schlachter 5c6e25fe0a Revert 31b8623ff6 and fix things properly (#2142)
The code here has things like "if cache.bgb" which suggests that "bgb"
(great name, by the way) is supposed to be optional. However,
31b8623ff6 made this thing definitely not optional by making it
*the* widget that is displayed. That feels wrong.

Also, after the above commit, the ".primary" entry is no longer used,
which is at least surprising for something which is called "primary".

None of this is explicitly documented (I didn't find anything when
looking for "primary" in common.lua nor tasklist.lua; I know that there
are examples for using this, but still that doesn't say how this is
supposed to work), so I'm not quite sure how this was intended to work.
Instead, I am just proposing this commit as a better fix with the above
rational and see what feedback I get...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-12 21:32:51 -05:00
Uli Schlachter 8cc469322f ensure_pango_color: Support hex values with alpha
Reference: https://github.com/awesomeWM/awesome/pull/2129#discussion_r155397507
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-13 02:15:30 +01:00
Emmanuel Lepage Vallee 31b8623ff6 widget.common: Fix the background color
regression from f147f0d28a
2017-12-05 19:52:36 -05:00
Emmanuel Lepage Vallée dd5be865c3
Merge pull request #2127 from Elv13/doc_tests_and_notif_p3_1
awful.widget.common overhaul
2017-12-05 14:06:05 -05:00
Emmanuel Lepage Vallée 19fd21111a
awful.placement: Fix `next_to` logic. (#2130)
Fix #2128
2017-12-03 15:05:19 -05:00
Emmanuel Lepage Vallee 20c4f71e19 taglist: Support externally defined layouts and widgets 2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee 329c06fbca tasklist: Support externally defined layouts and widgets 2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee f147f0d28a common: Refactor awful.widget.common to support external extensions
This commit allow user defined delegates to be used as list elements.
This put an end to the endless attempt to cram more features into this
code.

A widget template (non-instantiated) is passed to the arguments and
is created by the common code. It also supports "roles" where some
user defined widgets can replace the old textbox or imagebox.
2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee 2e7cd2b2ef tasklist: Add a sync way to force an update
It simplifies the tests
2017-12-02 16:33:06 -05:00
Emmanuel Lepage Vallee b446a9bdb8 tasklist: Deprecate the old function signature 2017-12-02 16:33:06 -05:00
Emmanuel Lepage Vallee 8dedd19fcf taglist: Deprecate the old function signature
The old function didn't scale at all. As no replacements are going
to be merged anytime soon, start to make it meta-extensible.

This is the first step to be able to let the widget be extended
directly from rc.lua without adding yet more silly parameters.

It never scaled and has reached the point of no return a very long
time ago.

My first ever contribution to Awesome was to attempt to fix this,
but the solution was a bad hack. The radical module later solved
this by delegating the style, layout, theme, item layout and item
style to various "visitor" objects. While this is superior to this
commit, it was also a very large and complicated codebase. After
5 years, it is now obvious it will never be merged "whole".
2017-12-02 16:15:29 -05:00
Emmanuel Lepage Vallée 73b70d34fa
Merge pull request #2122 from Elv13/doc_tests_and_notif_p2_2
wibox: Add an input_passthrough property
2017-11-27 00:36:44 -05:00
Emmanuel Lepage Vallee d99504775b doc: Mutualize the wibar and wibox constructor documentation.
Do it now since the future awful.popup and notification widget
also uses it.

The `load_ldoc.cmake` changes allow to include `.ldoc` blocks in
existing ldoc comments. Previously, it added some extra newlines
and an autogenerated comments saying the content below was imported.
The problem is that this prevented the system to be used for shared
function arguments.

This commit also renames the `wibar` argument table from `arg` to
`args` as the name has to be the same in the `wibox` and `wibar`
constructor for this to work.
2017-11-27 00:22:11 -05:00
Emmanuel Lepage Vallee 4e54aea6a9 wibox: Add an input_passthrough property.
Allows, for example, to have semi translucent wibars on top of
the fullscreens clients without having issues with inputs.
2017-11-27 00:20:42 -05:00
Emmanuel Lepage Vallée b44fd6e35b
Merge pull request #2124 from Elv13/doc_tests_and_notif_p2_4
Add spacing widgets to layouts
2017-11-27 00:18:38 -05:00
Emmanuel Lepage Vallee e12c000b97 layout: Add separator widget support to 3 layouts
The ratio, fixed and flex layout can now display a widget between
each layout elements.

The align layout was left out because it doesn't support spacing
2017-11-24 19:13:59 -05:00
Emmanuel Lepage Vallée 056af3d48d
Merge pull request #2109 from Elv13/revert_dpi_per_screen
screen: Revert the DPI per screen changes.
2017-11-23 23:42:26 -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
Emmanuel Lepage Vallee 314e307cd6 textbox: Ensure that the DPI arguments are not nil
Otherwise it fails. This allows better error message to be sent to the
user.
2017-11-23 23:28:32 -05:00
Uli Schlachter 5ef937c07c textclock: Detect failures from g_date_time_format (#2119)
If g_date_time_format() fails, it returns a NULL pointer. This change
makes the textclock detect this and print a warning. This warning
contains 'g_date_time_format()' so that people can ask their favorite
search engine for the supported formats of this function. This warning
also contains the actual format string so that all the information is
available in one place and possible bug reports hopefully include the
format string.

Reference: https://github.com/awesomeWM/awesome/issues/2118
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-23 23:27:18 -05:00
Emmanuel Lepage Vallée 10057ec51c
Merge pull request #2104 from Elv13/fix_2101
Fix the resize/move "after" mode
2017-11-19 14:02:44 -05:00
Emmanuel Lepage Vallee 9f7a365447 doc: Cleanup useless index entries
Entries such as the empty `objects.client` or `awful.hotkeys_popup.keys`
are no longer in the main index.
2017-11-19 00:46:06 -05:00
Daniel Hahler babc11a9be
Merge pull request #2111 from psychon/glib_keyfile
Menubar: Use GlibKeyFile
2017-11-18 01:51:04 +01:00
Uli Schlachter 5363225217 Deprecate menubar.index_theme
The previous commit deprecated its only user.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-16 13:58:25 +01:00
Uli Schlachter 0b0b466705 Deprecate menubar.icon_theme
The code in menubar.icon_theme naively implements the algorithm from the
base dir specification. This is a problem: On this system,
/usr/share/icons/{Adwaita,hicolor}/index.theme list 91, respectively 649
subdirectories. Since we check for three file extensions (png, svg,
xpm), this means that a failing icon lookup for the Adwaita theme checks
for (91+649)*3 = 2220 files (in practice it might be a bit better since
the directories have specific meanings, but still). That's insane.

Since we only use this code for looking up category icons anyway, just
deprecate this mess. Category icons are now looked up in the same way
that icons for individual applications are looked up.

Since menubar.init does not require("menubar.icon_theme"), this means
that menubar.icon_theme is no longer actually loaded. That's bad.

(Hopefully) Fixes: https://github.com/awesomeWM/awesome/issues/1496
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-16 13:12:59 +01:00
Uli Schlachter 5d21e85bfb menubar.utils.parse_desktop_file: Improve type handling
This is a slight API break, but should not cause many problems for
people. This makes parse_desktop_file() handle the type of keys
correctly, so that e.g. booleans are actually parsed as booleans. Also,
locale-sensitive entries are now looked up in a way that obeys the
current locale.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-15 15:27:05 +01:00
Uli Schlachter e88f1e8735 menubar.utils.parse_desktop_file: Use GKeyFile
This replaces our own, hand-written parser of desktop files with the one
that GLib provides. No functional changes intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-15 15:27:05 +01:00
ikselven b2fac56b9c hotkey: added hotkeys for termite to hotkeys popup widget (#2098) 2017-11-06 20:41:18 +01:00
Emmanuel Lepage Vallee 33124d8605 widget: Add a separator widget. 2017-11-06 05:19:17 +01:00
Emmanuel Lepage Vallee 3ffbe4c03b client: Prevent an error when using the "after" mode
Fix: #2101
2017-11-05 20:39:07 +01:00
Stefan Loewen 8ebea11df0 Fix doc: get_clients methods belong to screen (#2099)
not to client
2017-11-03 17:27:17 +01:00
lePerdu 926c126738 Fix typo: "OnlyShownIn" -> "OnlyShowIn" 2017-11-02 20:08:48 -04:00
Emmanuel Lepage Vallée 5b8e8dbf80
Merge pull request #2094 from psychon/fix_rules_no_such_tag
awful.rules: Handle non-existing tags
2017-10-31 19:20:12 +01:00
necauqua aa64978c31
Add call_now argument to gears.timer 2017-10-31 18:24:53 +02:00
Uli Schlachter 7fda5d3273 awful.rules: Handle non-existing tags
If a tag is specified by name, but no such tags exist, awful.rules would
cause an error (attempt to index a nil value). Fix this and add a test
for this case.

Fixes: https://github.com/awesomeWM/awesome/issues/2087
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-31 13:23:12 +01:00
Daniel Hahler 678ead2634 Add client.object.immobilized_{horizontal,vertical} (#2066)
ewmh.client_geometry_requests: ignore immobilized clients

Fixes https://github.com/awesomeWM/awesome/issues/1676.
Fixes https://github.com/awesomeWM/awesome/issues/2036.
2017-10-25 15:36:00 +02:00
Emmanuel Lepage Vallee cedeb2bb5a wibox: Add a `to_widget()` and `save_to_svg()` method.
Take a wibox snapshot as a widget. It also add an helper to save
it to a file. This is useful for debugging when called from
`awesome-client`
2017-10-21 19:34:04 +02:00
Uli Schlachter 1592180c83 textbox: Make some screen arguments optional again (#2057)
Since beautiful.xresources.get_dpi(s) allows nil as argument to query
some "global DPI", the functions to query the size of a textbox also
allowed to use nil as the screen, even though this was never documented
to work. Commit a137655791 broke this by assuming a valid screen
object.

This commit makes a nil argument work again, but will cause a
deprecation warning in awesome 5.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-21 19:32:35 +02:00
Daniel Hahler c362524a5f Merge pull request #2012 from Elv13/doc_tests_and_notif_p1_2
widget: Add a flexible generic constructor
2017-10-21 19:26:49 +02:00
Uli Schlachter c7d75ed119 awful.screen.object.get_dpi: Ignore outputs with size 0 (#2063)
For example, Xephyr reports its output with a size of 0x0. Since a
division by zero is in no one's interest, just ignore such outputs when
trying to compute the DPI value.

Thanks to @timroes for pointing this out:
c8fac753c4 (commitcomment-25072296)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-21 19:23:04 +02:00
Daniel Hahler 03580db5bb Merge pull request #2015 from Elv13/doc_tests_and_notif_p1_5
object: Add support for signal forwarding
2017-10-21 19:20:41 +02:00
Uli Schlachter c8fac753c4 Merge pull request #2055 - psychon/auto_screen_dpi 2017-10-14 18:26:50 +02:00
Uli Schlachter 74a6cbedce Fix menubar screen handling
Running test-menubar.lua just failed for me locally. The reason was that
the textbox was indexing a nil value when doing 's.dpi'.

This commit fixes the menubar so that its optional screen arguments are
really handled correctly. In fact, a default screen is now chosen way
earlier than before, so that no nil values are used as screens later on.

In other news: I guess test-menubar.lua is not run on any of our Travis
targets...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-08 14:53:58 +02:00
Uli Schlachter d0fbb96d2d screen.dpi: Use RandR for per-screen DPI
This commit makes awesome automatically compute the DPI of a screen
based on its RandR outputs. If multiple outputs exist, the lowest DPI is
used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-08 14:40:20 +02: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
Uli Schlachter 7e395e7bc0 Use memory shorter with awful.client.shape (#2051)
To apply the shape of a client, we have to create an image and draw the
shape we want to it. Since clients can be quite large, we have to make
sure that we do not keep this image alive unnecessarily long.

The code in awful.client.shape.get_transformed() however needs another
temporary surface in case the client has its own shape and another one
was set in Lua (side note: currently the code also creates this extra
temporary surface if the client does not have its own shape; that might
be worth fixing). This temporary surface is then used as the source of a
cairo context to draw it to the image that will be used as the client's
final source.

After we are done, the temporary surface is still kept alive since it is
the current source of the cairo context. The cairo context in turn is
only freed when Lua's garbage collector collects it, which may take
quite a while.

Improve this by setting a different source to the cairo context. Thus,
it now releases the temporary surface as soon as possible and it is only
allocated for a short time.

Fixes: https://github.com/awesomeWM/awesome/issues/2050
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-07 18:22:50 +02:00
Uli Schlachter 4e42996d9a naughty: Fix replaces_id + changing colors (#2041)
This fixes a regression introduced in be29ee6768. This commit changed
naughty to reuse an already-existing wibox when replaces_id is used,
instead of creating a new wibox. However, some of the properties that
are set only when creating a wibox were ignored due to this.

Fixes: https://github.com/awesomeWM/awesome/issues/2040
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-09-30 21:37:33 +02:00
Zach Peltzer 013abf5a39 Display desktop entries with no categories (#2039) 2017-09-28 22:58:14 +02:00
Zach Peltzer 8d34201ec3 Unescape strings when parsing desktop entries (#2043)
* Unescape strings when parsing desktop entries

* Fix unused value warning in menubar/utils.lua

* Move menubar.utils.unescape() tests

* Clean up menubar.utils.unescape() function

* Fix warning for using "_" in a non-local context

* Do not ignore trailing whitespace in menubar.utils.parse_list()
2017-09-28 22:57:39 +02:00
Uli Schlachter 55dee1ea87 magnifier layout: Never manage floating windows (#2046)
The magnifier layout handles the currently focused client specially.
However, if the currently floating client is floating, it should not be
handled by the layout at all. A bug caused the magnifier layout to
handle a focused and floating client anyway if it was the only tiled
client.

Fix this by removing the '#cls > 0'-case. If #cls == 0, then no client
is available to be managed. Thus, cls[1] will be nil, which is fine
since, well, no client is available to be managed. This only made a
difference in the specific bug that I described above. Thus, drop this
case.

Fixes: https://github.com/awesomeWM/awesome/issues/2045
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-09-28 22:56:41 +02:00
Uli Schlachter b04b1b27af Add a force_update() method to the textclock (#2034)
Reference: https://github.com/awesomeWM/awesome/issues/344
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-09-10 20:12:25 +02:00
Yauhen Kirylau ebcc19844e fix(awful: placement: no_overlap): use new placement infrastructure (#2032)
Fixes #2030
2017-09-09 16:26:54 -04:00
Daniel Hahler 66c4e55511 Merge pull request #2029 from actionless/calendar-fix-click-hide
Calendar popup click/hover fix
2017-09-09 05:14:02 +02:00
getzze 35432e9f21 Avoid skipping a month if the day is 31 (#2028) 2017-09-08 22:08:47 +02:00
actionless c9fbecd1e8 refactor(awful: widget: calendar_popup): s/_calendar_clicked/_calendar_clicked_on/ 2017-09-01 22:43:57 +02:00
actionless 23613bac05 fix(awful: widget: calendar_popup): hover was not working anymore if hiding popup by clicking on it 2017-09-01 22:43:07 +02:00
Yauhen Kirylau 9e4446060e feat(awful: widget: calendar_popup: attach): implement 'on_hover' option (#2008)
* feat(awful: widget: calendar_popup: attach): implement 'on_hover' option

* feat(awful: widget: calendar_popup): smarter handling of click and hover at the same time
2017-08-27 21:01:24 +02:00
Yauhen Kirylau fd66d12a4b feat(awful: widget: calendar_popup): implement 'margin' widget property (#2010) 2017-08-27 14:23:43 +02:00
Emmanuel Lepage Vallée ec08af4e76 clienticon: add a client setter (#2018)
It's required to work with the declarative syntax and be used
in the tasklist due to its limitations.
2017-08-27 14:23:06 +02:00
actionless 0a75f09d1d fix(menubar: utils: parse_dir): print to log the current failed directory instead of the root one 2017-08-24 23:06:16 +02:00
actionless 960f59b228 fix(menubar: utils: parse_dir): print warning instead of error if directory can't be opened 2017-08-24 23:06:16 +02:00
Daniel Hahler aa1ff23b19 Merge pull request #1992 from Veratil/string-funcs
Add two new gears.string functions: startswith, endswith.
2017-08-21 21:11:25 +02:00
Emmanuel Lepage Vallée fd2307afd0 grid: fix an unavoidable assert (#2017)
`:add()` was called with the optional `...` arguments, but the
function required at least one argument.
2017-08-21 21:10:43 +02:00
Daniel Hahler 784472f212 doc: improve/fix doc for awful.rules (#2005) 2017-08-20 13:37:03 -04:00
Emmanuel Lepage Vallee ce3be7ca1b object: Add support for signal forwarding
The CAPI signal system already has this mechanism.
2017-08-19 22:52:08 -04:00
Emmanuel Lepage Vallee 2303e31355 mouse: Fix a bad refactoring
The `wibox_under_mouse` property was renamed `current_wibox` but
a call wasn't updated.
2017-08-19 22:50:17 -04:00
Emmanuel Lepage Vallee 7e8f3e9b9b widget: Add a flexible generic constructor
This avoid copy pasting this kind of code in many places.
2017-08-19 22:45:54 -04:00
SpiritCroc a20dd4ad61 KeyboardLayout widget: add EurKey (#2003) 2017-08-17 17:21:40 +02:00
Uli Schlachter 12bb7f5a9e Improve docs for emit_signal_recursive (#1998)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-16 13:37:14 +02:00
Kevin Zander 5d0e9fd9e3 Add startswith and endswith function to gears.string, change awful.completion to use startswith over local function 2017-08-14 10:48:12 -05:00
Nick Diego Yamane bfe58d65f1 docs: fix some typos/leftovers (#1989)
Signed-off-by: Nick Yamane <nick.diego@gmail.com>
2017-08-14 16:06:44 +02:00
Uli Schlachter 8166e2ff8b Fix the example in the tooltip docs (#1980)
Reference: https://github.com/awesomeWM/awesome/pull/1978
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-13 12:23:40 +02:00
Emmanuel Lepage Vallée 2900ea6f01 Merge pull request #1842 from psychon/lgi-check
Port lgi-check.sh to C
2017-08-12 15:59:18 -04:00
Daniel Hahler 68497dffc4 gears.debug.print_{warning_error}: add "awesome: " prefix (#1968)
This makes it consistent with the C functions (`_warn` and `_fatal`).
2017-08-10 14:08:32 +02:00
Daniel Hahler 31e25dc6a5 Cleanup usages/patching of awful.util.deprecate (#1966) 2017-08-10 12:18:54 +02:00
Florian Gamböck 0bd74b4f72 Append slash on true local directories
A slash must only be added if the current completion item starts with
`./` and is actually a directory.
2017-08-09 21:20:22 +02:00
Florian Gamböck 7c677e01cc Replace os.execute with gfs function 2017-08-09 21:20:22 +02:00
Florian Gamböck e8ad3a32f5 Add string helper function
This function returns true if a string starts with a given prefix.
2017-08-09 21:20:22 +02:00
Florian Gamböck 1802a44018 Import gears.filesystem
This is needed for some future filesystem checks.
2017-08-09 21:20:22 +02:00
Florian Gamböck a68cc783c9 Add function to check file executable bit
This is just a plain copy of the file_readable function, with "read"
replaced with "execute".
2017-08-08 20:33:47 +02:00
José Romildo Malaquias 0def266c84 Add entry for menu font in theme (#1961) 2017-08-07 14:36:40 -04:00
Emmanuel Lepage Vallée 90e8b67d37 Merge pull request #1960 from psychon/fix-some-leaks
Fix some leaks
2017-08-07 14:36:08 -04:00
Daniel Hahler 828eefed79 awful.tooltip: border: do not default to border_width (#1955)
Several themes use `dpi(2)` which is quite thick, and it is better to
use the default of 0 here, instead of `beautiful.border_width`, which is
meant for borders on clients.
2017-08-05 16:07:47 +02:00
Uli Schlachter e73eb3ad38 gears.surface.apply_shape_bounding: Finish temporary image
This function draws the wanted shape to a cairo image surface and then
uses it to set the shape of the passed-in object. After this commit,
this temporary image is finished afterwards, making it free most of its
memory immediately instead of only later when the garbage collector
collects the image surface.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:18:01 +02:00
Uli Schlachter 0da790c026 awful.tooltip: Finish temporary image
For setting the shape of the tooltip, this code creates an image surface
describing the wanted shape. After this commit, this image surface is
finished when it is no longer needed. This results in most of the
image's memory to be freed immediately instead of only later when the
garbage collector collects the image surface.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:16:12 +02:00
Uli Schlachter 11216d8ca4 awful.mouse.snap: Finish temporary image
This function creates a temporary image surface to set the shape of a
wibox. After this commit, the image is now finished after use. This
results in most of the image's memory to be freed immediately instead of
waiting for the garbage collected to collect it.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:14:51 +02:00
Uli Schlachter efb8134815 awful.client.shape: Finish the shape image when done with it
This function queries the shape of a client and then does something with
it. This commit makes sure the image is finished afterwards, which means
that most of its memory is released immediately instead of waiting for
the garbage collector to collect it.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:13:22 +02:00
Uli Schlachter 8dfe18a382 Fix wibox to forward shapes directly
When doing w.shape_bounding = foo on a wibox, the code would first read
shape_bounding from the underlying drawin. This would create a
(possibly) huge cairo image surface that just waits to be collected by
the garbage collector, resulting in increased memory usage.

Fix this by checking the force_forward table first. This tables contains
the names of shape properties. Thus, the evaluation of this statement
gets short-circuited and the property is on the drawin is not read.

Helps-with: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:10:14 +02:00
Crazy Lemon 2886095358 Specifies the wibox dependency on the menubar utils (#1953)
Only this particular module is needed
2017-07-30 13:42:20 -04:00
Uli Schlachter 60b5df1308 awful.tag: Apply a default layout to tags (#1952)
Related-to: https://github.com/awesomeWM/awesome/pull/1950
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-29 13:58:45 -04:00
Tomoya Tabuchi 0836cf90c5 Add notification_icon_size as a beautiful variable (#1951) 2017-07-29 15:58:52 +02:00
Uli Schlachter acc012353d Make keyboardlayout widget more robust (#1941)
I am not sure what exactly goes on in the below bug report, so this will
just paper over the problem. I still think that this patch is a good
idea even when it is not a proper fix, since keyboard layouts are
complicated and so this code should be robust and hard to break.

Fixes: https://github.com/awesomeWM/awesome/issues/1933
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-25 18:17:32 +02:00
Uli Schlachter ee1dc78434 awful.tooltip: Set wibox.type = "tooltip"
Fixes: https://github.com/awesomeWM/awesome/issues/1938
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-24 07:52:55 +02:00
Jan Larres 458981710c Treat certain layouts as single client for gaps (#1914)
When gap_single_client is set to 'false', no gap is used when only one
client is shown in a tag. Since the max layout only ever shows one
client at a time it makes sense to apply this setting for this layout
regardless of the actual number of clients in that tag.

Additionally, if the 'master_fill_policy' property is set to
'master_width_factor', then use a gap even if there is only one client
visible and 'gap_single_client' is false.
2017-07-20 21:21:51 +02:00
mqus bd5f0dd3fc Fix calendar_popup.lua documentation
There were multiple things which stood out to me, as I was trying to setup a simple calendar popup for my textclock:
1.: The functions in https://awesomewm.org/doc/api/classes/awful.widget.calendar_popup.html#Functions were not named correctly (calendar vs calendar_popup) which (naturally) produced an error when used as awful.widget.calendar.month() .
2.: The example for calendar_popup.month() was obviously missing a line (where does the month_calendar come from?) . Resolved by copying the line from the attach-example
3.: The same examples also only refer to the function as calendar.month() which should be changed to awful.widget.calendar_popup.month()
2017-07-19 17:22:31 +02:00
Emmanuel Lepage Vallée bb26c32726 Merge pull request #1901 from actionless/xresources-titlebar-hover-press
feat(beatiful: theme_assets; themes: xresources): recolor titlebar icons for `hover` and `press` states
2017-07-10 10:11:50 -04:00
Uli Schlachter 07d561ee91 wibox.widget.calendar: Stop using make_widget_declarative
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 19:00:16 +02:00
Uli Schlachter d72893692e calendar_popup: Fix method name entries
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 18:59:17 +02:00
Uli Schlachter 9519d666a3 calendar_popup: Fix style documentation
Fixes: https://github.com/awesomeWM/awesome/issues/1899
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 18:36:04 +02:00
Daniel Hahler 4eddfacf51 lib/awful/completion.lua: handle missing SHELL environ var (#1897) 2017-07-03 19:26:10 +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
Daniel Hahler d4924988df rules: switchtotag: fix usage of awful.tag.viewmore (#1895)
This passes in the client's screen for now.

In the long run this should get fixed via
https://github.com/awesomeWM/awesome/issues/1883, but that is more
involved.

Fixes https://github.com/awesomeWM/awesome/issues/1886.
2017-07-02 11:26:41 +02:00
morethanoneanimal cbb8fd7ac4 Add naughty.destroy_all_notifications (#1871)
Also updates connect_signal in naughty lib to use destroy_all_notifications().
2017-06-29 00:11:07 +02:00
Uli Schlachter b9d9587afa menubar: Produce better errors for broken .desktop files
This now runs parse_desktop_file in a protected context so that a single
broken desktop file does not break the whole menubar.

Also, the error message that is produced when a Lua error occurs now
also includes the file name of the .desktop file which we attempted to
parse. This should help quite a lot in debugging.

Related-to: https://github.com/awesomeWM/awesome/issues/1880
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-28 09:17:13 +02:00
Emmanuel Lepage Vallée 09bd3ec67a Merge pull request #1872 from Elv13/upstream_dynamic_p8
Import some commits from the stateful layout branch
2017-06-27 03:54:12 -04:00
Daniel Hahler 6d5cf6cdbb Merge pull request #1736 from blueyed/completion-zsh-nullglob
awful.completion: zsh: fix command completion from PWD
2017-06-27 08:01:46 +02:00
Daniel Hahler 3e305a7272 minor: check textbox earlier, whitespace 2017-06-27 00:04:40 +02:00
Daniel Hahler 5dcd5969be awful.prompt: fix Shift-Tab
1. before this patch the "Shift" key(s) to get to Shift-Tab would reset
   ncomp already.
2. "Shift-Tab" will come in as "Tab" with mod.Shift typically.
3. cur_pos and ncomp have to get reset in case of going back to the
   original entry.
2017-06-27 00:04:40 +02:00
Daniel Hahler 4c792b49a9 awful.completion: handle first word as command always
This is necessary for `./*`, but should apply in general.
It was changed in 3986409e, but there is no argument for it in the
commit (message) really.
2017-06-26 22:45:11 +02:00
Daniel Hahler 2a69ffa374 awful.completion: zsh: fix command completion from PWD
Fixes https://github.com/awesomeWM/awesome/issues/1734.
2017-06-26 22:45:11 +02:00
Daniel Hahler 956ac3c50d awful.completion.shell: fix cur_pos return value 2017-06-26 22:45:11 +02:00
Daniel Hahler a6c36a4a2e awful.spawn: fix doc for spawn.easy_async{,_with_shell} (#1877)
Using `@function` in 547c0e4b was wrong.
2017-06-26 22:44:08 +02:00
Tim Roes 3d1b2c2a5e Pass freedesktop hints to naughty.notify (#1875) 2017-06-26 21:21:09 +02:00
Luke Bonham 547c0e4b83 awful.spawn: add easy_async_with_shell and fixed easy_async doc (#1541) 2017-06-26 21:15:58 +02:00
Daniel Hahler 9cd26cd274 doc: fix awful.completion.shell (#1866) 2017-06-26 20:40:56 +02:00
Emmanuel Lepage Vallee fb367c3f9e stack: Add offset support 2017-06-26 02:27:20 -04:00
Emmanuel Lepage Vallee 29f70c1b4c mirror: Fix documentation
It didn't render properly
2017-06-26 02:27:20 -04:00
Emmanuel Lepage Vallee 458340b4d4 doc: Add examples for the ratio layout 2017-06-26 02:27:20 -04:00
Emmanuel Lepage Vallee 0430f55257 ratio: Add a fill strategy for empty entries
This allows, for example, to imeplement the tag `master_fill_policy`
and simplify the client layouts by not having to hardcode empty
columns and rows in each layouts.
2017-06-26 02:27:20 -04:00
Emmanuel Lepage Vallée ba78882cb3 Merge pull request #1834 from Elv13/fix_896
layoutbox: Use a textbox as the fallback when no images are found
2017-06-21 03:16:28 -04:00
Emmanuel Lepage Vallée 1f8b07d475 debug: Add a signal for deprecation warnings (#1832)
Fixes #1612.
2017-06-21 02:06:32 +02:00
Emmanuel Lepage Vallee 10acd82968 layoutbox: Use a textbox as the fallback when no images are found
Fix #896
2017-06-20 18:22:23 -04:00
Emmanuel Lepage Vallée 983fd4710f Merge pull request #1854 from Elv13/fix_1849
notification: Fix `font` and use `beautiful` directly
2017-06-20 05:19:52 -04:00
Emmanuel Lepage Vallée 8c926027c4 Merge pull request #1859 from psychon/beautiful_newindex
Make beautiful.foo = bar work properly
2017-06-20 04:20:45 -04:00
Emmanuel Lepage Vallée cded8b0837 Merge pull request #1857 from psychon/awful_tag_new
Fix #1853
2017-06-20 04:20:06 -04: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 20d15b8be6 awful.tag.new: Handle too few given layouts
When awful.tag.new() got a list of layouts shorter than the list of
names, it would previously create tags with nil as their layout. This
commit changes this so that the first layout is repeated if necessary.

Related-to: https://github.com/awesomeWM/awesome/issues/1853
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 09:44:02 +02:00
Uli Schlachter de05ee6678 awful.layout: Apply layouts in a protected context
If an error occurs while a layout is being applied, arrange_lock could
get stuck at true, meaning that no more re-arranges will happen, thus
breaking the whole layout machinery.

Such errors could happen because the layout itself produces an error,
but also because a width is too large and c:geometry() throws an error.
Thus, this commit moves all of the actual "apply a layout"-code into a
protected context.

Fixes: https://github.com/awesomeWM/awesome/issues/1853
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 09:41:59 +02:00
Emmanuel Lepage Vallee 0829cc2d76 notification: Fix `font` and use `beautiful` directly
Using `beautiful.get()` has the drawback of not supporting theme
variables set from `rc.lua`. It is also used less often than
direct theme access, making it a bit inconsistent with how other
modules behave.
2017-06-19 19:52:00 -04:00
Tim Roes f8a9b9891d Add missing awful.widget.common require (#1850) 2017-06-15 18:47:48 +02:00
SammysHP 44dbb24570 Fix documentation of activation filter
Previously the `force` hint was described incorrectly.
2017-06-14 11:34:56 +02:00
Emmanuel Lepage Vallée 2192e61f89 Merge pull request #1846 from psychon/menubar-no-icon-theme
menubar.icon_theme: Never use nil as icon theme name
2017-06-14 05:27:16 -04:00
Uli Schlachter f0368c21c5 menubar.icon_theme: Never use nil as icon theme name
The return value for this function is used as an index in a table and
Lua does not like nil as an index.

The function that actually looks for icons, find_icon_theme() already
falls back to "hicolor" if it does not find anything via the current
theme, so fix this issue by just falling back to "hicolor" here as well.

Fixes: https://github.com/awesomeWM/awesome/issues/1819
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-14 11:10:22 +02:00
SammysHP ed230af953 Fix documentation 2017-06-14 10:42:50 +02:00
Uli Schlachter ddc51cf38c Port lgi-check.sh to C
Previously, the lgi check used the normal Lua interpreter to check if
lgi is installed. However, nothing ensures/requires that awesome is
built against the same Lua version as the Lua interpreter. This means
that if lgi is only available for some Lua version, then the check could
succeed even though awesome would later fail to start. Also, the check
might have failed even though awesome would not have any problems
finding lgi.

This commit replaces lgi-check.sh by a small C program which does the
same thing. This ensures that the same Lua version is used as awesome
will be using.

There are some places that still use the Lua interpreter: Example tests
(run through the Lua interpreter directly) and unit tests (run through
busted). For unit tests, this should not make much of a difference and
example tests might later get similar treatment.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-13 15:47:07 +02:00
Yauhen Kirylau c5e830cd60 fix(awful: hotkeys_popup: keys): require all modules in init.lua 2017-06-12 20:39:46 -04:00
Uli Schlachter bcc3de469e Fix menubar under Lua 5.1 (#1838)
LGI's async support was trying to yield inside a protected call. Lua 5.1
cannot do that. Work around this by reverting to the behaviour before
commit 50cfa6c: Only call the callback in a protected context.

Fixes: https://github.com/awesomeWM/awesome/issues/1837
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-13 01:59:30 +02:00
Emmanuel Lepage Vallée ef1d7d8396 Merge pull request #1647 from Elv13/free_layout
Add a manual (free floating) layout
2017-06-12 19:49:30 -04:00
nahsi d368cee8aa hotkeys-popup: tmux hotkeys
Closes https://github.com/awesomeWM/awesome/pull/1830.
2017-06-12 23:03:43 +02:00
getzze 39efa6bbf9 awful: Add a calendar popup widget 2017-06-12 02:58:06 -04:00
getzze 5b0abb9541 widget: Add a calendar widget 2017-06-12 02:58:06 -04:00
Emmanuel Lepage Vallée 410e1a9969 Merge pull request #1835 from Elv13/fix_1795
doc: Fix a taglist copy/paste oversaw
2017-06-11 17:20:22 -04:00
Emmanuel Lepage Vallee 212cb84782 doc: Fix a taglist copy/paste oversaw
Fix #1795
2017-06-11 01:23:36 -04:00
Emmanuel Lepage Vallee 5d46d47ef7 wibox.layout: Add a `manual` layout.
A layout with manual widget positions. It is still useful as it is
manager by the hierarchy and widget position can be functions.
2017-06-11 01:14:10 -04:00
Emmanuel Lepage Vallee 1839c4ecaa tag: Save history after the first iteration
Fix #1651
2017-06-10 23:52:13 -04:00
Emmanuel Lepage Vallee 9c77aa58c5 rules: Replace switchtotag implementation with awful.tag.viewmore.
Fix #1493
2017-06-10 23:50:27 -04:00
Simon Désaulniers ffead7dcda hotkeys_popup: keys for qutebrowser (#1829) 2017-06-11 00:10:42 +02:00
Emmanuel Lepage Vallée 7c44b05deb Merge pull request #1825 from psychon/magnifier-relayout
Re-arrange the magnifier layout on focus changes
2017-06-09 05:24:38 -04:00
Emmanuel Lepage Vallée 1a5d9d09fd wibar: Fix with width and height beautiful properties (#1826)
There was code that always set the values. The fallback was never
executed.

Fix #1824
2017-06-09 05:21:49 -04:00
Uli Schlachter 3bb8efd2db Re-arrange the magnifier layout on focus changes
Just re-arranging on every focus change would cause useless/needless
re-arranges (which have no effect except to waste CPU time). Thus, this
adds a special (undocumented) flag on layouts that makes sure that a
rearrange occurs when the focus changes.

Fixes: https://github.com/awesomeWM/awesome/issues/1799
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-09 10:13:14 +02:00
Uli Schlachter 9b991fb40b awful.menu: DPIfy the default menu size
Related-to: https://github.com/awesomeWM/awesome/issues/1807
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-08 17:12:15 +02:00
Caleb Maclennan ffca875633 Add aweful.util.pread() so API docs have deprication notice (#1502)
* Add awful.util.pread() so API docs have deprication notice

* Update util.lua

* Update util.lua

* Update util.lua
2017-06-06 00:55:11 +02:00
Daniel Hahler 105638e920 client: update_implicitly_floating on manage (#1803)
Ref: https://github.com/awesomeWM/awesome/pull/1748#issuecomment-304010490
2017-06-01 21:27:53 +02:00
Uli Schlachter 801a1f0a89 Deprecate widget-drawing functions in gears.surface
This marks the functions gears.surface.widget_to_svg() and
gears.surface.widget_to_surface() as deprecated in awesome 5. This means
that by the time that awesome 6 becomes a thing, we can finally remove
these...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-30 11:22:07 +02:00
Uli Schlachter 6de6419180 Add functions to draw widgets to a cairo surface
These are supposed to eventually replace the already-existing functions
in gears.surface which have a similar signature

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-30 11:22:07 +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 Vallée caff37d867 Merge pull request #1791 from Elv13/impl_1508
beautiful: Save the theme path
2017-05-25 16:40:37 -04:00
Emmanuel Lepage Vallee ac8af66005 beautiful: Save the theme path
Fix #1508
2017-05-25 04:40:45 -04:00
Haochen Tong c1bcad5f5e parse_desktop_file: rtrim lines before parsing (#1677) 2017-05-25 01:22:13 +02:00
BuildTools 37d2654d5d client: emit ewmh geometry requests as signals 2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee 9bc46e4648 client: Honor the client maximization requests again
This implementes the FIXME added a few commits ago. A new
request::geometry handler turns client requests into normal
lua `c.maximized = true` property changes.
2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee b570e6d347 client: Add request::geometry for client maximization
This way the correct logic can be implented in Lua
2017-05-23 22:33:26 +02:00
Benoit de Chezelles be29ee6768 naughty: avoid notification flickering on replace (#1785)
Fixes https://github.com/awesomeWM/awesome/issues/1737.
2017-05-23 15:37:46 +02:00
Emmanuel Lepage Vallée b6e6a04895 Merge pull request #1776 from psychon/emit_property_floating
Always emit property::floating when needed
2017-05-16 13:57:51 -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
Uli Schlachter 40e9393d94 awful.autofocus: Discriminate sticky clients (#1697)
A relatively common problem with awesome is with mixing sticky clients
and the focus history. Once a sticky client ever had the focus, it will
always get the focus after a tag switch. This is because the focus
history is global and the sticky client is always the most recently
focused and currently visible client in the list.

Work around this by discriminating sticky clients: First try to find a
client to focus, but ignore sticky clients. When this does not find
anything, try again, but this time also consider sticky clients.

(Basically the same issue exists with clients that are on multiple tags,
but I guess that one can be ignored.)

Fixes: https://github.com/awesomeWM/awesome/issues/733
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:32:28 +02:00
Uli Schlachter f22a69d54e Fix fullscreen clients with gravity != NorthWest (#1764)
Once upon a time, 4b9584fdb1 already fixed this problem: We have to
set the border width to zero before applying the new geometry to the
client, because changing the border width makes the client move
according to its gravity.

Then came e54387904b and made this code use awful.placement instead
of just fullscreening the client itself (without explaining why in the
commit message!). After this commit, the border width was just ignored
and left as-is. This was then fixed in 0bf8bb6a64 (no idea which
callback the commit message refers to, the old code was basically just
c.border_width=0, c:geometry(screen_geo)). However, now the border width
was again changed after the geometry and the bug that was fixed by
4b9584fdb1 was back.

This commit fixes this regression again by making sure that the border
width is set to zero before the geometry is set. This becomes slightly
more complicated, because now it is also awful.placement's job to
restore the old border width.

This is why this commit adds a new option to awful.placement so that it
sets the border width to zero after creating its memento of the old
border width.

Fixes: https://github.com/awesomeWM/awesome/issues/1607
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:31:14 +02:00
Daniel Hahler 9d1d5d5461 Merge pull request #1762 from psychon/fix-menubar-traversal
Fix menubar traversal
2017-05-13 23:27:13 +02:00
Quentin Minster 155c37e759 Fix single layout not appearing in the keyboardlayout widget (#1771)
Change indexing so that a keyboard map with a single group still gets
displayed in awful's keyboardlayout widget.

Signed-off-by: Quentin Minster <quentin@minster.io>
2017-05-13 23:25:09 +02:00
Emmanuel Lepage Vallee 0df1586f10 menu: Check if the client is still valid before accessing props
Fix #1777
2017-05-11 12:47:06 -04:00
Uli Schlachter e1bad41fc8 Always emit property::floating when needed
There are some cases where a client's floating state "silently" changes.
For example, a fullscreen client will be considered floating. However,
even though c.floating changes its value in this case, we did not emit
the property::floating signal.

Fix this by explicitly tracking the "implicitly floating" state. When
some property that influences this "implicitly floating" state changes,
we update it and if a client which was not explicitly assigned a
floating state observes a change in this value, property::floating is
emitted.

This was tested by running a terminal and two xeyes in a tag with a
tiling layout where awful.ewmh was patched so that clients do not change
their geometry when fullscreening or maximizing. It was observable that
after this patch e.g. the titlebar and the tasklist update to show the
floating state of the client which became implicitly floating due to
being maximized.

Fixes: https://github.com/awesomeWM/awesome/issues/1662
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-11 16:22:16 +02:00
Thomas G 5e431d2fb1 Update notification size in `naughty.replace_text` (#1756)
Fixes #1707
2017-05-07 18:01:35 +02:00
Uli Schlachter 0dbe8a344d menubar.utils: Fix for invalid utf8 file names
The previous commit made this code handle invalid directories correctly.
However, it was still possible that we come across invalid file names
for which :get_path() returns nil and then we assumed this was a file
name.

Fix this by silently ignoring such files.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:26:17 +02:00
Uli Schlachter f958b6a023 menubar.utils: Don't switch between path and GFile
Before this commit, the code always used GFile instances, then used
get_path() for a recursive call and turned the path into a GFile
instance again. This is not only inefficient, but also causes issues
with directories with invalid utf8, because the get_path function
returns nil in this case.

Fix this by keeping things as a GFile all the time.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:23:05 +02:00
Uli Schlachter 50cfa6c111 Run menubar.utils.parse_dir in protected context
Fixes: https://github.com/awesomeWM/awesome/issues/1761
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:19:19 +02:00
Emmanuel Lepage Vallee 74bb34ff00 wallpaper: Turn asserts into warning
Regression in v4.1. It causes the `rc.lua` (and the fallback) to
exit when the wallpaper is missing or something went wrong.

In <= 4.0, the wallpaper wasn't loaded, but Awesome didn't "crash".

There should be no asserts in the code called during the first
event loop iteration.
2017-04-24 03:10:03 -04:00
Matt ddf9689767 Add timezone option for textclock widget (#1743)
Adds a third parameter "timezone" to the textclock widget that is
optional. Defaults to local timezone if nil.

Signed-off-by: Matt Harrison <matt@harrison.us.com>
2017-04-21 16:34:23 +02:00
Tim Roes 993ffef666 Add the ignore_suspend flag to naughty (#1729)
Possible use-case could be a do-not-disturb mode where notifications
should be suspended, but some notifications triggered directly by
a user interaction (e.g. change of keyboard layout, etc.) should
still be shown.

Fixes: https://github.com/awesomeWM/awesome/issues/1728
2017-04-20 22:31:17 +02:00
Daniel Hahler 46f8ad4250 Merge pull request #1693 from getzze/new_widget
Improve doc for creating new widget
2017-04-19 00:26:55 +02:00
Daniel Hahler f533d0bfd8 doc: fix filesystem.make_parent_directories (#1739) 2017-04-18 15:40:57 +02:00
getzze 59662bc971 wibox.widget.base: do not call set_children if children is nil 2017-04-18 15:00:39 +02:00
Daniel Hahler e0eb0f14b3 Merge pull request #1699 from psychon/cache-dirs
Some fixes and changes to cache dirs
2017-04-18 14:40:22 +02:00
paul-axe d3e113f997 naughty: fix offset calculation for *_middle position (#1727) 2017-04-15 22:08:35 +02:00
Daniel Hahler a87387d9f3 doc fixes for awful.mouse.resize, awful.rules, awful.util (#1717) 2017-04-10 21:57:12 +02:00
Uli Schlachter 4d0c9eb86e Rename filesystem.mkdir to make_directories
The longer name is a bit more self-explanatory. The plural is meant to
indicate that this recursively creates missing parent directories and
does not just try to create the single given target directory.

Since filesystem.mkdir() is part of the v4.1 release, a deprecation stub
is needed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:20:50 +02:00
Uli Schlachter 87e69e8677 Add a header to hotkeys_popup.keys.firefox to make LDoc happy
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:18:07 +02:00
Uli Schlachter f8678d39a4 Fix parameters docs in awful.hotkeys_popup.widget
This fixes broken API docs introduced in commit c183588ba1.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:15:03 +02:00
Uli Schlachter f1b78a6ff2 menubar: assert() that io.open() succeeds
Improves-the-error-for: https://github.com/awesomeWM/awesome/issues/1663
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:02:01 +02:00
Uli Schlachter 48c15e4dfb g.fs.get_cache_dir: Ensure the dir exists
This makes get_cache_dir() try to ensure the cache directory that it
returns exists.

Should-fix: https://github.com/awesomeWM/awesome/issues/1663
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:02:01 +02:00
Uli Schlachter 4bbedebea4 awful.prompt: Use g.filesystem.make_parent_dir()
The changes should not actually make a difference. If creating the
directory fails, the error will now be different, but that should be
about it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:02:01 +02:00
Uli Schlachter b4b070785f Add gears.filesystem.make_parent_dir(path)
Given a path, this function tries to recursively create parent
directories.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:02:01 +02:00
Uli Schlachter dc717af3ad gears.filesystem: Convert tabs to spaces
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:00:28 +02:00
axujen 8e70b71c9c Fix imagebox:set_image not returning anything
set_image should always return true or false according to the docs
2017-04-06 19:33:14 +01:00
Jonathan c183588ba1 Allow to add group rules to hotkeys_popup default instance 2017-04-03 17:49:50 +02:00
Emmanuel Lepage Vallée 63f78c29a4 Merge pull request #1688 from getzze/deprec_menubar
Remove deprecated function call
2017-04-02 21:45:06 -04:00
Uli Schlachter e1b4f17e64 awful.ewmh.add_activate_filter: Fix doc example
I didn't actually test this, but at least this now looks like valid Lua
code to me, so this is definitely an improvement.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-02 18:20:48 +02:00
Kevin Zander 74fb39afbd Remove deprecated calls in tests
Change deprecated util.table call in lib/awful/widget/clienticon.lua to gears.table call
2017-03-30 23:07:20 -05:00
Kevin Zander 6cb2e0fa82 Fix some deprecated calls in code and docs
Add missing newline in test runner
2017-03-30 21:26:50 -05:00
getzze 26b2065c40 Remove deprecated function call 2017-03-31 00:25:04 +01:00
Emmanuel Lepage Vallee 686abd174f Merge branch 'xdg' 2017-03-26 21:04:27 -04:00
Uli Schlachter 3bda88ff64 Remove obsolete entries from check_for_invalid_requires.lua (#1673)
Most of the entries that are marked as "TODO: Get rid of these" were
handled. wibox.layout.align:get_children() never worked (it always
called a non-existent function), so we can easily fix this entry without
introducing a regression.

I opened https://github.com/awesomeWM/awesome/issues/1672 to track the
underlying problem behind the broken :get_children() function (which is
missing test coverage).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-26 15:20:18 -04:00
FireFish5000 ffda3b0c4c Add null check to set imagebox to blank state 2017-03-25 00:07:55 -05:00
romildo ea2c9deb68 menubar: consider XDG_HOME_DIR and XDG_DATA_DIRS
The freedesktop specifications let desktop files be stored in
different directories indicated by the environment variables
XDG_DATA_HOME and XDG_DATA_DIRS.

Only use the default value for these variables if the variables are
not defined.

This is important for systmes like NixOS which does not follow the LFS
and installs files differently.
2017-03-20 20:20:36 -04:00
romildo 62edc5a200 Add get_xdg_data_home and get_xdg_data_dirs functions to gears.filesystem 2017-03-20 20:20:36 -04:00