Commit Graph

6978 Commits

Author SHA1 Message Date
Daniel Hahler f7fcee76df Merge pull request #594 from blueyed/pr-552
Add an optional filter to `awful.menu.clients`
2015-12-12 21:19:32 +01:00
Daniel Hahler 9031a81396 doc fixes to awful.menu.clients 2015-12-12 20:12:08 +01:00
Dario Gjorgjevski c5ad6069d4 Add an optional filter to `awful.menu.clients` 2015-12-12 20:12:08 +01:00
Daniel Hahler ae5d4b5512 Merge pull request #571 from psychon/scrolling_layout
Add a scroll layout
2015-12-12 20:01:32 +01:00
Daniel Hahler 833b10eb9b Merge pull request #593 from psychon/editorconfig
Vim modelines and editorconfig
2015-12-12 19:13:53 +01:00
Daniel Hahler 981987764e Merge pull request #586 from psychon/widget_funcs
Widgets: set_width / set_height
2015-12-12 19:13:28 +01:00
Daniel Hahler 69da6ee0db Merge pull request #576 from psychon/spawn_exit_code
At exit code support to spawn
2015-12-12 19:10:48 +01:00
Uli Schlachter feb7b36728 Add an EditorConfig file
I didn't (and couldn't) actually test this in any way, but hopefully this makes
it easier to edit awesome's source without vim.

Thanks to Daniel Hahler for telling me about this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:48:42 +01:00
Uli Schlachter 63653bed76 Add the right vim modeline to all lua files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:33 +01:00
Uli Schlachter a141370704 Add a vim modeline to all C source
Most of the files already had this, at least.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:16 +01:00
Uli Schlachter 5db6c04c42 Add vim modelines to all shell scripts
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:36:35 +01:00
Uli Schlachter 469433e10a awful.spawn.with_line_callback: Use an arguments table
Having many arguments can easily get confusing and hard to understand. This
commit uses a table instead so that we have names that identify what each
callback does.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:27:33 +01:00
Uli Schlachter 20c9723c5b awful.util: Add getters for themes and icon paths
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-11 18:24:30 +01:00
Uli Schlachter 8953218e5c Use get_cache_dir() instead of getdir("cache") everywhere
Just because I like that function more. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-11 18:16:26 +01:00
Uli Schlachter 5a34f6f047 Add various functions for getting directories
This adds functions for getting directories according to the XDG base dir
specification. This might be useful in general.

This also adds a function for getting the cache dir, because I like an explicit
function call more than something which "switches" based on a string argument.
Better error messages if you mis-type something. :-)

Finally, this adds a function for getting the directory containing the rc.lua
file. Sadly, awful.util.getdir("config") did not actually do that. See #218.

Fixes: https://github.com/awesomeWM/awesome/issues/218
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-11 18:14:41 +01:00
Daniel Hahler e39504a30f Make textbox widget respect the current theme
Without this fix `wibox.widget.textbox` ignores current theme font
setting and resets it to the initial one.
It becomes handy when the initial theme is tweaked during runtime, ie.
in `rc.lua`. Other AwesomeWM components like `awful` (taglist,
tasklist, menu) are aware and do respect the actual theme settings.

