LINUX.ORG.RU

Скриншот в AwesomeWM

 , awesomewm


0

1
    awful.key({ modkey }, "F11",
      function ()
        awful.spawn.with_shell("scrot -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f'")
      end,
      { description = 'screenshot', group = 'hotkeys' })

Вот так - не работает.

Если ставить клавишу Print - тоже не работает.

Как быть? Кто как настраивает?

★★★★★

У меня так организовано:

local awful = require("awful")
local naughty = require("naughty")

screenshot = os.getenv("HOME") .. "/Pictures/scrot/$(date +%F_%T).png"

function scrot_full()
    scrot("scrot " .. screenshot .. " -e 'xclip -selection c -t image/png < $f', scrot_callback", scrot_callback, "Take a screenshot of entire screen")
end

function scrot_selection()
    scrot("sleep 0.5 && scrot -s " .. screenshot .. " -e 'xclip -selection c -t image/png < $f'", scrot_callback, "Take a screenshot of selection")
end

function scrot_window()
    scrot("scrot -u " .. screenshot .. " -e 'xclip -selection c -t image/png < $f'", scrot_callback, "Take a screenshot of focused window")    
end

function scrot(cmd , callback, args)
    awful.util.spawn_with_shell(cmd)
    callback(args)
end

function scrot_callback(text)
    naughty.notify({
        text = text,
        timeout = 0.5
    })
end
awful.key({ modkey, }, "F10", scrot_full, {description = "Take a screenshot of entire screen", group = "screenshot"}),
awful.key({ modkey, }, "F11", scrot_window, {description = "Take a screenshot of focused window", group = "screenshot"}),
awful.key({ modkey, }, "F12", scrot_selection, {description = "Take a screenshot of selection", group = "screenshot"}),
sadsew
()
Ответ на: комментарий от oster2011

вот, а я пытаюсь вспомнить откуда брал) пару лет уже в ходу) пользуюсь случаем, спасибо переадресовываю ))

sadsew
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.