Skip to content

Instantly share code, notes, and snippets.

View psychon's full-sized avatar

Uli Schlachter psychon

  • In front of his laptop
View GitHub Profile
@psychon
psychon / debug.patch
Created May 27, 2011 16:36
Add some debug output
diff --git a/Csocket.cpp b/Csocket.cpp
index b2bcf44..e97f734 100644
--- a/Csocket.cpp
+++ b/Csocket.cpp
@@ -53,6 +53,21 @@ namespace Csocket
{
#endif /* _NO_CSOCKET_NS */
+#include <execinfo.h>
+static inline void v6_foo(bool old_val, bool new_val, const char *msg)
@psychon
psychon / debug.patch
Created May 27, 2011 16:38
Add some debug output
diff --git a/Csocket.cpp b/Csocket.cpp
index b2bcf44..3c6640c 100644
--- a/Csocket.cpp
+++ b/Csocket.cpp
@@ -53,6 +53,21 @@ namespace Csocket
{
#endif /* _NO_CSOCKET_NS */
+#include <execinfo.h>
+static inline void v6_foo(bool old_val, bool new_val, const char *msg)
diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in
index f72e9be..fa4ac1f 100644
--- a/lib/awful/client.lua.in
+++ b/lib/awful/client.lua.in
@@ -18,6 +18,7 @@ local capi =
client = client,
mouse = mouse,
screen = screen,
+ awesome = awesome,
}
@psychon
psychon / test_border_alpha.c
Created March 15, 2015 11:14
A quick hack to test alpha values for XCB_CW_BORDER_PIXEL and XCB_CW_BACK_PIXEL
#include <xcb/xcb.h>
#include <stdio.h>
#include <stdlib.h>
static void die(const char *msg)
{
fputs(msg, stderr);
exit(1);
}
diff --git a/awesome.c b/awesome.c
index 046ea3f..49c3d71 100644
--- a/awesome.c
+++ b/awesome.c
@@ -53,6 +53,9 @@
#include <xcb/xtest.h>
#include <xcb/shape.h>
+#include <X11/Xlib-xcb.h>
+#include <X11/XKBlib.h>
$ tests/run.sh
awesome_log: /tmp/_awesome_test.log
== Running /home/psychon/projects/awesome/tests/test-focus.lua ==
E: beautiful: error loading theme file cannot open /usr/local/share/awesome/themes/default/theme.lua: No such file or directory
Error while reading 'inactive': /home/psychon/projects/awesome/build/lib/gears/surface.lua:39: Failed to open file 'inactive': No such file or directory
stack traceback:
...hon/projects/awesome/build/lib/wibox/widget/imagebox.lua:86: in function 'set_image'
/home/psychon/projects/awesome/build/lib/awful/titlebar.lua:214: in function 'update'
/home/psychon/projects/awesome/build/lib/awful/titlebar.lua:221: in function 'button'
/home/psychon/projects/awesome/build/lib/awful/titlebar.lua:237: in function 'floatingbutton'
diff --git a/tests/run.sh b/tests/run.sh
index 5ed9f7b..5f0bf97 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -36,6 +36,7 @@ XEPHYR=Xephyr
XVFB=Xvfb
AWESOME=$root_dir/build/awesome
RC_FILE=$root_dir/build/awesomerc.lua
+AWESOME_CLIENT="$root_dir/utils/awesome-client"
D=:5
diff --git a/lib/gears/object.lua b/lib/gears/object.lua
index 7e3d62b..5ccab05 100644
--- a/lib/gears/object.lua
+++ b/lib/gears/object.lua
@@ -12,6 +12,22 @@ local error = error
local object = { mt = {} }
+--- Call the given callback when the returned object is GC'd
+local create_gc_callback
@psychon
psychon / spawn_with_output.patch
Last active August 29, 2015 14:26
Add function for reading other processes output, line by line or in total when the process is done
diff --git a/awesomerc.lua b/awesomerc.lua
index d9c7d07..a24b35c 100755
--- a/awesomerc.lua
+++ b/awesomerc.lua
@@ -462,3 +462,46 @@ end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}
+
+local function spawn_with_lines_implementation(stream, line_callback, done_callback)
---------------------------------------------------------------------------
-- @author Uli Schlachter
-- @copyright 2015 Uli Schlachter
---------------------------------------------------------------------------
-- Hack so that beautiful can be loaded
_G.awesome = {
xrdb_get_value = function() end
}