Commit Graph

991 Commits

Author SHA1 Message Date
Anurag Priyam 1e4bf83d3b awful.menu: always enable keyboard navigation
I don't see why people would not want keyboard-enabled-menu by default.
Without it, you can't even use 'Escape' to quit the menu or press 'Enter' to
execute an entry.  But instead of just enabling keyboard support by default, we
remove the option of disabling keyboard support altogether, which also
simplifies the implementation a bit.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-01 17:03:47 +01:00
Anurag Priyam 69a96fc505 gears.color: call the correct creator function in local string_pattern function
The corresponding pattern factory that `string_pattern` delegates to is stored
in the `creator` parameter, and not `v`; probably a typo.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-29 20:58:01 +01:00
Uli Schlachter efee293dd2 wibox: Allow tables as color specification
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-17 17:50:31 +01:00
Uli Schlachter 2216b6a341 gears.color: Add table-based color definitions
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-17 17:48:11 +01:00
Anurag Priyam 0d41d98468 add awful.client.cycle
add awful.client.cycle to iterate through clients that match a given condition

A common use case is to cycle through clients that match a given rule and take
certain action on them: raise, set or get property, etc.; see usage example in
the docs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-17 16:20:31 +01:00
Anurag Priyam 740ec07033 add awful.util.table.cycle
add awful.util.table.cycle to iterate through elements that match given
condition

This will help writing concise code when one wants to apply a function to
(read, take some action) on a select list of elements in a table (of say,
clients and tags).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-17 16:17:45 +01:00
Arvydas Sidorenko e052bd99b0 oocairo.image_surface_create_from_png TO awesome.load_image
Replaced all references to image_surface_create_from_png to
awesome.load_image

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-29 16:18:18 +01:00
Anurag Priyam c6e92081e2 awful.placement: can now operate on any object with a set geometry
So the utility of `awful.placement` is not merely limited to client objects,
but also to wiboxes.

[us: use appropriate naming convention; catch misplaced statement]

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-15 18:04:19 +01:00
Anurag Priyam 7f8ef18cd8 awful.screen: define getbycoord() to compute screen number of a pixel
Given an object's coordinates, `awful.screen.getbycoord` can be used to
determine the screen than the object is, or should be attached to.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-15 16:52:19 +01:00
Anurag Priyam 9793ec0b71 do not set non existent, screen property on wiboxes
The `screen` property on wibox (drawin) was removed in the commit - 'drawin:
Remove screen property'.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-15 16:52:12 +01:00
Anurag Priyam 54a9ecbd27 gears.color docs: replace literal '<' and '>' with respective HTML entities
Luadoc confuses '<stop>' with an HTML tag otherwise.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:07:52 +01:00
Anurag Priyam d3e8dfed2b gears.colors() docs: fix pattern string used in the example
In general, patterns are specified as 'type:arguments', where 'arguments' is
specific to the pattern used.  The example provided in the documentation,
defined the pattern type to be 'linear', but used arguments meant to create
radial pattern.  So we modify the example to use the correct type -- 'radial'.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:07:52 +01:00
Anurag Priyam 765db33757 gears.color: expose documentation for create_(linear|radial)_pattern functions
The documentation for these functions were hidden (intentionally?) from luadoc
because of misspelt @class and @name tags. Fixed the spelling, so luadoc can do
its job.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:07:52 +01:00
Anurag Priyam 902db9a73d tasklist: indicate sticky clients with a solid square as the default
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:07:52 +01:00
Anurag Priyam 6121db9a13 tasklist: allow 'symbols' used to mark certain client properties to be themed
Symbols (or, visual hints) used to indicate that a client is: 'ontop' or
'floating' or 'maximized_horizontal' or 'maximized_vertical', can now be
defined in the theme, or passed to awful.widget.tasklist() as the last, 'style'
argument (see docs).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:07:52 +01:00
Axel Beckert 4d69dba412 awful.tag.inc*: properly pass tag parameter to set*
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-01-11 10:42:11 +01:00
Anurag Priyam ba7f7c4488 awful.tooltip docs: replace references to undefined variable 'K' with 'myclock'
Most probably, the original author chose to use 'K' first, switched to
'myclock' later, and forgot to update remaining occurrences of 'K'.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-10 15:02:35 +01:00
Uli Schlachter 6f61bde6f2 wibox.widget.base.make_widget: Remove outdated cruft
This never should have ended up in git. AFAIR :size() was replaced by :fit()
long, long ago.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-04 17:11:06 +01:00
Julien Danjou f2872190d5 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:35 +01:00
Uli Schlachter 20cafb4851 drawin: Remove bg_color property
The default background color (None) means that the server will leave the
window's content untouched when an exposure happens. This should get rid of all
cases of "flashing window".

The real background will later be drawn while awesome is handling the expose
event.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-23 16:54:55 +01:00
Uli Schlachter e38c52349a awful.menu: Place submenus on the correct height
Before this commit, a submenu was border_width pixels lower than its parent menu
entry. Fix this by not adding the border_width to the submenu's position.

