Plasma secrets: Custom app launchers - WINE, too


Updated: October 6, 2017

I believe you will find today's article to be extremely niche and yet extremely satisfying, as it offers a solution to a rather innocent but annoying problem. If you're using the icons-only task manager in Plasma, you cannot easily pin custom apps. Moreover, you cannot pin WINE programs (Windows software running through WINE). You can use widgets, but then, you can't shuffle them around.

We've talked about the icons-only task manager and the advantages it offers, but now, we will take this to another level. We will create custom app launchers, pin them to the task manager, move them about, everything. This also covers WINE, so seemingly something that shouldn't be be possible. Let us, let us, let us!

Teaser

Problem

Well, it's simple. Some apps - especially WINE programs - cannot be pinned if you're using the icons-only task manager. You can add them as widgets, but that's not the point. Widgets and task manager icons cannot be mixed. We want something else.

Cannot pin WINE apps

Solution - Custom app launcher

What you need to do is create your own launcher - on the desktop. Just create one, don't edit anything yet to avoid file naming/renaming clashes and overwrites. Once it's created, right-click, properties.

Link to app

Desktop app link created

Now, give it the right name and the necessary application path.

New app link, general

The next step is to actually add the application command. This needs to be the full path to the WINE application. The easiest way to figure out what it is - either run ps, or create a desktop shortcut, then check its properties. In our example, IrfanView:

env WINEPREFIX="/home/roger/.wine" wine-development C:\\windows\\command\\start.exe /Unix /home/roger/.wine/dosdevices/c:/users/roger/Start\ Menu/Programs/IrfanView/IrfanView\ 64\ 4.44.lnk

Application command

Drag & drop

Now, you can drag this shortcut on the task manager. Shuffle as needed. Awesome.

Desktop, icon, pinned

Windows app pinned

Remove desktop icon

Now, you probably believe in minimalism, like I do, so you don't really want too many desktop icons. The problem is, if you do delete the IrfanView desktop shortcut, the pinned app will also stop working!

Missing shortcut

But I want a clean desktop!

Indeed, indeed. We all do. But apparently, there's a conflict between our desire and reality. On paper, Plasma does not allow you to hide or unhide specific icons, this should be added in the next release, hint - it does let you do that for specific file types, which could work. But we don't want to mess with the system defaults. There's a better way.

Hidden files on Plasma desktop

So here's something wicked. You can create hidden files by adding a dot as a prefix to their names. In other words, rename IrfanView.desktop to .IrfanView.desktop, and it will vanish from view. You can still access it through command line under ~/Desktop.

Once you rename it, you've effectively deleted the original, so we go back to the original issue with deleting shortcuts. The pinned app will not work. And because the launcher is no longer visible on the desktop, you cannot drag & drop it to the task manager like we did before. So we need a different approach.

Edit desktop configuration

Here's the secret juice. Your desktop setup config sits under:

./.config/plasma-org.kde.plasma.desktop-appletsrc

Open this file. Search for whatever Windows app you want to have pinned. In my case, we're looking for IrfanView, and there are two instances in the config file, one for the standard task manager and one for the icons-only setup. Now, simply change the name of the listed entries from IrfanView.desktop to .IrfanView.desktop. Log out, log back in, and now you will have a hidden desktop shortcut and a pinned app on the task manager that works!

Config 1

Config 2

The text of the above example:

[Containments][1][General]
ToolBoxButtonX=1336
positions=1,10,desktop:/IrfanView.desktop,0,2,desktop:/
Home.desktop,0,0,desktop:/trash.desktop,0,1
sortMode=-1

And modified it reads:

[Containments][1][General]
ToolBoxButtonX=1336
positions=1,10,desktop:/.IrfanView.desktop,0,2,desktop:/
Home.desktop,0,0,desktop:/trash.desktop,0,1
sortMode=-1

And now, your desktop and the pinned app:

Hidden launcher, works

Hidden launcher, works, zoomed

Don't forget, this is a Windows program running under WINE! And it works fabulously. You can give it beautiful icons from our pimpage saga, you can move in between other launchers are you see fit. Splendid.

Conclusion

I told you this was a beauty. It elegantly goes against all the accepted conventions of the Plasma desktop, including hidden desktop icons, task manager launchers linking to hidden icons, and Windows software running through WINE playing ball. All of this can be done relatively simply, quickly, easily, without any great messing about. I hope you like.

One last thing, notice how my screenshots above no longer have any shadow, which is something that both Ksnapshot and Spectacle always do, if you use compositing? Well, that's another secret we will resolve next time!

Cheers.

RSS Feed icon

del.icio.us del.icio.us stumbleupon stumble digg digg reddit reddit slashdot slashdot



Advertise!

Would you like to advertise your product/site on Dedoimedo?

Read more

Donate to Dedoimedo!

Do you want to
help me take early retirement? How about donating
some dinero to
Dedoimedo?

Read more

Donate