Closes https://github.com/awesomeWM/awesome/pull/89.
2015-12-11 00:55:33 +01:00
Uli Schlachter ce965424c3 gears.object:weak_connect_signal: Use a weak-value table (#520)
Lua will remove objects as values from a weak table before these objects are
finalized, but as values only in the next garbage collection cycle after the
object was finalized. Up to now, gears.object uses a table with weak keys so
that :disconnect_signal() works. This means that a signal can still call methods
which were already considered garbage by the garbage collector and thus can use
userdata from the C side which was already finalized. Crashes and other bugs
result.

This commit changes the code so that the function is also a value in the weak
table. Thus, the GC will remove the entry before the object is finalized.

Special magic is needed for Lua 5.1, because there only userdata has the
behavior that we want while we have a function. We do some magic with function
environments to make this work...

Closes https://github.com/awesomeWM/awesome/pull/567.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
Uli Schlachter 0fdecfb2df Add a test case capturing problems with weak_connect_signal (#520)
This adds a cyclic dependency between the function used for the weak signal and
an object with a __gc metamethod. The problem occurs since the GC will first
finalize the object (call its __gc metamethod) and only in the next generation
will it actually collect the garbage and remove the functions from weak-tables
using it as a key.

And yes this needs special code for Lua 5.1 because there __gc doesn't work on
tables. :-(

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
Uli Schlachter 970a92bb51 spec for gears.object: Test weak signals better
Since weak signals specifically exist to do magic with the garbage collector, do
a couple of garbage collection cycles and verify that this does not disconnect
the callback function prematurely (the function is kept alive since it is a
local variable).

(I actually did a mistake that makes this enhanced test fail and fixed it before
committing)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
actionless eb8577a424 feat(lib: menubar): dpi support in menubar
Closes https://github.com/awesomeWM/awesome/pull/580.
2015-12-10 23:18:43 +01:00
Barlik f6d08274a6 Use integer size when creating titlebar
Closes https://github.com/awesomeWM/awesome/pull/584.
2015-12-10 23:13:24 +01:00
Lukáš Hrázký ea94f7f7e6 add an option to set the preferred client icon size
_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
2015-12-07 22:59:32 +01:00
actionless 2d7fc8bc49 feat(beautiful: xresources): read rgb: and argb: prefixed colors 2015-12-07 09:38:22 +01:00
ShadowKyogre 742cbd7122 Call :set_bg for the mouse finder's wibox
Before this, it was trying to assign it to `.bg`, which isn't how
backgrounds are stored on wiboxes.

Closes https://github.com/awesomeWM/awesome/pull/587.
2015-12-06 19:33:13 +01:00
Uli Schlachter f4077def8e Add :set_{width,height} to widgets (#291)
This adds new functions to all widgets that allow to force a specific
width/height. These values override the result from :fit().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-05 12:31:33 +01:00
Uli Schlachter c2be60fb54 wibox.widget.base: Factor out functions available on all widgets
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-05 12:25:25 +01:00
actionless 0516203610 feat(lib: awful: hotkeys_popup): widget to show awesome and third-party keybindings
Closes https://github.com/awesomeWM/awesome/pull/421.
2015-12-02 01:02:15 +01:00
dyslesiq ecf6b55b55 Added value check of required 'Name' entry in .desktop parsing
Closes https://github.com/awesomeWM/awesome/pull/574.
2015-12-01 20:17:21 +01:00
Uli Schlachter 97048de60e Remove useless information from awesome -v
Most of this information isn't interesting. If you are getting awesome from a
distro, then the time, hostname and username of the build are likely 'random
stuff' and if you are building awesome yourself, then the hostname and username
are obviously yours and the time can still be interfered based on the awesome's
binary ctime.

The GCC version shouldn't make any difference at all.

Closes https://github.com/awesomeWM/awesome/pull/566.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-01 20:17:21 +01:00
Daniel Hahler 56e85d45d4 default config: enhance list of default floating clients
Closes https://github.com/awesomeWM/awesome/pull/329
2015-12-01 20:17:21 +01:00
Uli Schlachter c02969bb0e wibox.widget.systray: Also emit redraw_needed
When emitting layout_changed, the widget is relayouted. If this doesn't actually
change anything, nothing will be redrawn. Thus, this also emits redraw_needed to
force redraws.

This fixes a race condition with some weird tray icons. A new tray icon is
created and the systray is updated. Then this new icon is destroyed immediately
again and at the same time another icon is created. Then, the systray isn't
updated since the number of icons (=the layout) did not actually change.
However, it needs to be updated and so we ended up with broken/missing icons.

Fixes: https://github.com/awesomeWM/awesome/issues/487
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 12:33:13 +01:00
Uli Schlachter 2f5ade49c2 test-spawn.lua: Also test exit statuses
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:57:35 +01:00
Uli Schlachter 44a3e27e81 awful.spawn.with_line_callback: Add exit callback
This adds support for the callback that was added in the previous commit to this
function. We can just pass on the function that the caller gives us.

Fixes: https://github.com/awesomeWM/awesome/issues/185
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:56:05 +01:00
Uli Schlachter a8ac146bd0 awesome.spawn: Add exit status support
This adds a new argument to awesome.spawn. This argument is a function that will
be called with the exit status once the spawned process terminates. For normal
exit, the function is called with "exit" and the exit code. If the process is
terminated by a signal, the function will be called with "signal" and the signal
number of the signal that caused termination.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:53:12 +01:00
Uli Schlachter 1c8aa0f5f4 Add a scroll layout
This allows scrolling a widget if there is too few space available. There are
several different modes available for how the scrolling "looks like".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-22 18:19:53 +01:00
Daniel Hahler 58bd21ad79 layout.arrange: fix screen arg in call to tag.getgap
Fixes https://github.com/awesomeWM/awesome/pull/568#issuecomment-158682756.
2015-11-22 00:30:21 +01:00
▟ ▖▟ ▖ 8557a7e0e4 properly flush dbus connection after send 2015-11-21 16:36:02 +01:00
▟ ▖▟ ▖ 33d4100ea0 prevent segfault when dbus signal creation failed 2015-11-21 16:35:52 +01:00
▟ ▖▟ ▖ e8d209fde6 fix typo 2015-11-21 16:35:42 +01:00
Frederik 0d2e6d2068 Get LuaRocks via HTTPS instead of HTTP
[ci skip]

Closes https://github.com/awesomeWM/awesome/pull/570.
2015-11-20 17:17:52 +01:00
Daniel Hahler 269bb90e18 Only use useless_gap with multiple tiled clients
Fixes https://github.com/awesomeWM/awesome/issues/564.
Closes https://github.com/awesomeWM/awesome/pull/568.
2015-11-20 17:17:21 +01:00
Uli Schlachter 6ca85af53b Set WM_CLASS and WM_NAME on all our windows (#551)
The only exception is the window for _NET_SUPPORTING_WM_CHECK. That window
already had a _NET_WM_NAME property before and doesn't get a WM_NAME property in
this commit. I just decided for myself that it doesn't need one. :-)

Right after startup with the default config we now have the following situation:

$ xwininfo -root -tree

xwininfo: Window id: 0x2d7 (the root window) (has no name)

  Root window id: 0x2d7 (the root window) (has no name)
  Parent window id: 0x0 (none)
     7 children:
     0x200011 "Awesome drawin": ("awesome" "awesome")  1500x20+0+0  +0+0
     0x200010 "Awesome drawin": ("awesome" "awesome")  1x1+0+0  +0+0
     0x20000d "Awesome drawin": ("awesome" "awesome")  100x30+0+0  +0+0
     0x20000a "Awesome no input window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200009 "Awesome systray window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200008 "awesome": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200007 "Awesome WM_Sn selection owner window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1

One of those drawin is the awful.wibox. Another drawin is created by awful.menu.
I guess that the third one is created by awful.tooltip, but I'm not sure. Wow,
so many windows...

Closes https://github.com/awesomeWM/awesome/pull/556.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 22:23:25 +01:00
Daniel Hahler c9c60810cc Merge pull request #558 from psychon/xkb-detectable-autorepeat
Xkb detectable autorepeat

Closes https://github.com/awesomeWM/awesome/pull/558.
2015-11-19 22:22:55 +01:00
Uli Schlachter 234100ebdf Fix/silence various ldoc warnings in menubar
Closes https://github.com/awesomeWM/awesome/pull/559.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 22:22:23 +01:00
Daniel Hahler c8e078b1bf doc: fix example with awful.prompt.run hooks
It should return `command` for it to be executed.
2015-11-19 22:14:01 +01:00
Uli Schlachter b7d398f339 awful.widget.tasklist: Use pairs instead of ipairs
This is a weak table whose entries might be removed by the garbage collector.
I'm not sure if this will every cause problems, but it's better to be prepared
for tables having "nil holes" (which would mean ipairs ignores some entries).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 20:13:37 +01:00
Uli Schlachter 7eed74b814 Fix multiple tasklists on the same screen (#563)
The code already tried to handle this correctly, but at some point it used the
wrong variable as the screen number...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 20:11:42 +01:00
Uli Schlachter f7bbcf1263 wibox.drawable: Make screen_getbycoord() local
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-15 19:36:15 +01:00
Daniel Hahler aec751f0ea Merge pull request #483 from blueyed/Elv13-prompt_hook_v2
Prompt hook v2
2015-11-08 15:13:49 +01:00
Daniel Hahler ba0d8e38e5 awful.prompt.run: handle command return value from hooks 2015-11-08 12:33:00 +01:00