Commit Graph

822 Commits

Author SHA1 Message Date
André Aparício 3dd4cc3226 Fix default naughty preset for dbus notifications
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-03 18:07:52 +01:00
jpike 3eb12cdf00 Add naughty.config.notify_callback
This optional callback can be used for filtering and/or editing
notifications.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-28 21:05:01 +01:00
Uli Schlachter 23ff7a8414 Don't focus a different screen on unmanage (FS#850)
When some client on the left monitor was closed while client.focus is on the
right monitor (e.g. 'sleep 5 ; exit' in a terminal), awful.autofocus would shift
the input focus to whatever client happened to be next in the focus history on
the left monitor.

Fix this by only ever moving the input focus between screens when a tag is
selected, not when some client does its magic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-27 22:27:53 +01:00
Anurag Priyam b805492c2a add usage example for awful.menu
Added a very simple example to show the usage, and applicability of
awful.menu by dynamically constructing a menu of clients that match a
particular rule.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Anurag Priyam 41ba50fde2 fix minor grammar, and typo in awful.menu.new's documentation
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Anurag Priyam 9c3731c782 add markup to awful.menu.new's documentation
Display the possible keys to the 'menu' params as a bullet list
(unreadable otherwise).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Uli Schlachter 90f0939bee Make awful.client.idx public
The luadoc API documentation already contained this function and it seems to be
useful for user configs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-03 14:18:58 +01:00
Uli Schlachter 95403b9544 awful.client.setwfact: Handle invisible clients (FS#693)
setwfact() calls idx() on the client that it works on. When idx() is called with
a client that isn't visible, it fails while trying to find outs the client's
index in the current layout.

  event_handle_mousegrabber:119: error running function:
    lib/awful/client.lua:688: attempt to compare nil with number

Fix this by ignoring all clients that aren't visible in setwfact().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-11 14:23:31 +01:00
Radu Andries 35286d5ecc Improve naughty's dbus interface
Evil spec from galago project.
image_data should be read too as in http://www.galago-project.org/specs/notification/0.9/x344.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-10 17:20:51 +01:00
Julien Danjou b0e8024e47 awful.prompt: add ctrl-backspace
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-21 09:05:55 +02:00
Julien Danjou 8805a99f73 awful.tag: do not update history when identical tags
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-20 17:30:48 +02:00
Julien Danjou f37d9f5c7c awful.tag: remove useless line
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-20 17:00:10 +02:00
Stjujsckij Nickolaj b4cc392e23 Remove last known usage of deprecated in Lua 5.1 `arg`
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-12 18:37:54 +02:00
Stjujsckij Nickolaj 7ef7fe7e03 awful.titlebar: Stop using arg
Implementing vararg functions via arg is deprecated in lua. This kind of thing
should instead be done via "...".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-12 18:37:54 +02:00
Uli Schlachter f9c2fcacb2 awful.util.join: Stop using arg
Implementing vararg functions via arg is deprecated in lua. This kind of thing
should instead be done via "...".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 17:13:51 +02:00
koniu 02cd1cbda3 awful.completion: callback functions return table of matches
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 15:23:06 +02:00
koniu 595b344156 awful.prompt: add 'autoexec' argument
If set the prompt will execute the command upon completion which returns
only one match.

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 15:23:06 +02:00
Uli Schlachter 9e79d18747 Tasklist: Fail less badly with invalid utf8
xterm is famous for messing up the utf8 in its title (unless correctly
configured).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-07 18:42:05 +02:00
Gregor Best e6b99ae374 naughty: localize obj
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-09-19 20:16:55 +02:00
Uli Schlachter 222fb4c9c5 Fix a "table expected instead of nil" error
It seems like with lots of bad luck, the garbage collector manages to "steal"
the table with the buttons right after we decided to use it. Evil collector!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 20:23:36 +02:00
Uli Schlachter 9114ed1846 {tag,task}list: Use a weak-valued table
The data table is used to map objects (clients/tags) to the buttons associated
with them. This is done so that we don't have to re-create the button objects
each time this lists are updated.

The problem was that this weak-keyed table was never cleared, because the value
had a strong reference to the key (via the button's signal):

btn:connect_signal("press", function () b:emit_signal("press", o) end)

"o" is the key in the table and btn is reachable from the value. This prevented
the garbage collection of the key. Using a weak-keyed and weak-valued table
fixes this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 17:38:40 +02:00
Ignas Anikevicius (gns_ank) 1ee80cd5d0 Add match_any function and rule_any definition for different client matching.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-14 16:51:59 +02:00
Julien Danjou 7e2291ec37 Revert "tag.lua: check name argument to add() is valid"
This reverts commit 4f754a0d41.
2010-09-08 10:17:52 +02:00
Uli Schlachter d56a5abd99 awful.placement.no_overlap: Ignore desktop clients
EWMH describes desktop windows like this:

"_NET_WM_WINDOW_TYPE_DESKTOP indicates a desktop feature. This can include a
single window containing desktop icons with the same dimensions as the screen,
allowing the desktop environment to have full control of the desktop, without
the need for proxying root window clicks."

An example for such a window is nautilus' virtual root window. Naturally, such a
window would always overlap with any given client, so awful.placement.no_overlap
just didn't do anything at all. The fix is to ignore such clients for placement
calculations.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-03 17:47:12 +02:00
immerrr e5d4ff6147 awful.prompt: insert selection at cursor position
Signed-off-by: immerrr <immerrr@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-31 13:50:38 +02:00
Uli Schlachter 36b639801b awful.placement: Fix a mis-calculation
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 21:15:01 +02:00
Uli Schlachter 26d97d0273 awful.prompt: "Fix" for multi-byte characters
If you entered a multi-byte character into a prompt and then changed your mind
and used backspace to fix the character, only the last byte of the character was
removed. Because pango is intelligent, it noticed the broken utf8 and
complained.

So far nothing new. But since 711d78b50c the textbox will throw a lua error
when it gets an invalid text (= pango complains). Throwing an unprotected lua
error in this context causes the keygrabber to be killed which stops the prompt.

Fix this by removing bytes as long as there are bytes left that can be removed.

This is FS#801.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 21:07:20 +02:00
Uli Schlachter 0e798d0d76 Check "focusable" in awful.client.focus.filter(c)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 13:22:44 +02:00
Uli Schlachter 6f19940020 prompt: Only show error messages
Ever since awesome.spawn() also returns the pid of the started process, the
prompt accidentally displayed the pid of processes that it started.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 14:24:52 +02:00
Uli Schlachter 8d59512ccc Naughty: Handle invalid UTF-8 more sanely
Previously, if setting the textbox's text failed this caused more problems later
on. This commit makes sure that an invalid text never breaks pango.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-06 19:52:46 +02:00
Konstantin Stepanov 457913a0e8 stack graph mode works with max_value
Signed-off-by: Konstantin Stepanov <kstep@p-nut.info>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-05 14:27:41 +02:00
Ignas Anikevicius (gns_ank) 402870687b Functionality for deleting a tag using awful.tag.
tag.delete(t, fb):
    Delete tags if certain criteria are met:
        - There are no clients assigned exclusively to this tag.
        - Stickied clients have somewhere to go, 'fb' the fallback tag

    If after deleting there is no tag selected then try and
    history.restore() or select the first tag on the screen.

    Return true if successful and nil otherwise.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Ignas Anikevicius <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-02 22:06:17 +02:00
Uli Schlachter d45d31ebae awful.placement: Honor border width
While calculating if part of the window is outside the visible region, this code
should also add the border width. (FS#684)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-24 15:31:00 +02:00
Uli Schlachter 5487906487 Naughty: Catch invalid markup in notifications
Previously, an invalid markup caused an empty popup. Since the C core now throws
a lua error on invalid markup, we have a way to notice that something is wrong.

This patch first tries to set the notification's text the same way we did
previously. If that fails, everything is escaped and the result is used as the
text for the notification.

Thanks to farhaven/Gregor Best for the initial version of this and for the
string.gsub() call I stole from him. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-16 19:40:08 +02:00
Uli Schlachter be9eb33230 Update the tasklist when a client's icon changes
Thanks to a pidgin-using friend for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:05:53 +02:00
Uli Schlachter 95a5d3f80e Remove invalid variable usage
There is no variable called "startup" in awful.rules.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:33 +02:00
Julien Danjou dd84d88e0f naughty: return nothing, not nil
This is not a valid return value for a D-Bus method.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 10:38:34 +02:00
Julien Danjou 9445701655 Fix missing tostring
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-01 11:42:52 +02:00
Perry Hargrave 4f754a0d41 tag.lua: check name argument to add() is valid
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-01 10:31:18 +02:00
Perry Hargrave 5b86896c90 tag.lua: add() create tags with full table of properties
tag.add(name, props):
    make tags and pass a table of properties to apply to it

tag.new:
    modified to use add() instead of calling capi.tag

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:21:02 +02:00
Perry Hargrave 14fd8fadb5 tag.lua: getidx() returns index of tag
tag.getidx(t):
    Return the index of 't' in the screen[]:tags() table. Return 'nil'
    if 't' is not found.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:08:44 +02:00
Perry Hargrave 6362a90825 tag.lua: move() re-index tags
tag.move(i, t):
    move tag 't', or tag.selected(), to index 'i' in the current
    screen's tags table.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:05:11 +02:00
Uli Schlachter 1e3409f461 awful.menu.clients: Raise the newly focused client
Raising it makes it more obvious that the focus was really changed and makes
working with the client easier since it's, well, raised.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-03 11:03:47 +02:00
Andrei 'Garoth' Thorp b205854de1 docs: progressbar.lua.in missing a dash to prevent luadoc generation
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-03 11:02:31 +02:00
Sergey Mironov b08b815685 awful.menu: Add menu position argument
Patch allows user to define menu position in pixels when
showing menu in keyboard-driven mode.
Note: Patch changes signature of show() and toggle() functions.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-04-14 09:38:51 +02:00
Yves Frederix 3e3c26c019 awful.menu: add item_enter in access key handling
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-04-12 10:05:55 +02:00
Sergey Mironov 0179eb3d9b awful.menu: Fix menu hide/show overloading
Fixes bug that prevents calling user-defined menu methods

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-04-12 10:05:10 +02:00
Adrian C. (anrxc) dc5b09d3b0 awful.widget: add graph stack property
Initial implementation of stacked graphs. Adds two new methods,
set_stack (false by default) and set_stack_colors (i.e. {"red",
"white", "blue"}). The order of the colors matters, because the
add_value method now accepts an (optional) last argument, an index of
a color from your stack color group.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-29 17:39:16 +02:00
Adrian C. (anrxc) a68185647a awful.wibox: update struts on align()
Setting width or height (horizontal or vertical) to an arbitrary value
causes the wibox not to be stretched. Instead the align() function is
called, which might not modify any wibox property in many situations,
or none when align parameter was not provided by the user. The major
side effect is that wibox struts were never updated and clients
covered the wibox (until a first signal handler caused struts to be
updated).

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-23 11:06:37 +01:00
Adrian C. (anrxc) 463b76d42a awful.widget: add progressbar ticks property
Second implementation of the progressbar ticks. Adds set_ticks,
set_ticks_gap and set_ticks_size methods. Default gap is 1, size 4 in
respect to the default progressbar width of 100px.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-23 10:57:33 +01:00