3

I cannot figure out how to change the default filename for screenshots with the new gnome 42 screenshot tool. Die Screenshots are saved in my screenshot folder, but the name is not in the format that I would like.

Currently the files are saved in this format: Screenshot from 2023-01-14 15-37-28.png However, I save most my documents in a format with a shorter date/time and also leading the filename with the date, e.g. 20230114-153728_screenshot.png

I found some ways to do it with the old tool (gnome-screenshot):

But I was not able to accomplish this with the new one. I couldn't even figure out how to start the interactive UI for the gnome 42 tool from the command line.

1
  • It seems to be an elementary screenshot tool with no menu. I can press the Round button and that saves my selection to the Pictures folder. From there I can rename the file to what I want.
    – anon
    Commented Jan 18, 2023 at 23:10

1 Answer 1

1

I resolved this by using Autokey keyboard macro tool which uses Python 3+.

# [ win + w ] process gnome screenshot caption
# 2023-06-04 09:54 - AutoKey

clipboard.fill_clipboard("")
time.sleep(0.1)

paste_ = "<ctrl>+v"
time.sleep(0.1)

# example = "Screenshot from 2023-05-14 17-59-48" 
text_ = clipboard.get_selection()
time.sleep(0.1)

# replace unwanted chars in string 
text_ = text_.replace("-","") 
text_ = text_.replace(" ","_")
time.sleep(0.1)
# result = Screenshot_from_20230514_175948

# leftlen_ = 18 
# lefttext_ = "Screenshot_from_20"
lefttext_ = text_[:18] #left length
time.sleep(0.1)

# midlen_ = 6 
# midtext_ = "230514" year
# midtext_ = text_[::6:] #mid length
time.sleep(0.1)

# rightlen_ = 13
# righttext_ = "230514_175948" 
righttext_ = text_[-13:] #right length
time.sleep(0.1)

# 230514_ add underscore
caption_ = (righttext_[:6] + "_")
time.sleep(0.1)

keyboard.send_keys(caption_)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .