Jason G. Designs

WordPress Themes, Design Tutorials, Linux Themes and more…

Add LAMP Menu Items to the XFCE Applications Menu

Pixabay image

Recently I installed XFCE for a request to update one of my GTK themes. Anyway, another thing I needed was a way to start Apache and MySQL for my local WordPress install. I prefer to be able to start and stop these services rather than have them always on. So, I placed new items in a menu for this purpose.

After some Googling, I added some .desktop files, as according to the XFCE documentation on menu customization. I’m using Arch Linux, having installed LAMP following the documentation for WordPress. The commands may be different in another distribution, especially if it doesn’t run under systemd. The entries for starting and stopping Apache and MariaDB (MySQL) are below. Copy and Paste these and save them in your ~/.local/share/applications folder, using titles such as start-apache.desktop, etc.

[Desktop Entry]
Version=1.0
Type=Application
Name=Start Apache 2
Exec=systemctl start httpd.service
Categories=Development
OnlyShowIn=XFCE
[Desktop Entry]
Version=1.0
Type=Application
Name=Stop Apache 2
Exec=systemctl stop httpd.service
Categories=Development
OnlyShowIn=XFCE
[Desktop Entry]
Version=1.0
Type=Application
Name=Restart Apache 2
Exec=systemctl restart httpd.service
Categories=Development
OnlyShowIn=XFCE
[Desktop Entry]
Version=1.0
Type=Application
Name=Start MariaDB
Exec=systemctl start mariadb.service
Categories=Development
OnlyShowIn=XFCE
[Desktop Entry]
Version=1.0
Type=Application
Name=Stop MariaDB
Exec=systemctl stop mariadb.service
Categories=Development
OnlyShowIn=XFCE

I included the OnlyShowIn=XFCE part because I have other means of showing similar menu entries in other desktop environments. Removing this will likely show the menu item in every desktop environment. I actually did not test this. I then placed the menu items in the Development section, but there are other menu sections if your prefer something else. The Registered Categories section at freedesktop.org shows categories that can be added to your desktop entries.

That’s all there is to it! The screenshot below shows the new menu items in XFCE’s Applications menu.

XFCE menu entries

* Featured Image by Pettycon from Pixabay.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.