Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12241238
organize-screenshots.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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
Sun, Oct 12, 04:59 (1 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064983
Default Alt Text
organize-screenshots.sh (544 B)
Attached To
Mode
rWK Wynter Kitro utilities
Attached
Detach File
Event Timeline
Log In to Comment