💾 Archived View for ebc.li › posts › shell-is-not-good-automation.gmi captured on 2021-12-05 at 23:47:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

The Linux shell is not a good automation platform

2021-04-23

If I had the ability to focus on one thing for a long time without giving up, I would make a Linux automation thing. Because the shell isn't enough for any modern workflow.

The End Goal: Tasker

Now, through this post I will be talking about an Android app named Tasker. If you are fine with proprietary software on your phone, this is the one app you should have. Seriously. Go buy it right now. I bought it twice and do not regret it one bit.

Tasker

Tasker is what I would consider the correct way to do automation. It's powerful, but not obscure. It's integrated well, has a great plug-in ecosystem and a great community (which is kinda important for things like this), and even though it's paid, it's not corporate (ahem ahem IFTTT). The only thing making me not rely on it every single day is that it's Android only, and I mainly use a desktop Linux computer for my day-to-day tasks.

Shell is not discoverable

Let's say I want to do something when I copy something. How would you do this via the Linux shell, or anything like it? I don't know, it would require me to search the internet for a while. And I use Wayland, so I'd need to search even more. I might even need to write code that's more than just the automation glue.

Anyway, how would I do the above thing with Tasker? Keep in mind, I have no idea and will now go try it myself as I write this:

Add > Event > Variable Set > %CLIP (which has a friendly name on the variable dropdown)

Done. I just explained it in a single line, whereas on Linux I have no idea what I'd need to do. Maybe wl-paste? But that's Wayland only, what if I switched to X.org? And do I need to run them in a loop? Is there an event-based way? Do I need to download an obscure CLI utility from someone's GitHub last updated in 2016? I have no idea.

And I can't just go through browsing what options I have. I have to have a project in mind before searching what I can do, instead of browsing through and going "I could make use of this feature".

Shell is not integrated well

Unless you 100% use command line utilities, it isn't. How easy is it to click on a button in a GUI through the shell? Or type into a specific text field?

While Tasker doesn't have it built-in, the AutoInput plug-in (made by the same developer) allows you to interact with the UI (ab)using the accessibility APIs of Android. Why don't we have an equivalent for Linux? Why can't I go "$ clickbutton Back" or whatever and just let the accessibility APIs take care of finding the position of the button and whatever for me. It's not that hard, is it?

A bonus would be that if a program is accessible, it can be automated, which is a nice thing to get for basically free. WHY AREN'T WE WORKING ON THIS?

Shell doesn't put all my automation in a single place

Where are my custom key bindings? They're on Sway's config.

Where are my custom commands? They're on ~/bin

Where are my hypothetical mouse gestures? Probably on some mouse gesture specific thing (which ALSO DOESN'T SEEM TO EXIST PROPERLY)

Where are my hypothetical application-specific tweaks?

Compare this to Tasker, where everything is inside the Tasker app, organized and categorized nicely. I do not have to leave Tasker to do any automation. Maybe for Termux for the really rare cases I need to do something via SSH or integrate with youtube-dl.

End

So yeah. That's it. If anybody is interested in making this a reality, please reach out, I'd be interested in trying it out.

🐺 · CC BY-SA 4.0 · me@ecmelberk.com