Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F57012180
organize-screenshots.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
544 B
Referenced Files
None
Subscribers
None
organize-screenshots.sh
View Options
#!/bin/sh
set
-e
SOURCE_DIR
=
$(
xdg-user-dir
PICTURES
)
TARGET_ROOT_DIR
=
$(
organize-folders
get
screenshots
)
###
### GNOME screenshots
###
for
f
in
"
$SOURCE_DIR
"
/Screenshot
\
from
\
*.png
;
do
[
-e
"
$f
"
]
||
break
YYYY
=
$(
echo
"
$f
"
|
awk
'{print substr($(NF-1), 1, 4)}'
)
MM
=
$(
echo
"
$f
"
|
awk
'{print substr($(NF-1), 6, 2)}'
)
TARGET_DIR
=
"
$TARGET_ROOT_DIR
/
$YYYY
/
$MM
"
mkdir
-p
"
$TARGET_DIR
/"
&&
mv
"
$f
"
"
$TARGET_DIR
/"
done
###
### Other formats? You can use:
###
### stat --format="mv '%n' 'screenshot-%y.png'" Sc*.png | sh
###
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Nov 14, 19:45 (6 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4257970
Default Alt Text
organize-screenshots.sh (544 B)
Attached To
Mode
rWK Wynter Kitro utilities
Attached
Detach File
Event Timeline
Log In to Comment