How do you add an application to the program menu?

Hi.
I was following this tutorial:
https://www.youtube.com/watch?v=Y4Fo4QVMleE

But I noticed it doesn’t seem to work.

No matter what I do, I can’t get Manjaro to recognise my .desktop files. It just seems to ignore them.

What I want to do is add a .desktop file with the following contents to ~/.local/share/applications:

[Desktop Entry]
Name=Lock
Exec=dbus-send --type=method_call --dest=org.gnome.ScreenSaver
/org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
Type=Application
Icon=system-lock-screen-symbolic
Categories=Utility;

Then I want to go into the Tweak tool, and add that application to the startup entries:

Without the ability to create a .desktop file that Manjaro will recognise however, I’m pretty much stuck for getting either of those functions to work.

On Ubuntu there used to be GUI programs you could use to create a .desktop file. Are there such programs available for Manjaro that would work for this purpose maybe?

I partially solved this with a program called Arronax, which I found in the AUR, in Pamac.

It generated the following .desktop file for me which works:

[Desktop Entry]
Type=Application
Icon=system-lock-screen-symbolic
Name=Lock Screen
Terminal=false
Hidden=false
Categories=Utility
Comment=Locks the desktop session
Exec=dbus-send --type=method_call --dest=org.gnome.ScreenSaver \\n /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
DBusActivatable=false
Path=/usr/bin
StartupNotify=true

Next thing will be to get the Gnome tweak program to be able to load it on log in.
As you can see here it’s accepting the Lock Screen .desktop file in my application launchers directory:

But when I log into my user account, it tells me that the screen lock was blocked by “an application”. I suppose I’ll have to dig around and see if there’s some kind of policy in Manjaro that blocks the screen lock command I’m trying to run, and see if I can convince Manjaro to let me run it :OP
Or find some alternative command I can run perhaps.

Ok solved it :stuck_out_tongue:

With some help from Arronax I now have the following .desktop file in ~/.local/share/applications:

[Desktop Entry]
Type=Application
Icon=system-lock-screen-symbolic
Name=Lock Screen
Terminal=true
Hidden=false
Categories=Utility
Comment=Locks the desktop session
DBusActivatable=false
Path=/usr/bin
StartupNotify=false
Exec=bash /home/doomicle/lockscript.sh

Which launches a script in my home folder:
#!/bin/bash

sleep 5
xdg-screensaver lock

And I’m able to add that to the startup entries for my user using the Tweak tool. Note that you have to log out of your user session after putting the .desktop file in ~/.local/share/applications, and only after logging back in will the .desktop file be recognised by Manjaro. After that you can go to the tweak tool, and add it to the startup entries from in there.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.