lxqt
lxqt copied to clipboard
.desktop file creation and editing
This is obviously a feature request.
LXDE had a "Shortcut Editor" that was exposed in the right click context menu when performed on a .desktop file. I believe this was the lxshortcut
application. This was a handy thing that would be nice to bring back around.
With that in place, it would also be nice to have two new features:
- The right click context menu offering to create a new file or folder could also offer to create a new .desktop file (KDE calls them a "Link to Application," which seems reasonable)
- When dragging and dropping an executable to the desktop, the Shortcut Editor could pop open.
It'll be good to have an action for creating desktop files and the "Create New" submenu seems like a good place for it but we shouldn't clutter the right-click menu itself or the DND menu.
Feel free to borrow ideas from my conceptualization of a universal desktop file editor: https://github.com/Vladimir-csp/Undefied
@Vladimir-csp Thanks!
There is another approach:
The user can put a desktop template file inside ~/Templates
and use it to create a desktop file. But, the file properties dialog can be enhanced to contain an extra tab for desktop files, so that the values of their important keys could be edited by the user through that dialog.
The advantage of this approach is that additional info will be shown by the file properties dialog.
...the file properties dialog can be enhanced to contain an extra tab for desktop files, so that the values of their important keys could be edited by the user through that dialog.
The advantage of this approach is that additional info will be shown by the file properties dialog.
I do not see this approach as advantageous, because:
- File manager's file properties dialog is about properties of files in context of a file system. Desktop entries lie outside that context.
- It ties desktop entry editing to PCManFM instead of a dedicated application for dealing with desktop entries.
Frankly, after working on it for a day last month, I started to see it as a waste of time, especially because I knew that I might do a lot of work to make a duplicate functionality and, in the end, there might be no agreement about it.
Users can make desktop files like any other file and if they do so often, they could make use of templates. Text editors exist to be used -- that's how I think now.
Make this template:
[Desktop Entry]
Name=Link
Type=Link
URL=
Icon=preferences-desktop-launch-feedback
Terminal=false
Then, use it whenever you want by selecting a file, copying its path with Ctrl+Shift+C
and pasting it after "URL=". Straightforward!
I really don't think extra buttons, menu-items or dialogs for doing such things are good additions to LXQt.
Desktop entries are not just about content of the files, but also their placement in XDG hierarchy and relation to other entries, categories, XDG menu structure, etc.
".desktop file creation and editing"; that's the title. It's also said, "KDE calls them a "Link to Application...", and "When dragging and dropping an executable to the desktop..." This isn't about XDG menu structure but just https://github.com/lxqt/lxqt/issues/1621#issuecomment-450175333 and similar templates (for Type=Application
).
I do not see this approach as advantageous, because:
- File manager's file properties dialog is about properties of files in context of a file system. Desktop entries lie outside that context.
- It ties desktop entry editing to PCManFM instead of a dedicated application for dealing with desktop entries.
If you look into LXDE, you can see it is there for years - it can be inspected and modified from PCManFM, and there is also a standalone application for that purpose, and LXPanel also uses that functionality for menu instant editing just because it is a library function. JFYI.
I should clarify what I meant by my previous comment: If you create a desktop entry, you might also want to install it into appropriate dir so the system would see it (and choose to do so on user level or on system level), ensure the proper naming so it would override or at least not conflict with existing entries in the hierarchy, apply proper categories so it winds in a proper place in menu structure, etc...
Also I don't think inventing more misleading lingo like "Link to Application" or "Shortcut" is a good thing. .desktop files represent "Desktop Entries", and they can be of type "Application" among others, as defined in the Specification. Diverging from that just adds confusion.
I think the biggest issue with Desktop Entries for most people is they just don't get them. In much the same way that we don't expect that the average user would be hand manipulating their config files for all of the LXQt components, we don't expect that they would be hand crafting their Desktop Entries.
You can get a gist of what KDE does for inspiration.
Anyone is welcome to make a separate app for it. The code of libfm-qt or pcmanfm-qt shouldn't be cluttered because of it. That's in the direction of what @Vladimir-csp said but for a different reason.
i don't think that a LXQt tool is really needed. Menu editors exist for a long time. Maybe the better approach is to use a third party tool (if it work well). In case it don't work well it might be an option to make an existing tool better: https://bluesabre.org/2018/02/06/menulibre-2-1-5-released/
Re-inventing wheels might be fun - ressourcewise it is a waste of developer time.
Sadly, I can say a lot of very bad things about Alacarte and Menulibre. They go out of their ways to obfuscate the Spec. Both make menus static on any change, both try to manipulate menu structure when putting deskotp entries into submenus or deleting entries instead of manipulating categories of desktop entries or their visibility status. List goes on. Of course it is just my opinion, but when I see the Spec and its potential, and what those tools do with it, the only analogy I can think of: hitting nails with a microscope (and saying "what microscope?").
Sadly, I can say a lot of very bad things about Alacarte and Menulibre.
Personally, I don't trust any app with 2 kinds of things: my desktop files and my mimeapps.list
;)
@Vladimir-csp - everything can be used as a hammer or scrwdriver :D
Now we have the desktop > right click > "create launcher" feature.
I just wonder if this could be improved with:
- adding a dropdown with all categories
- adding a checkbox "show also in menu" - this would copy it into ~/.local/share/applications
People are starting to ask if there is a way to add some executables to the menu, this could be one way.
Now we have the desktop > right click > "create launcher" feature.
Yes, but it isn't the job of pcmanfm-qt. IMHO, we should resist all temptations to make pcmanfm-qt (or any LXQt app) as messy as Dolphin (or other KDE apps).
A separate app can be made for adding desktop files to ~/.local/share/applications
; of course, with some additions. The app can also be enhanced to include editing features.
I, for one, prefer to do these jobs only with a text editor (as mentioned above) but will review PRs.