Commit Graph

5874 Commits

Author SHA1 Message Date
Arvydas Sidorenko db0d23606d Portable way to replace standards Lua funcs
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 11:03:26 +02:00
Arvydas Sidorenko d612b922f3 lua_objlen wrapped in luaA_rawlen
In lua 5.2 lua_objlen was renamed for now reason

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 11:02:57 +02:00
Arvydas Sidorenko 47e21ad3cc Wrapped lua_[gs]etfenv into luaA_[gs]etuservalue
Lua 5.2 removed lua_[gs]etfenv and introduced
lua_[gs]etuservalue. Not sure though if it provides
the required functionality which awesome is using.
Thus, need some testing.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 11:02:34 +02:00
Arvydas Sidorenko 172d000679 Changed all luaL_typerror to luaA_typerror 2012-06-12 10:57:29 +02:00
Arvydas Sidorenko f2942a994d luaL_typerror -> luaA_typerror
Lua 5.2 removed luaL_typerror leaving to write our own version
if need it.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:56:19 +02:00
Arvydas Sidorenko a77dc54f87 Unnecessary #define's to static inline functions
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:54:08 +02:00
Arvydas Sidorenko d61cdb86c9 Renamed luaL_reg to luaL_Reg
The original struct name is luaL_Reg, but Lua v5.1 had a
`typedef luaL_reg luaL_Reg`, which in v5.2 was removed
and as a result breaking the build in Awesome which uses luaL_reg
version exclusively.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:52:10 +02:00
Julien Danjou ec5ef67404 Remove PREFIX, use CMAKE_INSTALL_PREFIX
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-06-11 14:47:13 +02:00
Sébastien Luttringer c27ce1e833 Get keygrabber running state
Add a function keygrabber.isrunning() which return a boolean state of
keygrabber

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-06-06 17:28:58 +02:00
Sébastien Luttringer f9e3bc8a7a Get mousegrabber running state
Add a function mousegrabber.isrunning() which return a boolean state of
mousegrabber

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-06-06 10:42:14 +02:00
Uli Schlachter d0f3e399d7 Fix naughty notifications again
When something sends notifications which don't get mapped into some preset,
args.preset would be nil and indexing nil throws a lua error. Fix this by using
the default preset in that case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 17:44:30 +02:00
Uli Schlachter ca2fc7811a gears.surface: Add a version check for lgi
The cairo bindings are quite new in lgi and thus we depend on a quite new
version of lgi. Older versions will fail with lots of weird errors, e.g.:

lib/gears/color.lua:61:attempt to call field 'create_rgba' (a nil value)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 16:22:04 +02:00
Uli Schlachter ab7788e2f5 Fix naughty notifications
Commit d14d6959ea caused every notify() call to fail with 'attempt to
compare number with nil' because the default_preset table no longer exists.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 16:20:30 +02:00
Giuseppe Bilotta 2ec6635adc geticon: also accept a size parameter
Many themes have prerendered icons of different sizes stored in
subdirectories named as '<size>x<size>'. By looking in these directories
when a specific icon size is specified, we can support themes in a
rather straightforward way.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 15:25:07 +02:00
Giuseppe Bilotta d14d6959ea naughty.notify: inherit from default preset
Build the preset values by merging the default preset with the one
actually specified, falling back to the normal preset if no preset is
specified.

This allows changing the position/font/whatever of all notification by
only setting up the default preset value (modulo overrides in the other
presets), instead of having to manually set it in all presets.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 15:24:24 +02:00
Thomas Moschny 982ac6f8c1 Desktop file fixes.
- Remove an extra space after the group header.
- Add required key 'Type'.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-05 15:23:10 +02:00
Uli Schlachter e57af377bb Don't pass cairo surfaces around on the lua stack
Now that the C code uses lightuserdata for passing around cairo surfaces, they
are no longer automatically garbage collected. To avoid memleaks, this commit
compares the C code to use cairo_surface_t pointers instead of the lua stack.

This also fixes a memleak were a client's icon was leaked.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-28 09:29:47 +02:00
Uli Schlachter 68d630c32a Remove a pango hack
Instead of creating unused cairo image surfaces, we create our temporary layouts
now via the (PangoCairo) font map. Way less ugly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-27 20:17:14 +02:00
Uli Schlachter 4f30dfd198 Switch from oocairo to lgi.cairo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-27 19:20:34 +02:00
Arvydas Sidorenko 758c4d4972 Splashes aren't all that special (placement-wise)
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-25 15:28:32 +02:00
Edward O'Callaghan 3ba9eabd86 Add platform support for DragonflyBSD.
Simply adds a define required for awesomewm to work on the BSDs.

Signed-off-by: Edward O'Callaghan <eocallaghan@auroraux.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-20 22:46:34 +02:00
Uli Schlachter 7c7ceb1444 event: Properly ignore the "send event" flag
Thanks to muni who managed to crash his WM with conky. When conky runs in its
own window, clicking on it will sometimes (depending on the conkyrc) use
XSendEvent() to forward the event to the WM.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-19 20:20:46 +02:00
Ignas Anikevicius (gns_ank) 224bc63ab2 Menubar: document keybindings, some luadoc fixes.
This adds the documentation about keybindings for luadoc.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-18 12:52:29 +02:00
dodo 634d54298e new wibox.layout.mirror
this allows to mirror a widget vertical and/or horizontal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-18 12:09:32 +02:00
Uli Schlachter 3cbb59b0dc FS#996: awful.ewmh: Connect to property::border_width signal
For example, I have some lua code which sets the border width based on the
number of visible clients. When just a single client is visible, the border
width is 0, else it's what the theme says.

Previously, this caused visible "glitches" for fullscreen'd and maximized
clients. This patch fixes that and updates the client's geometry and
border width appropriately.

This has a slight chance of going into an endless loop if someone sets a
fullscreen'd clients border width from its property::border_width signal.
Just don't do that!

Thanks to Arvydas Sidorenko for finding this issue.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-16 23:03:32 +02:00
Felix Bier 4170c77a08 Return condition value instead of conditional true/false
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-13 10:49:10 +02:00
Felix Bier bd0c9f75ae Return condition value instead of conditional true/false
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-13 10:49:10 +02:00
Felix Bier 558bc96099 Return condition value instead of conditional true/false
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-13 10:49:09 +02:00
Felix 1a91fd64b9 Return condition value instead of conditional true/false
Patterns like

if condition then
  return true
else
  return false
end

could be simplified to

return condition

