Created
March 27, 2023 14:52
-
-
Save viggo-w/3b8ecbd8a67722599d29dcef5fa95a29 to your computer and use it in GitHub Desktop.
A simple script that sorts your screenshots by date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datetime import datetime | |
username = os.getlogin() | |
date = datetime.today().strftime('%Y-%m-%d') | |
if not os.path.exists(f"/home/{username}/screenshots/{str(date)}"): | |
os.mkdir(f"/home/{username}/screenshots/{str(date)}") | |
os.system(f"scrot -s -f /home/{username}/screenshots/{str(date)}/{datetime.now().strftime('%H:%M:%S')}.png") | |
else: | |
os.system(f"scrot -s -f /home/{username}/screenshots/{str(date)}/{datetime.now().strftime('%H:%M:%S')}.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment