From 621aa08f0fd71fc3433d20204d660341ba6bc7cc Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Tue, 29 May 2018 23:14:37 +0800 Subject: [PATCH] add awesome wm note. --- note/awesome-tips.org | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 note/awesome-tips.org diff --git a/note/awesome-tips.org b/note/awesome-tips.org new file mode 100644 index 0000000..3958df4 --- /dev/null +++ b/note/awesome-tips.org @@ -0,0 +1,65 @@ +#+title: awesome tips + +* run and raise + + 1. This feature need files: 'aweror.lua' and 'ror.lua'. + 2. Put this two files at the same path with 'rc.lua'. + 3. add the follow code to the end of 'keybinding' section in 'rc.lua'. + #+BEGIN_SRC lua + -- load the 'run or raise' function + local ror = require("aweror") + + -- generate and add the 'run or raise' key bindings to the globalkeys table + globalkeys = awful.util.table.join(globalkeys, ror.genkeys(altkey)) + + -- Set keys + root.keys(globalkeys) + #+END_SRC + +* signal + + turn off energy saving when some window is fullscreen + #+BEGIN_SRC lua + local fullscreened_clients = {} + + local function remove_client(tabl, c) + local index = awful.util.table.hasitem(tabl, c) + if index then + table.remove(tabl, index) + if #tabl == 0 then + awful.util.spawn("xset s on") + awful.util.spawn("xset +dpms") + end + end + end + + client.connect_signal("property::fullscreen", + function(c) + if c.fullscreen then + table.insert(fullscreened_clients, c) + if #fullscreened_clients == 1 then + awful.util.spawn("xset s off") + awful.util.spawn("xset -dpms") + end + else + remove_client(fullscreened_clients, c) + end + end + ) + + client.connect_signal("unmanage", + function(c) + if c.fullscreen then + remove_client(fullscreened_clients, c) + end + end + ) + #+END_SRC + +* test + + | gd | bd | sum | + |----+----+-----| + | 3 | 7 | 7 | + | 4 | 3 | 12 | + #+TBLFM: @2$3=@3$1+@3$2::@3$3=@3$1*@3$2