Signed-off-by: Felix <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-12 10:38:38 +02:00
Ignas Anikevicius (gns_ank) 887b110f5d Menubar: Shorten the prompt to just run
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 17:13:40 +02:00
Ignas Anikevicius (gns_ank) 6b16d19c9b Menubar: Add navigation and execution keybindings.
This adds more navigation keybindings ('Home' and 'End'), which select
the first and the last entry from the list respectively. Also, it adds
two more keybindings:

    'Ctrl+Enter'        - Run the query (no need to press End and then
            Enter)

    'Ctrl+Alt+Enter'    - Run query in the terminal (sometimes there are
            terminal applications which one wants to run, e.g. ncmpcpp)

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 17:13:40 +02:00
Alexander Yakushev 91ab7e7e71 menubar: Properly stop the keygrabber
After some recent keygrabber changes the menubar's application
execution was broken. This commit fixes it.

Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 17:05:21 +02:00
Arvydas Sidorenko 3986409e70 Improved ZSH completion (#535)
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 17:01:59 +02:00
Ignas Anikevicius (gns_ank) 1730d4f1ea Menubar: Add shell completion to menubar
Since we can search for commands in menubar and easily execute almost
any program now, we can definitely make use of awful.shell.completion,
which is enabled with this commit.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:55:19 +02:00
Ignas Anikevicius (gns_ank) b246e87b1a Menubar: 'Exec: ' item addition to the end.
This adds a 'Exec: <your-cmd-here>' item to the end of the list,
which appears only if there is at least one application entry in
the list. This is useful, when the program is not in the list of menubar
entries (e.g. it does not have a .desktop file).

When there is are no matching application entries, the 'Exec: ' item is
silently removed, as we already have the same in the prompt.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:54:31 +02:00
Anurag Priyam 9dfe4fe84b wibox.set_bg: remove historical cruft
Should ideally have been removed in commit 'drawin: Remove bg_color property'.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:53:04 +02:00
Anurag Priyam ceb6eb311d wibox: assume a default background and foreground color if none passed
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:53:04 +02:00
Uli Schlachter 95d46f2e32 Fix a typo in commit fa1ca8070
In commit "awful.client.setslave: Fix for not-visible clients", I copied some
code from awful.client.visible(). However, I missed that I where supposed to
change something in the code that I had copied. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:52:00 +02:00
Uli Schlachter f252746e86 Fix a harmless compiler warning
objects/client.c:678:1: warning: no previous prototype for ‘client_set_hidden’

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 12:13:08 +02:00
Anurag Priyam c654cfd8d2 unset hidden state when a client regains focus
This should be the expected behavior, imo.  Otherwise the client doesn't appear
in tasklist regardless of being focussed.

[Thanks Uli][1] :).

[1]: http://thread.gmane.org/gmane.comp.window-managers.awesome.devel/7096

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 12:09:39 +02:00
Uli Schlachter fa1ca80705 awful.client.setslave: Fix for not-visible clients
Previously, setslave() put a client only at the end of the list of visible
clients. Obviously this means that it didn't do anything helpful if the target
client was not visible.

Fix this by iterating over all clients on the target screen instead of just the
visible ones.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:04:51 +02:00
Ignas Anikevicius (gns_ank) d121d94366 Menubar: Match for command names as well.
Enabling matching the command name of the menubar entries with the
query, which improves the flexibility of the widget. The functionality
works as follows:

You want to run GIMP, which has a name of "GNU Image Manipulation
Program". Previously by typing in gimp one would have <no matches>, but
now it will match GIMP entry.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 09:50:06 +02:00
Ignas Anikevicius (gns_ank) 6809f6afcf Menubar: Cleanup the environment grabbing
All of the capi should be in a capi table. This make the code more
consistent. Also, it is not worth importing awful.prompt as a different
variable as it is used only once. Calling it awful.prompt make the code
clearer as there are other variables called prompt.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 09:49:56 +02:00
dodo 3901369410 no keygrabber in menubar needed
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-01 14:09:11 +02:00
dodo 200a5272fa use awful.keygrabber in awful.prompt
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-01 14:09:11 +02:00
dodo ac5af147f0 use awful.keygrabber in awful.menu
this makes the use of cur_menu obsolete because now every menu and submenu gets its own keygrabber. there is no need anymore to track the latest opened menu globaly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-01 14:09:11 +02:00
dodo 56c15da307 awful.keygrabber: capi.keygrabber stack
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-01 14:09:10 +02:00
dodo 97040eb91d common/version.c: show lua release & version
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-04-23 17:39:29 +02:00
Alexander Yakushev 394bacacea gears.debug: Print plain non-table values in dump_raw
dump_raw function wasn't printing the plain (non-table) value if the
tag was not specified.

Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-20 22:40:31 +02:00
Uli Schlachter f7aa4b5969 Use ARGB visuals by default again (FS#837)
My intel driver no longer is broken with ARGB visuals, so let's enable this by
default again. Let's see how long it takes for someone else to hit a broken
driver and complain. :-)

This reverts commit c7da695e10.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-11 20:17:52 +02:00