We still have to add the border_width to the parent menu's width so that the
border of the submenu entry doesn't overlap the content of its parent menu (the
borders of the two menus do overlap!).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-15 21:28:58 +01:00
Corey Thompson 8c62698bf6 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:03:10 +01:00
Corey Thompson 47238fe6cf Bump duplicated commands to the most recent in command prompt history
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 20:51:48 +01:00
Perry Hargrave c3174f4581 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:43:17 +01:00
Majic 75ad861c7a Private naughty.getIcon() -> public awful.util.geticonpath()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-01 19:45:17 +01:00
Massimiliano Brocchini 6b8357989e 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:58 +02:00
Massimiliano Brocchini 48e2f41e3b 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:51 +02:00
Uli Schlachter d8f0bd13bf textbox: Actually tell pango which space we have (FS#933)
In the textbox' draw() callback we forgot to set the pango layout's width and
height. Whoops.

This was tested with the following code which makes it visible when the textbox
draws outside of its assigned space:

local w = wibox({ screen = 1 })
w.y = 10
w.x = 10
w.width = 150
w.height = 150
w.visible = true

local wi = wibox.widget.base.make_widget()
local t = wibox.widget.textbox()
t:set_markup("Foo <b>bar</b> <i>Foobar</i> und so weiter")

wi.draw = function(d, wibox, cr, width, height)
	cr:move_to(24.5, 0)
	cr:line_to(24.5, 150)
	cr:move_to(0, 24.5)
	cr:line_to(150, 24.5)
	cr:move_to(124.5, 0)
	cr:line_to(124.5, 150)
	cr:move_to(0, 124.5)
	cr:line_to(150, 124.5)
	cr:set_line_width(1)
	cr:stroke()

	cr:translate(25, 25)
	t.draw(t, wibox, cr, 100, 100)
end
w:set_widget(wi)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-19 19:05:25 +02:00
Ignas Anikevicius (gns_ank) 0b689058f3 Adding {fg,bg}_normal to prevent text overlapping
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-19 17:23:09 +02:00
Uli Schlachter ed022e6764 tag.withcurrent(): Also tag sticky clients (FS#934)
Tagging sticky clients shouldn't hurt anything, but it helps a lot if the client
later becomes unsticky. I'd have no tags in that case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-19 16:34:15 +02:00
Julien Danjou c1d0dee20d naughty: fix image data copy
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-10-04 15:23:27 +02:00
Uli Schlachter 7a6d49999a ta{g,sk}list: Cache widgets again
Instead of re-creating all the widgets for the list entries on each update, this
code now caches its widgets again and only creates new widgets when a new
client/tag appears.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 13:55:59 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Uli Schlachter ff646a361a Where's my brown paper bag?
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-08 08:21:36 +02:00
Uli Schlachter f3f01b82d9 naughty: Fix replaces_id
Replacing a popup only worked when it wasn't the newest notification we had. Fix
this to also work if no new notification showed up in between.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-07 21:41:47 +02:00
Uli Schlachter 5accf0014b textbox: Cause less memory allocations
Instead of creating a pango layout all the time (e.g. twice per redraw), we now
only create a single layout which we keep around all the time and update as
needed. Hopefully this helps a little.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-07 21:41:32 +02:00
Anurag Priyam d9e4c1e866 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:31:18 +02:00
Perry Hargrave f882477269 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:23:02 +02:00
Perry Hargrave 11487b84f0 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:23:02 +02:00
Perry Hargrave 45576b6c6f FS#917: Dont move clients with fixed positions
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-03 10:06:29 +02:00
dodo d0a33a38a7 aweful.menu: unicode submenu icon
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-18 20:25:31 +02:00
Perry Hargrave c606bc36a8 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:38 +02:00
Uli Schlachter bc116c6ef1 Fix two minor typos
Thanks to anrxc for noticing the graph one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-07 16:04:04 +02:00
dodo a1941efc9c awful.menu: Callable submenu item
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-02 19:27:07 +02:00
Radu Andries 97709a4b3e naughty: escape title too
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-01 15:20:56 +02:00
Uli Schlachter 82921ef57b Correctly position wiboxes (FS#892)
Let's just quote the bug report:

A regression was introduced in commit f5a5af4001
which causes wiboxes to position themselves incorrectly on Xinerama screens
besides the first one. In lib/awful/wibox.lua.in line 49, function
set_position(), the screen number used to use wibox.screen but now just defaults
to 1. Since the screen parameter is never actually passed to set_position(),
that means that wiboxes will always use screen 1's geometry when determining the
proper position. So, if a different screen is larger or smaller or isn't aligned
with the primary screen, the wibox will either be offscreen or not on the edge.

This should be fixed by explicitly passing the right screen argument to all
functions which need it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-30 17:13:56 +02:00
Uli Schlachter 14504de220 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:00:35 +02:00
Uli Schlachter d436b2845c beautiful: Use weak references for tracking fonts
There is no point in keeping this font cache alive for longer than needed.
Letting lua garbage-collect fonts should provide sane cache-behavior in that we
forgot about the font once no one uses it anymore.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-14 22:40:56 +02:00
dodo b530da1861 add set_font to wibox.widget.textbox
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-14 22:37:44 +02:00
Uli Schlachter 9f8af0ae6d awful.wibox: Fix some flickering
The menu was first made visible and then placed correctly. This caused a short,
black flicker in the top, left corner of the screen.

Fix this by removing a too early "visible = true".

This was introduced by me in 4d280365ad, sorry.

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