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>
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>
This commit adds naughty.suspend() and naughy.resume() which allow
suspension of notifications, which is useful e.g. when watching a movie,
where notifications popping up all the time would be disturbing.
While suspended, notifications are collected and displayed after
naughty.resume() is called.
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
This call is required by the freedesktop specification.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2b69d333f8 added some code duplication here. I guess this was a
mis-rebase or something like that. Anyway, the width and height of the wibox is
already calculated right before this code snippet and the existing calculation
is even correct (now that the calculation for a wibox' geometry with
border_width was fixed up).
Tested via notify-send with and without icon.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
No idea where this comes from or why it worked before, but it's obviously wrong.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
Remove an unused var and fix a reference to capi.awesome
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
Makes naughty environment handling same as awful modules:
- relevant capi members all go to local capi = {}
- relevant awful members are all explicitly required
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This makes all parameters available to notify() to be available in
preset table (and vice versa) and simplifies value selection.
Adds new config option: config.default_preset.
Also cleans up some comment redundancy.
Signed-off-by: koniu <gkusnierz@gmail.com>
This commits adds support for :extents() to naughty. It changes the
behaviour of naughty.config.presets.*.width so that if it's set to nil,
the notification gets resized automagically. Else the value of width is
used for the notification's width.
The meaning of naughty.config.presets.*.height changed similarly, now,
if set, it means the literal height of the notifications. If unset, the
notification gets resized automagically as well.
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
- In many places i see people correcting for border width and titlebars.
- This new definition is the equivilant of what used to be fullgeometry.
- The internal geometry is now contained to a few functions that few people ever touch.
- This should avoid confusion and make code easier.
- Also protect against several unsigned overflows.
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
Notifications will not be destroyed on 'run' execution unless the
provided 'run' function explicitly invokes die()/destroy(). For this
purpose run can now receive the notification object as argument.
naughty.notify{ text = 'hi',
run = function(n)
awful.util.spawn('firefox')
n.die()
end
}
Signed-off-by: koniu <gkusnierz@gmail.com>
Adds:
config.icon_dirs {}
config.icon_formats {}
"It adds the ability to search for icons in specified folders. This
is necessary for some applications using dbus like the firefox dbus
plugin."
To test it: naughty.notify{ icon = 'firefox' }
Signed-off-by: Leon Winter <Leon.Winter@informatik.uni-oldenburg.de>
Signed-off-by: koniu <gkusnierz@gmail.com>
Allows Naughty to receive D-Bus notifications and emulate notification-daemon
and such.
Signed-off-by: Leon Winter <leon.winter@informatik.uni-oldenburg.de>
Signed-off-by: koniu <gkusnierz@gmail.com>
* Renamed config.margin to config.padding. Controls spacing between popup and
workarea border.
* Renamed config.gap to config.spacing. Controls spacing between popups.
* Added config.margin. Controls spacing between popup wibox and text.
Signed-off-by: koniu <gkusnierz@gmail.com>
* If icon is present, popup height will now be adjusted to the greater
of text-height and icon-height.
* Reorganized notify() into more logical order to allow this.
Signed-off-by: koniu <gkusnierz@gmail.com>
This removes the C implementation of taglist and tasklist widgets and
use a Lua one.
This works by letting .widgets property of wiboxes to be a table with
table, and setting a special metatable on them which notify awesome on
newindex events, updating wiboxes.
Signed-off-by: Julien Danjou <julien@danjou.info>
Fixes the bug although still relies on index being passed with notification
in notify() and re-set by arrange().
Also box:geometry() in arrange() stopped working with just one argument
so it pushes all coords now.
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>