Commit Graph

3031 Commits

Author SHA1 Message Date
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
romildo d22207386f Add map function to gears.table 2017-03-20 20:20:36 -04:00
romildo 894c254c42 Add string split function to gears.string 2017-03-20 20:20:36 -04:00
Emmanuel Lepage Vallée 7818fd3dba Merge pull request #1666 from awesomeWM/doc_tag_signal
doc: Add 2 missing tag singals
2017-03-19 17:21:42 -04:00
Emmanuel Lepage Vallée 9aa801cc97 doc: Add 2 missing tag singals 2017-03-19 16:28:38 -04:00
Emmanuel Lepage Vallée 32341b1091 doc: find_by_name: Fix the doc
Swap the parameters the next time the API break / deprecation season is open.

This is indeed confusing, as reported on IRC. The screen is *not* optional,
`awful.tag.find_by_name(name)` wont work
2017-03-19 16:06:22 -04:00
Uli Schlachter 3f2bcfdb97 Fix misuse of @deprecated tag
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-18 10:43:55 +01:00
Emmanuel Lepage Vallée b73f9e963c Merge pull request #1613 from SammysHP/spawn-cursor
Add beautiful property to control busy cursor during spawn
2017-03-17 15:15:19 -04:00
Emmanuel Lepage Vallée 2c30991579 Merge pull request #1620 from psychon/menubar-remove-get2
Deprecate menubar.get()
2017-03-16 16:40:23 -04:00
Kevin Zander 7687275607 Move awful.util.deprecate and awful.util.deprecate_class to gears.debug
Change all awful.util function calls to gears.debug function calls
Update all old deprecate calls to have deprecated_in=4
2017-03-15 20:08:22 -05:00
Kevin Zander 45dadde0dd Move filesystem functions out of awful.util into new gears.filesystem
Update awful.util filesystem function calls to gears.filesystem function calls
Rename getdir to get_dir for consistency
2017-03-15 13:46:33 -05:00
Lego Stax 7c775e967c Fix 'no such file' errors for icons (#1655)
Fixes https://github.com/awesomeWM/awesome/issues/1650.

Signed-off-by: Lego Stax legostax@gmail.com
2017-03-15 17:29:53 +01:00
Patrick Uven 008bd185ba Add scale factor to gears.wallpaper.centered (#1653) 2017-03-14 20:53:27 +01:00
Emmanuel Lepage Vallee 05717026b7 menubar: Fix a typo in the code
Find/replace error when porting the deprecated code

Regression from 2f105eac86
Fix #1652
See #1072
2017-03-13 03:40:41 -04:00
Emmanuel Lepage Vallée 901df65eb0 Merge pull request #1629 from psychon/geometry_spec
Some small-ish work on gears.geometry
2017-03-12 15:45:00 -04:00
Emmanuel Lepage Vallée 957966d636 Merge pull request #1646 from psychon/systray_removal
Partly fix removal of systray from a wibox
2017-03-12 15:43:40 -04:00
Uli Schlachter 2a57d944ba gears.geometry: Fix rectangle intersection computation
Previously, when gears.geometry.rectangle.get_intersection() was called
with two non-intersecting rectangles, it would return a negative
width/height.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-12 17:01:45 +01:00
Luke Bonham d3b8088c1b ldoc: fixes in lib/gears/color.lua and objects/client.c 2017-03-12 11:45:41 +01:00
Emmanuel Lepage Vallée 4a42ed0d44 Merge pull request #1636 from psychon/client-icons2
Add support for multiple client icons
2017-03-11 18:59:09 -05:00
Kevin Zander 2f105eac86 Move string functions out of awful.util into new gears.string (#1584)
Update deprecated awful.util string function calls to gears.string calls
2017-03-11 18:57:32 -05:00
Uli Schlachter 64b964972b systray: Enable properties and improve documentation
I spent way too much time trying to figure out why setting "visible" to
false did not work...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:46:40 +01:00
Uli Schlachter 13dbc558fc wibox.hierarchy: Only count "really visible" widgets
Widgets with width or height zero cannot really be counted as visible,
so do not do so.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:44:56 +01:00
Uli Schlachter 51e4a47938 Partly fix removal of systray from a wibox
This commit changes the systray widget, wibox.drawable and the C code to
fix the following bug: When the systray widget is removed from a
drawable without being moved somewhere else, the systray stayed visible.
This was because the systray is not drawn by awesome, but only placed.
When the widget is no longer "drawn", it stays wherever it was placed
last.

This change works by detecting the situation when the systray is
removed. Then, the C code is specifically told to remove the systray
window from the drawable.

Note that this is only a partial fix. This change works correctly when
the widget is removed completely, because it is no longer placed by its
parent widget. However, for example, when you do
wibox.widget.systray().visible = false, the effect is just that the
systray widget gets size 0x0. This is not really visible, but as far as
this change is concerned, the widget is still part of the drawable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:14:38 +01:00
Uli Schlachter e1fe1de98f wibox.hierarchy: Add ability to count widgets
This adds new code so that we can count how often a specific widget is
visible inside of all widget hierarchies.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 13:55:57 +01:00
Christoph Mertz 2d91d49b30 awful.screen.focus_bydirecttion: fix setting screen focus (#1635)
This was broken in 9cb60b8 in PR #1597 (from myself).

focus() is not defined on the screen instance as method
but on the screen module as function.

Signed-off-by: Christoph Mertz <chris@nimel.de>

Fix #1644
2017-03-09 00:07:35 -05:00
Kevin Zander 0066257a59 Move ensure_pango_color out of awful.util into gears.color
Update deprecated awful.util.ensure_pango_color calls to gears.color.ensure_pango_color calls
2017-03-08 15:28:48 -06:00
0x041E caf90887a7 doc: Fix arcchart documentation (#1643) 2017-03-08 16:05:23 -05:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00
Emmanuel Lepage Vallée d3ca6aa301 Merge pull request #1637 from psychon/deprecation_warnings
Fix some deprecation warnings
2017-03-07 18:43:32 -05:00
Uli Schlachter 73944dac00 Add awful.widget.clienticon
This adds a new widget that displays the icon of a client. This widget
tries to use the best fitting of the available icons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-07 22:45:49 +01:00
Jan Larres 862bfbf795 menubar: add trailing slash with $XDG_DATA_HOME (#1631)
The $XDG_DATA_HOME environment variable may not necessarily end in a
slash, so insert it when generating the list of all menu dirs to make
sure the directory can be found.
2017-03-06 22:58:09 +01:00
Uli Schlachter 675b05ff34 fixup! Fix code using awful.util.round 2017-03-06 17:28:31 +01:00
Uli Schlachter dde71265c5 fixup! Fix code using awful.util.cycle 2017-03-06 17:28:08 +01:00
Uli Schlachter ad113fa3aa Fix code using awful.util.cycle
This gets rid of lots of deprecation warnings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:15:40 +01:00
Uli Schlachter 6f803cf3b3 Fix code using awful.util.round
This gets rid of lots of deprecation warnings

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:11:05 +01:00
Kevin Zander ad3782b08a Fix typo in awful.tag.setmwfact 2017-03-05 18:04:33 -06:00
actionless e0f9245abc fix(awful: hotkeys_popup: vim): fix hotkeys for scroll line up/down 2017-03-05 22:01:11 +01:00
Christoph Mertz 9cb60b8130 awful.screen: extract screen:get_next_in_direction() (#1597)
This extracts the code for finding the next screen
from focus_bydirection to a separate method on
the screen object.

The main reason was to use the finding code without
actually changing the screen focus but this should
incidentally make the code slightly easier to test
as well since both concerns can be tested in
isolation.

Signed-off-by: Christoph Mertz <chris@nimel.de>
2017-03-04 22:16:15 -05:00
Emmanuel Lepage Vallée 2b88c92d52 Merge pull request #1604 from Lawful-Lazy/master
Add naughty presets `ok`, `warn` and `info`.
2017-03-04 22:14:35 -05:00
Emmanuel Lepage Vallée dacf22aae7 Merge pull request #1618 from legostax/master
Added _hover & _click to client buttons
2017-03-04 22:13:21 -05:00
getzze 9a3cdab534 Add grid layout
Remove dependency to awful and remove get_cell_sizes function

Remove matrix and add superpose property

Update documentation, remove beautiful dep

Add insert, extend and remove columns and rows

Change x and y to horizontal and vertical
2017-03-04 20:57:33 -05:00
Emmanuel Lepage Vallée 971adec0d0 Merge pull request #1622 from Veratil/fix-new-luacheck
Fix Luacheck 0.19.0 release Travis breaks
2017-03-04 13:32:53 -05:00
Daniel Hahler 0bd29ae1e9 Merge pull request #1580 from psychon/only_on_screen
Add a only_on_screen container widget
2017-03-04 04:06:21 +01:00
Kevin Zander 3f6df8ddee Fix Luacheck 0.19.0 release Travis breaks 2017-03-03 16:41:12 -06:00
Uli Schlachter 232c5a014a menubar.show(): Remove duplicate call to menubar.refresh()
This changes a line of code that was added in the previous commit.
Previously, when menubar.cache_entries was set to false,
menubar.refresh() was called twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 18:46:55 +01:00
Uli Schlachter 67b12579d9 Deprecate menubar.get()
The function seems useless and its documentation is wrong. It does not
return a wibox, but a widget. Also, the widget cannot really be used on
its own since it depends on the size of the wibox.

So menubar.get() and its wrapper through the metatable __call should
just be removed. Until then, the needed initialisation code is moved
around a bit and the function is deprecated.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 18:45:47 +01:00
Uli Schlachter 2b2612314c Add a only_on_screen container widget
Fixes: https://github.com/awesomeWM/awesome/issues/1565
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 13:25:28 +01:00
Kevin Zander d8f57e4997 Move math functions out of awful.util into new gears.math 2017-03-02 18:15:59 -06:00
Lego Stax cb311a5d61 Updated to comply 2017-03-02 16:01:22 -07:00
Lego Stax 8ffe4460d0 Added _hover & _click to client buttons
Every client button type (e.g. minimize, maximize_inactive, maximize_active, close) has the option to show a different icon when the mouse hovers over it or a "button::press" signal is sent.
Signed-off-by: Lego Stax legostax@gmail.com
2017-03-02 14:49:14 -07:00
Kevin Zander edd9415df6 Add a deprecated_in variable to util.deprecate args table (#1586) 2017-03-01 23:02:49 +01:00
SammysHP 2f0d0e37da Add beautiful property to control busy cursor during spawn 2017-03-01 21:57:59 +01:00
Emmanuel Lepage Vallée 2f34e69cab Merge pull request #1605 from legostax/master
Added disable_task_name property
2017-03-01 14:42:38 -05:00
Emmanuel Lepage Vallée ef668bc028 ewmh.tag: Fix the transient_for clients without parent client tags (#1610)
ewmh.tag: Fix the transient_for clients without parent client tags

Fix #1594
2017-03-01 14:11:38 -05:00
Daniel Hahler 04b73db722 Merge pull request #1601 from psychon/improvements-thanks-to-Unode
Improvements on wibox.container.scroll thanks to Unode
2017-02-28 19:58:28 +01:00
Emmanuel Lepage Vallée 3b0269d5e9 Merge pull request #1600 from Drauthius/master
Corrected selected check in awful.tag.set_screen()
2017-02-27 16:48:08 -05:00
Emmanuel Lepage Vallee 4e161d4a0a doc: Fix the variable names
It was still wrong
2017-02-27 16:20:47 -05:00
Emmanuel Lepage Vallee f24e957c17 doc: Fix wibar documentation
I got it wrong in the PR that introduced the beautiful variables.

Too much find&replace...
2017-02-27 16:12:37 -05:00
Emmanuel Lepage Vallée 8210b11ab0 wibar: Add beautiful variables (#1602)
* wibar: Add beautiful variables

This was done a few weeks ago for the notifications. This was
requested on IRC a while ago to have different font for the wibars.

Now that shapes are supported, it also makes more sense for the
border.
2017-02-26 15:56:09 -05:00
Lego Stax b54cf0330b Added disable_task_name property
style.disable_task_name and beautiful.tasklist_disable_task_name.  Suppresses display of a given client's name, but preserves the setting of tasklist_plain_task_name
2017-02-25 17:21:36 -07:00
Samuel Hunter 97287596e2 Add naughty presets `ok`, `warn` and `info`. 2017-02-25 13:20:53 -08:00
Uli Schlachter d8a272d2dd wibox.container.scroll: Also mention some caveats
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 17:05:33 +01:00
Uli Schlachter 3b40954223 wibox.container.scroll: Add a description
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:56:51 +01:00
Uli Schlachter 6fb40a196f wibox.container.scroll: Add a usage example
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:51:03 +01:00
Uli Schlachter 3d12ba3b65 Fix wibox.container.scroll's property magic
Creating a widget already sets a metatable (at least these days).
However, wibox.container.scroll overwrote this metatable with its own
metatable. This commit removes this overwrite.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:42:27 +01:00
Drauthius 28709c282e Corrected selected check in awful.tag.set_screen()
Previously it would check if the awful.tag.selected function existed,
and not whether the tag was actually selected.
2017-02-25 16:07:36 +01:00
Lego Stax bc728a5f46 doc: Update fixed.lua (#1591) 2017-02-21 22:03:21 -05:00
Emmanuel Lepage Vallée 94311913bb Merge pull request #1579 from psychon/gears-wallpaper-improvements
Gears wallpaper improvements
2017-02-21 13:31:45 -05:00
morethanoneanimal 1c71260389 Replace improperly used asserts with warnings.
Add awful.spawn noop function to hooks.lua test. Previously it was nil.
2017-02-21 00:31:33 +01:00
Uli Schlachter 4efee3c3d6 gears.wallpaper: Check for cairo errors
This makes things fail loudly which otherwise fail without giving a hint
on what went wrong.

Reference: https://github.com/awesomeWM/awesome/issues/1570
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-19 14:10:26 +01:00
Uli Schlachter 4fc396ec57 gears.wallpaper: Only finish own surfaces
If the caller provides a file name, these function load the image, set
it as the wallpaper and make sure that the memory used for the image
data is freed immediately. However, this was also done when the caller
provided a cairo surface, thus breaking their surface.

Fix the code so that it does not finish surfaces that it did not create
itself.

Fixes: https://github.com/awesomeWM/awesome/issues/1570
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-19 14:10:05 +01:00
Daniel Hahler a4b06bca58 awful.prompt.run: improve deprecation warnings (#1577) 2017-02-18 19:39:19 +01:00
Daniel Hahler bd02ee8558 minor: code style and comment fixes 2017-02-16 10:40:54 +01:00
Daniel Hahler 52011a68e1 util.deprecate_class: use raw=true always (#1564)
Fixes

> W: awful: function margin is deprecated, see wibox.layout.margin has been renamed to wibox.container.margin.

to

> W: wibox.layout.margin has been renamed to wibox.container.margin.
2017-02-15 19:45:23 +01:00
copycat-killer ad72d204c9 menubar.init: menulist_update doc fixed 2017-02-15 12:38:46 +01:00
Emmanuel Lepage Vallee a158c3adab wibar: Fix a race condition when adding new wibars
Fix #1523
2017-02-13 21:01:13 -05:00
Emmanuel Lepage Vallée 77c92d0d63 Merge pull request #1536 from jmccrohan/naughty_icon_urldecode
naughty: urldecode icon URI file
2017-02-12 20:25:09 -05:00
actionless 09a678345c feat(naughty: core): add shape configuration; expose options to beautiful 2017-02-12 22:37:31 +01:00
Emmanuel Lepage Vallée 6d00d34b41 Merge pull request #1557 from Elv13/add_place_container
Add place container
2017-02-12 13:23:39 -05:00
actionless f8d12a855f feat(awful: widget: promptbox): accepts `fg` and `bg` as arguments; improve docstring 2017-02-12 17:59:19 +01:00
Emmanuel Lepage Vallee 1e50f7b376 container: Add an placement container.
It should be called "align", but the name is already taken

It doesn't use awful.placement because it would break the dependency
graph.

Some cases previously required 2 wibox.layout.align layouts,
one for each axis. This is massively overkill to simply place
a widget at the center of a larger area.
2017-02-11 16:10:13 -05:00
actionless 20c132fa38 feat(menubar): cache count_table reading 2017-02-11 16:58:57 +01:00
actionless 0089b5d7c7 refactor(menubar): simplify file handling for count_table 2017-02-11 16:58:57 +01:00
actionless 978889e739 fix(menubar): close count_file after opening
closes #1548
2017-02-11 16:58:57 +01:00
Yauhen Kirylau 439d0c804c fix(menubar): reset search query when menubar closes (#1553)
* fix(menubar): reset search query when menubar closes

* refactor(menubar): remove redundant argument for menulist_update()
2017-02-11 01:16:57 +01:00
Yauhen Kirylau 148723f053 refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget (#1533)
* refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget

closes #1352
closes #1497

* doc(awful: hotkeys_popup): add @beautiful docstrings

* fix(awful: hotkeys_popup): add label_bg for misc labels; improve @beautiful docstrings
2017-02-10 19:50:10 +01:00