Score:2

scrot command overwrites screenshot

ar flag

I am using LXDE and created a PrtSc hotkey that uses scrot to create a screenshot, but it's overwriting the file, again and again. I want it to create a new file every time I hit PrtSc. However, when I am pressing Shift+PrtSc to select the area to capture, it's creating a new file every time I am using it.

The command I used to create the hotkey is:

scrot '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/Pictures/'
Score:3
hr flag

Two simple options you can try:

  1. increase the time resolution so that files created at least 1s apart have distinct names:

    scrot '%Y-%m-%d-%H:%M:%S_$wx$h_scrot.png' -e 'mv $f ~/Pictures/'
    
  2. add a --backup=numbered option to the mv command:

    scrot '%Y-%m-%d_$wx$h_scrot.png' -e 'mv --backup=numbered $f ~/Pictures/'
    
Shubharthak avatar
ar flag
Thanks Tried First solution and it worked!! Mad respect <3
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.