Added print screenshot command

master
Mark 2022-08-02 19:36:59 -07:00
parent 5dca4a76b4
commit e8312903db
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
2 changed files with 20 additions and 0 deletions

View File

@ -52,5 +52,17 @@ return {
group = "Screenshot" group = "Screenshot"
} }
) )
),
awful.key( {"Shift", "Control", "Mod1"}, "Print",
function ()
-- Make sure your default printer is set in CUPS!
screenshot_action("lpr")
end,
{
description = "Print a screenshot",
group = "Screenshot"
}
) )
} }

View File

@ -43,6 +43,14 @@ function capture
echo $ocr | sed -e "s/^[ \t]*//" | xclip -i -rmlastnl -selection clipboard echo $ocr | sed -e "s/^[ \t]*//" | xclip -i -rmlastnl -selection clipboard
rm $tmp_file rm $tmp_file
case lpr
# Default printer must be set for the lpr command to work.
# TODO: don't lpr if screenshot is cancelled.
flameshot gui --accept-on-select --path $tmp_file
convert $tmp_file $tmp_file.pdf
lpr -T "Autoprint Screenshot" $tmp_file.pdf
rm $tmp_file
case "*" case "*"
echo "Unknown action \"$argv[1]\"" echo "Unknown action \"$argv[1]\""