Removing KDE Menu Items

A familiar recommendation is not to run X as root. Usually reasonable advice except in a home network sometimes running X as root is the easiest or fastest way to get something done. Itinerant preachers and purists can scream all they want. Life is not black and white.

A common reason for not running X as root is exposing the desktop to bad people on the web. For most people that means a web browser or more specifically all internet tools. Evading those options reduces the presumed risks of using X as root.

In the house network, configuring the root desktop in KDE is much the same as other desktop environments. A big bold yellow warning message is splattered on the desktop and the Internet menu is removed. Removing the menu item requires but a few steps.

  • mkdir -p /root/.local/share/desktop-directories
  • cp /usr/share/desktop-directories/kf5-internet.directory /root/.local/share/desktop-directories/
  • In the file /root/.local/share/desktop-directories/kf5-internet.directory add NoDisplay=true.
  • cp /etc/kde/xdg/menus/kf5-applications.menu /root/.config/menus/

In the file /root/.config/menus/kf5-applications.menu search for:

<Directory>kf5-internet.directory</Directory>

Prior to that line add the following:

<DirectoryDir>root/.local/share/desktop-directories</DirectoryDir>

The same steps can be used for other menus items, such as games.

This menu trick does not prevent a knowledgeable or determined user from running certain tools as root. Like locks on a door, the trick keeps conscientious users out of trouble and that is all.

Posted: Category: Tutorial Tagged: KDE

Next: Discoverability

Previous: Disruptive Features