From 2ccf1c2e28377d5a5f6deb906713b52f9c8a0f0d Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 9 Dec 2023 11:14:09 +0100 Subject: From scrot to maim --- rc.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index 9cd2a3f..de12742 100644 --- a/rc.lua +++ b/rc.lua @@ -784,22 +784,30 @@ awful.key({ modkey, "Mod1" }, "#43", hotkeys_popup.show_help, {descripti {description = "Ranger", group = "awesome"}), awful.key({ modkey, "Control"}, "#27", function () awful.util.spawn("caja") end), awful.key({ modkey, }, "#39", function () - awful.util.spawn("scrot") - naughty.notify({ title = 'Scrot', text = 'New screenshot taken', timeout = 3 }) + awful.util.spawn("bash -c \"maim -u | xclip -selection clipboard -t image/png\"") + naughty.notify({ title = 'Maim', text = 'New screenshot taken', timeout = 3 }) end, {description = "Screenshot", group = "awesome"}), + awful.key({ modkey, "Shift" }, "#54", function () + awful.util.spawn("xsel -x") + naughty.notify({ title = 'Maim', text = 'New screenshot taken', timeout = 3 }) + 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 }) + end, + {description = "Save clipboard to file", group = "awesome"}), awful.key({ modkey, "Shift"}, "#39", function () - awful.util.spawn("scrot -s") - naughty.notify({ title = 'Scrot', text = 'New screenshot taken', timeout = 3 }) + awful.util.spawn("bash -c \"maim -u -s | xclip -selection clipboard -t image/png\"") + naughty.notify({ title = 'Maim', text = 'New screenshot taken', timeout = 3 }) end, {description = "Screenshot of selectionned area", group = "awesome"}), awful.key({ modkey, "Control" }, "#39", function () - awful.util.spawn("scrot -u") - naughty.notify({ title = 'Scrot', text = 'Screenshot of focused windows', timeout = 2 }) + awful.util.spawn("bash -c \"maim -u -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png\"") + naughty.notify({ title = 'Maim', text = 'Screenshot of focused windows', timeout = 2 }) end, {description = "Screenshot of focused windows", group = "awesome"}), - - awful.key({ modkey, }, "#113", function () local screen = awful.screen.focused() -- cgit v1.2.3