-
Notifications
You must be signed in to change notification settings - Fork 0
/
clipboard.lua
52 lines (43 loc) · 833 Bytes
/
clipboard.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local spawn = awful.spawn
local async = awful.spawn.easy_async
return {
clear = function()
spawn("clip clear all")
out("All buffers cleared")
end,
seltocli = function()
spawn("clip sel cli")
out("Selection -> Clipboard")
end,
clitosel = function()
spawn("clip cli sel")
out("Clipboard -> Selection")
end,
savesel = function()
spawn("clip sel sec")
out("Selection saved")
end,
restsel = function()
spawn("clip sec sel")
out("Selection restored")
end,
dumpsel = function()
async("clip sel", function(output)
if string.len(sel) ~= 0 then
out(sel, 0)
else
out("Selection empty")
end
end)
end,
dumpcli = function()
async("clip cli", function (output)
if string.len(cli) ~= 0 then
out(cli, 0)
else
out("Clipboard empty")
end
end)
end,
}
-- vim:ts=4:sw=4