ATTENTION: The below commands have been updated after the original post.
Hopefully soon Chatty will get a more straightforward way to save MMS pictures, but in the meantime I went looking for some commands and/or scripts to get it done.
=== WORKAROUND 1 ===
First:
- Designate a folder where you want to move the Chatty MMS files to; I made a folder called “MMS” inside my main “Pictures” folder.
- Within the designated folder (which, for me, is “MMS”), create a subfolder; I’ve named mine “ChatPics.”
Next:
Option 1
Run these commands in succession, one at a time in the terminal:
cp -nr /home/purism/.local/share/chatty/mms/. /home/purism/Pictures/MMS/
cd /home/purism/Pictures/MMS
find . -type f ! -name "*.*" -exec cp -n {} {}.png \;
find . -name \*.png -exec cp -n {} ChatPics \;
Chatty stores each MMS picture in a separate folder at .local/share/chatty/mms
, but doesn’t add a file extension to the individual picture file within each folder. We need the .png
to be added, so they can be recognized as pictures.
The above commands:
- collect and copy all those picture files from the subfolders
- place the copies in the
Picture/MMS
subfolder - change the directory (in Terminal) to the
Pictures/MMS
subfolder - add a
.png
file extension to each one - place the newly labeled photos in the
ChatPics
subfolder
Important: Run those commands in the given sequence so that you’re in the Pictures/MMS
subdirectory (in the terminal) when you add the extension to the files that don’t have one. Otherwise, you’ll accidentally add a .png
file extension to files you didn’t intend.
Option 2
Same commands as above, but combined into one shell script.
I created a text file with the following script inside… Thanks, Internet!
#!/bin/bash
commands () {
cp -nr /home/purism/.local/share/chatty/mms/. /home/purism/Pictures/MMS/
cd /home/purism/Pictures/MMS
find . -type f ! -name "*.*" -exec cp -n {} {}.png \;
find . -name \*.png -exec cp -n {} ChatPics \;
}
export -f commands
gnome-terminal -e "bash -c 'commands'"
Then I saved it as chatpics
(with no file extension) in the home folder, and made it executable (check the file’s Properties and Permissions).
To run it, you can either:
- double-click it and select
Run in Terminal
, or - go to terminal and run the command
./chatpics
or:
set a cron job so that it runs at a given interval, e.g. once per hour, once per day, etc.
Option 3
Make a desktop “app” so you can simply click an icon to run it on demand.
- Open the text editor, paste in the following lines, save as
ChatPics.desktop
at.local/share/applications
, and make sure it’s executable (check the file’s Properties and Permissions):
[Desktop Entry]
Name=ChatPics
Exec=./chatpics && exit
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/ChatPics.png
- Find an icon you like, name it
ChatPics.png
and save it at.local/share/icons
.
===
Result:
Whether you use Options 1, 2, or 3, all the pictures from your chats will be collected and saved in one folder, where they will be easy to select/copy/cut/paste/move all together or in select groups. Only new picture files will be added each time; you won’t end up with multiple copies of the same ones.
You could also batch-save to the external card instead. but I use a different method to retain the entire Pictures directory and also back it up to the external card.