Easily sorting through thousands of photos with the magic of BASH

I just needed a quick way to sort through thousands of photos, in order to decide what to keep. So I wrote this simple script:


#!/usr/bin/env bash
for file in ./*; do
img2sixel $file
read -p "Keep [k], delete [D] or edit [e] $file? (Default: Keep)" KkDEe
case $KkDEe in
[D]* ) rm $file;;
[Ee]* ) echo "Starting rawtherapee..." && rawtherapee $file;;
[Kk]* ) ;;
* ) ;;
esac
done

(Unfortunately WordPress removes leading spaces for the code block *sigh*)

(This only works if the folder contains just image files, you might want to instead use something like for file in ./*.jpg instead if you only want to look at a specific file type. Otherwise you will get warnings for files that cannot be displayed as images. In my case photo folders only contain photos.)

Requirements:

– BASH (so simple it can be adapted to other shells easily)
– img2sixel
– terminal emulator that can display SIXEL graphics (such as foot, for example)

This will then show each photos in your terminal along with the question of whether to keep it:

Screenshot: Shows a terminal displaying the lower part of the flag for the United Federation of Planets, along the question of whether to keep it.

One of the options is to open it in in Rawtherapee, which I occasionally use to fix exposure.

I have an alias sort_through_photos, which allows me to simply type this in and immediately start sorting through photos comfortably, regardless of what folder I am in.

FAQ: Mobile Linux, What The…?

As I’ve now been using Mobian for a few weeks, I thought it’d be time for an FAQ.

What phone are you using?

Pixel 3a, to which I’m currently porting Mobian. This is work in progress, so take the following cum grano salis. Other mobile Linux devices might already in some ways, depending on which one you look at, work better.

What can it do?

– Calling
– Texting
– Syncing contacts and calendar with a Nextcloud
– Browsing the web
– Taking photos
– Matrix messaging
– Signal messaging
– emailing
– playing music
– streaming music
– tracking satellites
– showing weather forecasts
– running vim
– playing Doom

Just the things you would expect from a smartphone, but not the usual proprietary spyware most people use.

What can it not do?

I knew the question would come. Mostly because I wrote it.

Currently there are no good options for alarm clocks. It does not make me a cuppa. Your proprietary attention stealing “social” networking app will not be available, this arguably is an upside.

And while it is not impossible to be tracked, there is at least no Google crap on the phone. No Play Services. But there’s also currently nothing that does push notifications, if you think it’s important to have to get distracted every couple seconds, you are out of luck. But rest assured, there are people working on solving that, so you can have a pling disturbing you every few seconds. Yay.

What annoys you?

I currently have to switch the SIM slot after every boot as there’s no way to permanently set it…yet. That means the phone boots up to an empty slot and does not connect to the network. I also have to assign a MAC address for Bluetooth. Though that all really only takes around 25 seconds, so I can live with it for now.

A bit more annoying is that there’s some sort of issue causing it to only boot successfully on every 2nd boot, every other boot gets me into an initramfs shell. That is a bit annoying, but I also don’t have to reboot the phone ten times a day… Maybe I do that twice a week when testing something, so that’s also fine for now.

What is great?

The vastness of space and… Oh, you mean the phone. Yeah, right. Sorry.

There’s a music player called Lollypop, which can play music from Youtube. I can do whatever I want. No, seriously. Everything. Some things might not be readily available as nobody has put the effort into building them… yet. Such as mobile payments, which are hard to build and require lots of energy. But if it is available on Linux in some form, I can make it work on the phone. The UI might not fit the small screen very well, but that is a relatively small issue, compared to building something completely new. And so it happens that there are quite a few apps from the GNOME Project and also the KDE Project that do not only work on desktop computers, but also on tiny phone screens.

If anything is not quite there yet, I can flip a setting and the window will be scaled down to screen size, so that it no longer has parts off-screen. This occassionally works really well, often buttons are a bit small, but usable. This is fine and, as time passes, this becomes less and less of an issue.

Then there are the cases in which I want to do something and there’s no solution. As this is just Debian on a phone, I can just write a script to work around almost any issue I encounter.

That is a bit uncomfortable to use, right?

Well. It’s not a polished UX yet, but it gets the job done. Pretty much every single update improves something. It’s slowly getting better. I value the freedom to do whatever the hell I want far more than ‘convenience’. People are often too focussed on that.

Should I use Linux on my phone?

Sure. But to give you a more useful answer… It depends on what you want. Do you want a polished experience and everything to just work or do you like fiddling and tinkering occasionally and value freedom a lot more than a shiny UI? If your answer is the letter, then, by all means, give it a try. If your answer is the former, then, please, just buy an iPhone or whatever you are comfortable with and use what works for you. This isn’t about using something that does not do what you need it to, just to get freedom. Right now this is more of a nerdy pastime than a product ready for many people. It will still take a while before that happens.

Hum, maybe I want to give a Linux phone a try. How do I start that endeavour?

Get a Linux phone. (Obvious, so far, right?)

Then figure out what you want it to do. Set up everything that is readily available. Find out how you can accomplish the other things. You will have to do some reasearch to find the right software. Once you are satisfied, put your SIM card into the SIM slot and test calls and texts. If you are still satisfied, try using that for a while, instead of what you were using before.

Just do not immediately replace your previous phone, just in case you find out that you are missing something. (You will.)

Do you still use your Android phone?

How do you know… Oh, I wrote the question myself, sure…

Well, I still have it. I don’t really use it much anymore. But there are a couple of things for which I still ‘need’ it:

Taking Photos

The Linux phone can take photos, but the kernel driver for this particular device is work in progress and photos do not have good quality yet. This will change soon.

Ordering Food from the Supermarket

The supermarket only has an app for Android and iOS. They provide no way to order from a website. And they do not even publish the Android app outside of Google Play store, so I have to use Aurora Store to get the .apk file… Currently my biggest headache in using a Linux phone.

I will likely just find another supermarket to order from, although the API has been reverse engineered, therefore I could also solve that with a script that lists articles and asks me whether I want them… Maybe add an ncurses interfaces, just for fun?

Banking App

There is one for Linux, have not used it yet. Maybe I will just use the website in the future. That provides better security anyway, as I have to use a hardware device that generates a confirmation code in order to use it, while the Android app does not have a second factor at all.

Other than that… I don’t think I am particularly attached to Android and will be glad when I no longer have to use two devices, very soon.

Can you show me more about your Mobian port?

Sure: https://git.erebion.eu/forgejo/erebion/sargo-temp