about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2023-12-09 09:05:12 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-12-15 11:03:45 +0900
commit3677c78c2d4d5382e18a0065c0d880979568ace1 (patch)
treec57aa90609c57302dd3fef3acd2e06119e65ef2e
parent81897b76214d191340e2451278b0f2568757b9bf (diff)
downloaddotfiles-3677c78c2d4d5382e18a0065c0d880979568ace1.tar.gz
Implement threa client directly in awesome
-rw-r--r--awesome/.config/awesome/rc.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua
index 52dbef0..38a9c75 100644
--- a/awesome/.config/awesome/rc.lua
+++ b/awesome/.config/awesome/rc.lua
@@ -1,4 +1,5 @@
 -- Standard library
+local io = {open = io.open}
 local pi = math.pi
 
 -- Awesome library
@@ -147,7 +148,6 @@ local mymainmenu = freedesktop.menu.build{
 
 local function showclipboard()
   local base = home .. "/.cache/threa/"
-  local command = "threac %s && xdotool key shift+Insert"
   local f = io.open(base .. "order")
   local order = f:read("*a")
   f:close()
@@ -156,7 +156,10 @@ local function showclipboard()
   for c in order:gmatch(".") do
     local f = io.open(base .. c)
     table.insert(items, {f:read("*a"):gsub("\n", " "), function ()
-      awful.spawn.with_shell(command:format(c))
+      local new_order = order:gsub(c .. "(.*)", "%1" .. c)
+      io.open(base .. "order", "w"):write(new_order):close()
+      awful.spawn.easy_async("clipbuzz", spawner"xdotool key shift+Insert")
+      awful.spawn(("xclip %s"):format(base .. c))
     end})
     f:close()
   end