I want code to right click context menu on a file and if it is a .mp4, then convert that to a .mp3 of the same name
also include an option to play faster by +25 +33 +50 or slower by -25 -33 -50 (in a sub menu)
I understand this is different depending on your system, so answer how to do it for the people who use the same system as you
You got me curious, so I looked it up.
This isn’t a “let me google that for you”, it’s an “I’m joining you on this journey”.
https://develop.kde.org/docs/apps/dolphin/service-menus/
(KDE)
Looks like you drop a .desktop file into ~/.local/share/kio/servicemenus.
Name the file extensions, write your Exec= line, fill in a couple other details like what icon to use and what it should be called in the right-click menu, save it, and you’re done.
I imagine it’s similar in xfce.
Looks like Thunar has a “Custom Actions” feature under the Edit menu where you can get the same result.
Can I just say something? I personally view (almost) anything that involves editing configuration files by hand as an opportunity for the Linux community to implement a GUI.
You’re absolutely right, I’m surprised that xfce (or Thunar anyway) has a GUI for it and KDE doesn’t.
KDE might and I just didn’t find it in the search results.
Pull request time!
I still haven’t had to edit any files for this task, I was able to install packages and check boxes in a gui to add menu items ( kde / dolphin )
Thanks for volunteering yourself and your own time to this endeavor.
So you admit the lack of GUIs on Linux is due to a lack of developers?
You don’t think it’s easier for users to edit configuration files by hand?
Well, more choice is a good thing. So long as the configuration file stays available as well (because it makes it way easier to script this configuration), then having a GUI available is cool, too.
Having said that, the particular feature that OP wants is for people who want to script things, meaning most of them will prefer the configuration file anyways. You’d need quite a lot of spare devs for one of them to get bored enough to want to develop a GUI, which will not see much usage.
Actually no I don’t.
Linux doesn’t lack GUIs; there’s at least ten entire Desktop Environments in active development at any given time and several of them are quite feature complete such as Cinnamon and KDE. Then you’ve got GNOME which is polished if deliberately feature poor.
A few DEs do have GUI applets for editing the context menu but not all do. Windows doesn’t have one built in. Quote the second page of that thread:
I’m a subscriber to the old adage “GUIs make simple tasks easy, CLIs make complex tasks possible.” This task is either within the city limits of shell scripting or close enough to read the “Speed limit 35 unless posted” sign, so it might as well be left as a “write a config file” type thing.
Editing a config file takes a few seconds. Implementing a GUI takes hours of unpaid labor, and depending on the case the UX in the end might be almost identical.
The UX at the end should never be identical.
It’s why laypeople shy away from Linux. They prefer GUIs because GUIs are easier for users.
Well, sometimes it’s gonna be. What if there’s a field that can take an arbitrary string? You would rather input that string into a styled form input with some buttons to click than use a text editor for a second?
Absolutely!
How am I supposed to know where to find the file? Editing files by hand is also more error-prone compared to using a GUI. It’s not for laypeople and they shouldn’t have to adjust for it.
A big appeal of software development for me is making things easier for users even if it’s harder for the developers to implement. That’s good design, and great work.
Okay if finding the file is the problem I assume you’re just allergic to documentation, which, yeah, would make configuring things pretty annoying.
Hypothetically yes it would be great if all settings were easily discoverable and all users could easily make all their software work exactly how they want. In practice you’re asking for a huge amount of development by unpaid volunteers whose time could be (and is) going to, for example, the actual features or configuration options that you’re trying to set in the first place.
Most apps with GUIs do expose most settings that “laypeople” would use, anyway. OP is literally asking to be able to run custom scripts from context menus, I’d love to see your suggestion for implementing a clean and user-friendly GUI for that.
Allergic to documentation? See, this is where the free software community fucks up. Stop putting the onus of usability on the users. It’s the role of developers to make their software easy to use for people who aren’t working on it. That’s why macOS and Windows are still dominant to this day. The companies that develop them realized decades ago that laypeople don’t want to and shouldn’t have to read documentation or sift through configuration files if software can be designed so that it’s easier to use.
Unfortunately, thanks to people like you, getting this solution across to the Linux community at large is like pulling teeth.
I’d be happier if we could just admit, “Yeah, GUIs are better but they’re harder to implement so we don’t do it.” At least then we’re being honest and not trying to blame users for the lack of developers.
As it stands right now, your rhetoric actively discourages people to take up GUI development because you keep trying to make it a user problem, not a developer one.
In FOSS, community & volunteer made software, yes, there is onus on you as the user to do a bare minimum of effort. You have to meet the developers and the software where it is.
I very literally said “GUIs are better but harder to implement.” The second half of that sentence is not trivial.
If you want to customize and tweak things in the guts of a program (like OP does for this discussion), you can actually do it with FOSS applications. But expecting developers to expose every configurable option with a GUI would massively slow down the pace of development. Making them available in config files is a nice compromise between doing all that work and not exposing the option at all, in which case you’d need to actually patch the executable or otherwise modify the source code.
I’m not discouraging people from working on GUIs. I’m just pointing out the fact that if an app doesn’t expose a setting you want to change, your options are a) complain that the dev hasn’t implemented that, b) change it yourself which would be hugely easier if you looked the documentation, or c) find another app. Saying “the onus isn’t on me” doesn’t work when you don’t pay for the software and the person who wrote it is a volunteer, it just makes you an entitled asshole.