This new function spawns a program, similarly to awful.spawn, but captures its
output. On each line of output on stdout / stderr, a Lua function is called with
this line. There are different callbacks for stdout and stderr. When both stdout
and stderr are closed, another callback function is called. The intention for
this last callback is "the program is done", because most programs should only
close their output when they exit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows the "label" callback to adjust the textbox itself.
`tasklist_label` is changed to make use of it and supports new style
arguments: `font_focus`, `font_urgent` and `font_minimized`.
Closes https://github.com/awesomeWM/awesome/pull/313.
The tooltip might be partly outside of the screen, and especially the
workarea, e.g. for tooltips on the tasklist.
Calling `awful.placement.no_offscreen` makes sure that it is fully
inside, and will even restrict it to the workarea, not only to the screen.
Closes https://github.com/awesomeWM/awesome/pull/409.
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.
Signed-off-by: Uli Schlachter <psychon@znc.in>
I'm working on something that adds :layout functions to widgets. This clashes
with the keyboardlayout widget's use of an entry with this name. This change
adds an underscore as a prefix to the private data members of the
keyboardlayout.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Because of `placement.under_mouse` (and without
`placement.no_offscreen` fixing it), this will cause the tooltip to hide
immediately again.
There is no need for hooking into this signal, but this adds a click
handler to close the tooltip when clicking into it.
This splits the logic for `delay_show` out of `show`/`hide`, and handles
an already stopped timer. The timer gets also stopped after the tooltip
has been displayed.
Ref: https://github.com/awesomeWM/awesome/issues/371.
Use `beautiful.xresources.apply_dpi` for `common.list_update`'s textbox
margins, and add a left margin for the imagebox, too.
The latter is useful/nicer with the default behavior of an inverted
style for the focused tasklist entry.
18f6ab1 changed the behavior when resizing floating clients using the
mouse (via modkey + RMB).
Previously, you could initiate the mousegrabber using e.g. "modkey +
RMB", release the key and button, and resize the window using the left
mouse button.
This restores this behavior by canceling the mousegrabbers only if the
cursor was moved, without _any_ mouse button being pressed.
Fixes https://github.com/awesomeWM/awesome/issues/309.
Closes https://github.com/awesomeWM/awesome/pull/310.
Instead of `client.client`, the client object is now referred to as
`client.object` and the client class as `client.class`.
This moves the documentation of `client.focus` to the class.
Closes https://github.com/awesomeWM/awesome/pull/349.
This adds a `stacked` boolean argument to `awful.client.visible`, and
(relevant) callers of it.
This can be used with e.g. `awful.client.swap.bydirection` to swap clients
based on their stacking order.
Fixes https://github.com/awesomeWM/awesome/issues/178.
When windows are set as "above", they will basically behave as "ontop"
(under normal circumstances) and therefore an indicator is useful to get
displayed in that case, too.
Closes https://github.com/awesomeWM/awesome/pull/325.
color_strip_alpha was used to insert colors into Pango markup, but it
did not correctly check for valid Pango colors. ensure_pango_color
checks if the color is valid in Pango, and returns a placeholder if it
is not.
In ed09d8e this was changed accidentally, while only `request::focus`
should have been changed:
- c:emit_signal('request::activate',"rules")
+ c:emit_signal('request::activate', "rules", false)
Currently `taglist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
Currently `tasklist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
In #152 I've changed the autofocus handler to emit the request::activate
signal, instead of setting client.focus only.
This is wrong IMHO, and can be annoying:
If you have two floating clients above a tiled / maximized one, and
close one of the floating ones, with the tiled one being the one
selected by autofocus, it will be raised above the other floating
client.
This is changed now to use the new `request::focus` signal instead.
This basically reverts 20cdb5d (#152), but allows for customizing this
behavior, by overriding the default `request::focus` handler
(`ewmh.focus`).
It would be nice if there was a helper to check if a window's content
isn't visible at all (i.e. covered by other windows), and that could be
used then by the (new) default handler for request::focus - raising the
client only, if it's completely covered by another window.
Fixes https://github.com/awesomeWM/awesome/issues/217
This still does `client.focus = c` by default, but allows to customize
it.
This was initially suggested in #194, but by using `request::activate`
instead, which would not be the same. Therefore a new signal is being
used instead.
Helped-by: Samir Benmendil <samir.benmendil@gmail.com>
In commit 3cbdc2a79f, the argument order for awful.layout.inc was changed
from (layouts, i, s) to (i, s, layouts), so that layouts can become an optional
parameter. However, this change (obviously) breaks user configs.
To hide this breakage, we assume the old argument order if the number i is a
table. This cannot break anything, since the operator "+" will error out on
tables anyway. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
I doubt that this makes much of a difference since lgi surely caches things, but
this still seems nicer to me.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit 52ec0ebd93, layouts should return the geometries to their caller
instead of setting them directly. The caller will also fix up the geometries for
border width.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds an optional `filter` arg to awful.client.focus.history.get,
and uses `awful.client.focus.filter` from the autofocus module.
This improves the behaviour when manually setting clients as
non-focusable (#237), and is considered to be the desired behaviour in
general.
Closes https://github.com/awesomeWM/awesome/pull/242.
Define @classmod wibox.widget.keyboardlayout, otherwise ldoc fails to
find the base class:
> module(...) name deduction failed: base .../src/build/docs/capi/ .../src/build/lib/awful/widget/keyboardlayout.lua
Fixes https://github.com/awesomeWM/awesome/pull/149#issuecomment-94014438
Widget shows current keyboard layout short name (usually two letters,
for example 'us', 'de'). Indicator will be hidden if only one layout
configured. Layout can be switched either by clicking on widget or by
function keyboardlayout.next_layout()
When moving a fullscreen/maximized client to a smaller screen or with
different Y offset etc, its offset was not handled properly.
This moves it first into the new area, and then makes sure that its not
off-screen. The latter should not happen, because the width/height is
adjusted before.
This is basically an initial stab for some modules and some
experimenting with the `@classmod` directive.
For most of the docs only basic transforming was done.
At the moment the tooltip module looks the best.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
This converts the old documentation style into the new one to use
markdown instead of HTML in bigger doc blocks. Also, we can use block
comments, which means that writting documentation (and indenting code
blocks) easier.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
After a client gets unmanaged, the newly focused client might not be
visible / raised above other windows.
Using the `request::activate` signal makes the autofocus handler more
flexible, and will raise the focused client by default.
This avoids awful.autofocus to kick in, focusing some other client in
between (where a focused signal would get emitted for, although the
intermediate client was never meant to have focus).
This is the traceback:
stack traceback:
/home/user/.config/awesome/cyclefocus/init.lua:199: in function 'add'
/home/user/.config/awesome/cyclefocus/init.lua:309: in function </home/user/.config/awesome/cyclefocus/init.lua:304>
[C]: ?
/usr/local/share/awesome/lib/awful/autofocus.lua:22: in function 'check_focus'
/usr/local/share/awesome/lib/awful/autofocus.lua:31: in function </usr/local/share/awesome/lib/awful/autofocus.lua:28>
[C]: ?
/usr/local/share/awesome/lib/awful/tag.lua:517: in function 'viewonly'
/usr/local/share/awesome/lib/awful/client.lua:69: in function 'jumpto'
/home/user/.config/awesome/rc.lua:1188: in function 'client_run_or_raise'
/home/user/.config/awesome/rc.lua:1217: in function 'run_or_raise'
/home/user/.config/awesome/rc.lua:1243: in function 'press'
/usr/local/share/awesome/lib/awful/key.lua:42: in function </usr/local/share/awesome/lib/awful/key.lua:42>
Ref: https://github.com/awesomeWM/awesome/pull/19
This supersedes https://github.com/awesomeWM/awesome/pull/107.
If a client's width/height is larger than the screen's geometry, align
it at the screen's x/y offset.
Test case with gvim, from a maximized terminal on a floating tag:
% gvim -u NONE -N --cmd "set lines=$((LINES + 5))"
Without this patch the top of the window is off-screen, but the bottom
should be. Fixing it using a number of lines that fit the screen should
display the window completely.
The 'request::activate' signal should be sent and handled immediately,
and not delayed. It was too much of a hack to work around the client
not being visible.
Instead, the "is visible" constraint on `capi.client.focus` will be
removed.
This reverts commit 6963ede3dc.
This gets rid of awful.util.unittest and instead creates an automatic test for
it under spec/awful/util_spec.lua. In the process, it also fixes the test to
actually test the right thing and I took the liberty to add some more tests.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fix two things:
(1) Clients asking to be urgent while focussed, this have been reported
a few time for urxvt and I usually link a patch that fix this. This may
not be considered a bug by some, but I think it is.
(2) Add the ability to stop noisy clients from setting the urgent state
themselves.
When loading persistent properties for a client, the loop value wasn't used,
but the original/requested property. This would only get triggered when
using more than one persistent client property (the default is one,
"floating").
That commit made awful.tag use timer.delayed_call() to call withcurrent() during
the manage signal. The idea was "if nothing else assigns any tags until the end,
apply some default ones".
However, the C core refuses to set the input focus to an unviewable client and
thus this means that setting the input focus during manage failed. So, instead
of using the delayed_call(), just call withcurrent() directly, like we did
before.
However, some part of that commit is still left: Awful.rules no longer
disconnects the withcurrent() callback from the "manage" signal. This was
originally added in commit 5e7ddd1efa, because it clients flickered otherwise if
they were moved to some unselected tag during "manage". This happened because
the C code unbanned the client when it got assigned the input focus and only
later did some other code move it to some unselected tag.
However, this flickering will no longer occur, because commit 3dbf89c990 added
lazy focus setting. Thanks to this, setting the focus no longer unbans a client
as a side-effect. Thus, if you focus a client and then remove it from all
selected tags, nothing will be visible on-screen.
To make a long story short: This commit reverts the part of commit 90fde1393f
which caused side effects. The part that wasn't necessary any more is left in.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This way this function runs after everything else did its job. The client will
only get assigned a tag after everything else had a chance to do so.
Thanks to this, awful.rules no longer has to disconnect the call to withcurrent.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Let's just quote a mail I received from Rastislav Barlik:
I tried to make use of awful.mouse.finder but I found out that it's not working
as supporting functions rounded_corners were removed with commit
03e0ee53d2.
Signed-off-by: Uli Schlachter <psychon@znc.in>
* Move the "index" setting burden to individual functions
instead of gettags().
* Add some properties earlier so the signal hooks will be called
with valid data.
This patch allows 2 things to be done:
* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag
The advantages of the former are clear and simple. Those of the later include:
* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
This function was accidentally setting the global variable "icontypes". Fix this
by adding the needed "local" and also localize some more variables for
consistency.
Signed-off-by: Uli Schlachter <psychon@znc.in>