Commit Graph

850 Commits

Author SHA1 Message Date
Julien Danjou 87ce51d2e9 naughty: remove score system, merge presets
Scoring is broken, it's more useful to merge all presets, and declares that
order matters.
2011-12-27 11:24:01 +01:00
Corey Thompson cacba79d49 Initialize floating_geometry on property::border_width signal (FS#826)
Initializing the client property "floating_geometry" on the
property::geometry signal is problematic since this is emitted before
client_set_border_width(), causing the internal client geometry to get
stored and later passed to client:geometry() which assumes it includes
titlebar and borders.

Signed-off-by: Corey Thompson <cmtptr@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-09 22:02:45 +01:00
Corey Thompson 7013b9bb70 Bump duplicated commands to the most recent in command prompt history
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 20:51:45 +01:00
Uli Schlachter d3021e6772 Beautiful: Handle invalid wallpaper_cmd better (FS#941)
Biggest plus is that this no longer errors out when wallpaper_cmd isn't a table.
Second biggest plus is that this now prints a warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-27 11:16:47 +01:00
Perry Hargrave 4155303b8b Check wallpaper_cmd entries are valid (FS#938)
wallpaper.is_valid(tw):
    Checks that the table has only string entries.

Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-10 19:42:47 +01:00
Perry Hargrave adbc736b8a Prevent util.cycle from infinite loop (FS#938)
If the first argument to cycle must be > 1 or else return nil
immediately.

Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-10 19:42:38 +01:00
Majic 3636b884d3 Private naughty.getIcon() -> public awful.util.geticonpath()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-01 19:45:12 +01:00
Massimiliano Brocchini bb3fc70fb3 search in prompt history
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-25 13:02:52 +02:00
Massimiliano Brocchini bf8e6418f5 no duplicate entries in prompt history
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-23 17:57:44 +02:00
David Palacio 8fd3182869 Ignore desktop clients on taglist widget
Make the taglist widget skip unstickied and focused desktop clients
for status update by:
 * Ignoring focused client if it is of desktop type
 * Returning a list of clients from tag.clients without clients
   of desktop type.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 20:22:31 +02:00
Julien Danjou ddf8f096bf naughty: fix image data copy
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-10-04 15:23:11 +02:00
Anurag Priyam 49774897a4 naughty: add helper function, toggle() - suspend/resume notifications
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-24 19:30:59 +02:00
Perry Hargrave 99a16e6467 Update tasklist when client screen changes
This handles corner case where a client has no tags (e.g. stickied), but
is moved across screens.

Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-08 18:18:38 +02:00
Perry Hargrave 187cf6d917 movetoscreen:Dont refocus the selected client
Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-08 18:18:38 +02:00
Perry Hargrave a23817718e FS#917: Dont move clients with fixed positions
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-03 10:05:49 +02:00
Perry Hargrave 7c3fb9edb7 awful.client.jumpto: View urgent clients smarter
Only do a tag.viewonly() if the urgent client is not visible.

Further, if the boolean 'merge' parameter is true [default false], then
to a tag.viewmore() with all the currently visible tags.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 15:14:34 +02:00
Uli Schlachter 30b0f1c654 Fix a minor typos
Thanks to anrxc for noticing the graph one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-07 16:05:05 +02:00
Radu Andries ff8b45b77a naughty: escape title too
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-01 15:22:03 +02:00
Uli Schlachter 941658735d awful.autofocus: Also react on "tagged" signal (FS#883)
Apparently some people start a timer, switch to an empty tag and then let the
timer move a client to that empty tag. This change makes sure that this new
client will get the input focus in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-16 16:02:15 +02:00
Julien Danjou 6c6e3a22f8 awful.rules: fix typo in example
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-03-29 09:37:17 +02:00
Anurag Priyam 55f5ba6911 rules: allow defining exceptions to a rule - except, and except_any
So you want to make all Firefox windows floating except the main window
(instance = Navigator). You can either list all possible windows in
rules and make them floating, or make all of them floating except one:

{ rule = { class = "Firefox" },
  except = { instance = "Navigator" },
  properties = {floating = true},
}

More examples in the docs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-29 09:26:18 +02:00
Gregor Best 44b8549770 awful.mouse: fix interclient border snapping
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 12:26:42 +02:00
Gregor Best 35a5a74744 awful.mouse: fix client snapping
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-21 07:38:53 +01:00
Andres Freund 3f40feb3c4 Correct typo in awful.client.restore
This corrects a type in awful.client.restore which caused it not to restore any
client at all  if all clients are minimized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-02 18:54:39 +01:00
Uli Schlachter b2e2959be8 awful.placement.no_overlap: Honor original position
awful.placement.no_overlap caused clients on an otherwise empty desktop to stich
to the top-left corner of the screen because it always preferred the top-left
corner of the available space.

This commit doesn't change the way in which the available area is computed, but
instead this now tries to keep the client at its original position if that is
available.

This fixes cases where calling awful.placement.no_overlap as a callback from an
awful.rule rule didn't work because the manage signal in the default config
later overrode that via calling awful.placement.no_overlap.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-01 17:55:56 +01:00
Uli Schlachter 2963a32d44 Add awful.client.restore()
This restores the first minimized client it finds on the selected tags.

Optionally, this function accepts a screen number as its first argument.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 22:28:36 +01:00
Uli Schlachter 64bb0bea08 tasklist: Update when a c.minimized changes
This fixes a bug where the tasklist would still show its old content after a
client was minimized/unminized because it didn't connect to the appropriate
signal.

This wasn't noticed before, because in most cases minimizing a client also
unfocuses this client which causes a tasklist update.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 22:28:14 +01:00
Uli Schlachter f6907e1296 awful.client.floating.toggle: Fix for dialogs
awful.client.floating.get() does some sensible defaults. E.g. dialogs are
floating by default. Since floating.toggle only checked the property, these
defaults made it break.

So floating.toggle() should use floating.get to decide if a given client is
floating. It should also use "false" instead of "nil" when the client is made
non-floating or else the default will apply again.

Thanks to vsp for making me figure this out. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 23:05:44 +01:00
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