What custom actions do you add to your file manager's right click? And what do you have to do to include those?

What custom actions do you add to your file manager's right click? And what do you have to do to include those?
In Dolphin what you do is make .desktop files in $HOME/.local/share/kservices5/ServiceMenus/

Attached: context.jpg (184x89, 5.04K)

Bump for interesting thread.
>What custom actions do you add to your file manager's right click?
None, I expected to add some but I didn't need to so far. I just customized the previewer.
>And what do you have to do to include those?
My file manager is ranger, so I can just add a line to ~/.config/ranger/rc.conf if it's something simple like executing a script, or write a function in ~/.config/ranger/commands.py to write custom functionality in Python.

Interesting. Makes me want to use ranger more

Mostly compressing and decompressing stuff, and sending it to a text editor, hex editor or IrfanView regardless of file extension.

Why IrfanView? I take apart packages for embedded systems sometimes, and if I see "bgimg.dat" for instance, there's a fair chance it's a standard image format. If I open it with IrfanView, it will tell me what format it is and then display it. Or if it tells me it's unrecognized, there's a fair chance it's raw uncompressed bitmap data, in which case I rename to .raw and do it again. Then it prompts for a height, width and pixel format - which I put the dimensions of the device's screen as a first guess for and then change it depending on what I see.

Sounds like a process you could automate maybe, especially if you do it often

The file command is useful too, though often I don't want to identify it, rename it and then open it, I just want to get a quick look at what it is. For "raw" pixel data files, I can't exactly automate guessing the correct size since my computer has even less idea what the unknown picture supposed to look like than I do.
I could make a special viewer program that loads raw data and rewraps the pixel lines as I resize the window or drag a slider though.

I have a bunch of Services that I use. I've been converting some of them over to Shortcuts, but for most purposes, Shortcuts is ass compared to seven-line Perl scripts.

Anyway, I have options for:

- convert HEIC to JPEG
- convert to WebP
- convert to WebP (losslessly)
- oxipng with libdeflate
- oxipng with Zopfli (slow)

A bunch of my apps add Services to the right-click menu but I don't think I've really gotten into any of them. Generally, if I want to open a thing in an app, I'll just drag the file onto the Dock icon.

>- convert HEIC to JPEG
>- convert to WebP
>- convert to WebP (losslessly)
>- oxipng with libdeflate
>- oxipng with Zopfli (slow)
Post code please?

JPEG from HEIC

Attached: Screen Shot 2022-08-08 at 4.21.05 PM.png (2388x1352, 634.15K)

oxipng with libdeflate

Attached: Screen Shot 2022-08-08 at 4.22.46 PM.png (2278x1900, 861.4K)

oxipng -Z (takes minutes or hours per image, which is why the Shortcut is structured differently)

Attached: Screen Shot 2022-08-08 at 4.23.54 PM.png (2712x1978, 907.4K)

Webp to trash

webpize losslessly

Attached: Screen Shot 2022-08-08 at 4.25.35 PM.png (1658x1022, 343.85K)

Lossy WebP is trash.

Lossless WebP is significantly better than PNG.

That mac action manager looking sweet ngl

Thanks user.
Only for 8bit color depth.

It does _look_ nice.

It's a bitch and a half to get working. Notice how much shorter and simpler the Automator actions are where you don't have to fuck around with IFS or whatever the fuck that is?

Of course, Automator is the legacy technology and Shortcuts is The Way Forward. I'll stop being pissed when Apple ships a Swift compiler that can run these sorts of programs in chroot jails on my iPhone and iPad instead of shoving the iPhone-only tools with the real-computer-only tools.

Oh, WebP can't handle wide color? That explains why it muddles the colors a bit when I try to use cwebp to compress my iPad screenshots down to something Any Forums can handle. Thanks!

You didn't ask for this, but here's an Automator action that will put arrows (and spaces) before every line of text that you've selected in any macOS-native text box (so it doesn't work in Electron apps, which are all the rage)

Attached: Screen Shot 2022-08-08 at 4.36.18 PM.png (1686x1028, 340.93K)

You also didn't ask for this, but here's the prefix-with-arrows functionality re-done as a Shortcut.

I don't know how the fuck I figured out I needed to fiddle with input[0][0].

Attached: Screen Shot 2022-08-08 at 4.39.00 PM.png (1724x1254, 523.79K)

At what point is a UI to make those better than just mapping an entry(ies) to a shell script?
What I do is just make .desktop files that point to a script I have elsewhere, which could be anything really