I need some advice how to handle compressed files…
Yes, a ZIP can be unpacked, but the extracted files/folders are always saved in Downloads. Is there a way to have the extracted files/folders right at the same path as the parent zip file?
And is there any way to unpack a RAR file?
You can install unzip with pkcon. Some apps outside store will install this too. And then you can start unzip here and there. But hey you have a Linux phone. Zip and Rar are so Windows..
Sadly much of the outside world is so windows.
Anyway this would be nice to have functionality for the file managers in SFOS. (no idea which support it at the moment)
Good old Cargo Dock does! You’ll just have to add the tools in app settings.
You can use utilities like unzip, (un)xz, tar, gzip, bzip.
pack tar.gz
tar -czf %1.tar.gz %1
unpack tar.gz
tar -xzf %1 %1.out
2 Likes
Good to know. Speaking of FMs it would be good if the one hidden in the settings gets split on its own and gets better– or abandoned in favor of community apps.
There are some stuff like that in the OS that don’t offer much i think.
1 Like
This should be relatively easy to achieve with
- installing appropriate command line utilities
- creating a desktop file that executes them (by mime type)
For a start, look at /usr/share/applications/sailfish-archive.desktop. Assuming there’s a script called unar that recognizes archive types and uses the right utility, this edit should be enough:
[Desktop Entry]
Type=Application
Name=Sailfish Archive
NoDisplay=true
MimeType=application/zip;application/x-java-archive;application/x-xz-compressed-tar;application/x-compressed-tar;application/x-bzip-compressed-tar;application/x-7z-compresse
d;application/x-tar;application/x-xz;application/x-gzip;application/x-bzip2;application/vnd.comicbook+zip;
Icon=icon-launcher-component-gallery
Comment=Opens archives
Exec=/home/defaultuser/.local/bin/unar %F
Of course you’d need to add/remove mimetypes according to the capabilities unar has.
Alternatively, one could create multiple .desktop files, one for each utility. User-created .desktop files go in ~/.local/share/applications.
4 Likes
Okay, some hacking then. Up to now I didn’t even know about those desktop files…