3

Ive been trying to use gnome-screenshot like so

gnome-screenshot -acf $(date +%y_%h_%d_%H_%M_%S)

if I use the copy argument gnome-screenshot will not save. Am I missing something?

  • 2
    I don't think you're missing anything, it seems -c and -f don't work together. – pomsky Apr 20 at 21:50
4

The -f is cancelled by the -c:

OPTIONS
   -c, --clipboard
          Send the grab directly to the clipboard.

   -f, --file=FILENAME
          Save screenshot directly to this file.

The file will be stored in memory, not on disk, when -c is used: if you open Libreoffice writer and paste you will see your image.

How can I save and copy a screenshot at the same time?

edit1: bugreport #1446650 but nobody bothered to follow up on this. edit2: I found a way around it by using xclip. Install with ...

sudo apt install xclip

and expand your command with a variable holding date and time and 2 commands:

DATE=`date '+%Y-%m-%d_%H:%M:%S'`
sleep 5 && gnome-screenshot -af $DATE && xclip -selection clipboard -t  image/png -i $DATE
  • Thanks! That does work in terminal, but it's not working as a keyboard shortcut. Even more troubling than that, when I try to assign the shortcut to the printscreen key a screenshot is taken instead. I disabled the screenshot shortcuts so I'm not sure why I cant use the printscreen key. – rupert Apr 21 at 0:14
  • Convert the code into a script, make it executable, and then assign a keyboard shortcut to that script. – DK Bose Apr 21 at 0:42
  • @DKBose That worked, thank you! – rupert Apr 21 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.