From 341d63f2a52d1115653dafb703cb35c649717572 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 11 Dec 2023 03:00:39 +0100 Subject: Use clip2file instead of bash cryptic --- rc.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rc.lua b/rc.lua index de12742..71be253 100644 --- a/rc.lua +++ b/rc.lua @@ -794,8 +794,15 @@ awful.key({ modkey, "Mod1" }, "#43", hotkeys_popup.show_help, {descripti end, {description = "Switch PRIMARY and SECONDARY clipboard", group = "awesome"}), awful.key({ modkey, "Control" }, "#54", function () - awful.util.spawn("bash -c \"xclip -o -selection clipboard -t image/png > ~/$(date '+%Y-%m-%dT%T').png\"") - naughty.notify({ title = 'Maim', text = 'Clipboard saved !', timeout = 3 }) + awful.spawn.easy_async("clip2file", + function(res, stderr, reason, exit_code) + if exit_code == 0 then + naughty.notify({title='Maim', text='Clipboard saved !', timeout=3}) + else + naughty.notify({preset=naughty.config.presets.critical, title='Maim', text=stderr, timeout=3 }) + end + end + ) end, {description = "Save clipboard to file", group = "awesome"}), awful.key({ modkey, "Shift"}, "#39", function () -- cgit v1.2.3