Add GPG decoder
This commit is contained in:
parent
3b5f878f51
commit
6a3c7b8b74
2 changed files with 28 additions and 0 deletions
23
.config/awesome/krdl.lua
Normal file
23
.config/awesome/krdl.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
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()
|
||||
awful.spawn("sh -c \"sel --clipboard | sed 's/^ *//g' | gpg2 -d | gvim -\"")
|
||||
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
|
|
@ -19,6 +19,7 @@ local hotkeys_popup = require("awful.hotkeys_popup")
|
|||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
local flameshot = require("flameshot")
|
||||
local krdl = require("krdl")
|
||||
local start = require("start")
|
||||
|
||||
-- {{{ Error handling
|
||||
|
@ -449,6 +450,10 @@ globalkeys = gears.table.join(globalkeys,
|
|||
awful.key({ "Ctrl" }, "Print", flameshot_full,
|
||||
{description = "Take a screenshot of delay", group = "screenshot"}),
|
||||
|
||||
-- Krdl
|
||||
awful.key({ modkey }, "#", decode_clipboard,
|
||||
{description = "Decode GPG message from clipboard", group = "user"}),
|
||||
|
||||
-- Media keys
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function() os.execute("pactl set-sink-volume @DEFAULT_SINK@ +5%") end, {description = "Volume Up (+5%)", group = "mediakeys"}),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function() os.execute("pactl set-sink-volume @DEFAULT_SINK@ -5%") end, {description = "Volume Up (-5%)", group = "mediakeys"}),
|
||||
|
|
Loading…
Reference in a new issue