devconf/.config/awesome/krdl.lua

25 lines
649 B
Lua
Raw Normal View History

2020-07-15 09:25:55 +00:00
local awful = require("awful")
local naughty = require("naughty")
local session_type = os.getenv("XDG_SESSION_TYPE");
if session_type == nil or session_type == "" then
session_type = "x11"
end
function decode_clipboard_x11()
2020-07-15 09:48:04 +00:00
naughty.notify({ text = "Decoding PGP message" })
awful.spawn.with_shell("xclip -selection clipboard -out | sed 's/^ *//g' | gpg2 -d | gvim -")
2020-07-15 09:25:55 +00:00
end
function decode_clipboard_wayland()
-- TODO: Implement this when needed. wl-clipboard can be used here
end
function decode_clipboard()
if session_type == "x11" then
decode_clipboard_x11()
else
decode_clipboard_wayland()
end
end