Automatically hide KDE and GNOME applications from other desktop environments
HideApps is a lightweight Python script that adds OnlyShowIn directives to KDE and GNOME desktop files, preventing them from cluttering your application menu when using different desktop environments.
- KDE apps: Only visible in KDE (adds
OnlyShowIn=KDE) - GNOME apps: Only visible in GNOME (adds
OnlyShowIn=GNOME) - Preserves customizations: Won't overwrite existing
OnlyShowIndirectives - Automatic monitoring: Optional systemd integration for hands-off operation
-
Clone the repository:
git clone <repository-url> cd hideapps
-
Run the installer:
./install.sh
-
Done! The script will run once and optionally set up automatic monitoring.
If you prefer to install manually:
# Copy the script
cp hideapps.py ~/.local/bin/
chmod +x ~/.local/bin/hideapps.py
# Run it once
~/.local/bin/hideapps.py
# Optional: Set up automatic monitoring
cp hideapps.service hideapps.path ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable hideapps.path
systemctl --user start hideapps.path- Scans
/usr/share/applications/fororg.kde.*andorg.gnome.*desktop files - Copies them to
~/.local/share/applications/(if not already present) - Adds the appropriate
OnlyShowIndirective using Python'sconfigparser - Monitors for new installations (optional systemd integration)
The script works out of the box with no configuration needed. It:
- Uses
configparserfor proper INI file handling - Preserves case sensitivity with
optionxform = str - Only processes files that don't already have
OnlyShowIndirectives - Formats files cleanly, removing any duplicates
The optional systemd integration provides automatic monitoring:
# Check monitoring status
systemctl --user status hideapps.path
# View logs
journalctl --user -u hideapps.service -f
# Disable monitoring
systemctl --user disable hideapps.pathScript not found:
# Make sure ~/.local/bin is in your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcService not triggering:
# Check service status
systemctl --user status hideapps.path hideapps.service
# Manual trigger for testing
systemctl --user start hideapps.servicePermission issues:
# Ensure proper permissions
chmod +x ~/.local/bin/hideapps.pyhideapps.py- Main Python scripthideapps.service- Systemd service unithideapps.path- Systemd path monitoring unitinstall.sh- Automated installation scriptREADME.md- This file
Feel free to submit issues and pull requests. The script is designed to be simple and reliable.
MIT License - see LICENSE file for details.
This tool is useful for users who:
- Switch between desktop environments
- Want cleaner application menus
- Don't want KDE apps showing in GNOME (or vice versa)
- Prefer automated solutions over manual desktop file editing
The script respects existing customizations and uses proper desktop entry standards.