Skip to content

benklop/hideapps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HideApps

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.

🎯 What it does

  • KDE apps: Only visible in KDE (adds OnlyShowIn=KDE)
  • GNOME apps: Only visible in GNOME (adds OnlyShowIn=GNOME)
  • Preserves customizations: Won't overwrite existing OnlyShowIn directives
  • Automatic monitoring: Optional systemd integration for hands-off operation

🚀 Quick Start

  1. Clone the repository:

    git clone <repository-url>
    cd hideapps
  2. Run the installer:

    ./install.sh
  3. Done! The script will run once and optionally set up automatic monitoring.

📋 Manual Installation

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

🔧 How it works

  1. Scans /usr/share/applications/ for org.kde.* and org.gnome.* desktop files
  2. Copies them to ~/.local/share/applications/ (if not already present)
  3. Adds the appropriate OnlyShowIn directive using Python's configparser
  4. Monitors for new installations (optional systemd integration)

🛠️ Configuration

The script works out of the box with no configuration needed. It:

  • Uses configparser for proper INI file handling
  • Preserves case sensitivity with optionxform = str
  • Only processes files that don't already have OnlyShowIn directives
  • Formats files cleanly, removing any duplicates

📊 Monitoring

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.path

🔍 Troubleshooting

Script not found:

# Make sure ~/.local/bin is in your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Service not triggering:

# Check service status
systemctl --user status hideapps.path hideapps.service

# Manual trigger for testing
systemctl --user start hideapps.service

Permission issues:

# Ensure proper permissions
chmod +x ~/.local/bin/hideapps.py

📁 Files

  • hideapps.py - Main Python script
  • hideapps.service - Systemd service unit
  • hideapps.path - Systemd path monitoring unit
  • install.sh - Automated installation script
  • README.md - This file

🤝 Contributing

Feel free to submit issues and pull requests. The script is designed to be simple and reliable.

📜 License

MIT License - see LICENSE file for details.

🔗 Background

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published