So I was planning to remap my copy/paste keys to be more similar to mac for
a while, since it doesn't interfere with terminal's ctrl+c command and
doesn't require the use of shift. Today I finally stopped being lazy and
slapped something together that I expected to work:
awful.key({ modkey, }, "c", function () os.execute('xsel -p
-o | xsel -i -b') end),
awful.key({ modkey, }, "v", function ()
local handle = io.popen('xsel -ob')
local result = handle:read('*a')
handle:close()
return result
end),
The copy part works fine, the paste does not. I realize that instead of
"return"ing the result, I should emit it, insert that text at mouse
position (or if I could just trigger ctrl+v that would be good enough too).
I know result contains the text I want, I used naughty.notify to check, but
I'm clueless about how to emit it. Can someone help?
Thanks