Skip to content

CLI tool for discovering XDG .desktop files and autostart entries

License

Notifications You must be signed in to change notification settings

yamixst/desktop-entry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

XDG Desktop Files List

A Python command-line tool for listing and filtering desktop entry files (.desktop files) on Linux systems. This tool helps you discover installed applications and autostart entries by scanning standard XDG directories.

Features

  • List Applications: Scan and display all installed desktop applications
  • Autostart Entries: View applications configured to start automatically
  • Regular Expression Filtering: Filter results using powerful regex patterns in application name, filename, or command
  • Multiple Sources: Supports system, user, Snap, and Flatpak applications
  • Path Export: Output file paths for scripting purposes

Installation

Prerequisites

  • Python 3.6 or higher
  • pyxdg library for XDG directory handling

Install Dependencies

pip install pyxdg
or
sudo apt install python3-pyxdg
or
sudo dnf install python3-pyxdg

Download and Install

# Install to system
wget https://raw.githubusercontent.com/yamixst/desktop-entry/main/desktop-entry-list
chmod +x desktop-entry-list
sudo cp desktop-entry-list /usr/local/bin/

# or install only for user
curl -fL https://raw.githubusercontent.com/yamixst/desktop-entry/main/desktop-entry-list -o ~/.local/bin/desktop-entry-list
chmod +x ~/.local/bin/desktop-entry-list

Usage

desktop-entry-list [-h] [-a] [-p] [-t] [-d] [-u] [-s] [REGEX]

positional arguments:
  REGEX              Filter by regular expression match in filename, name, or exec command

options:
  -h, --help         show this help message and exit
  -a, --autostart    Show autostart entries instead of applications
  -p, --path-only    Show only full paths to desktop files
  -t, --short        Show entries in short format (filename, name, exec on one line)
  -d, --directories  Show directories being searched
  -u, --user         Show only user directories
  -s, --system       Show only system directories

Basic Commands

# List all desktop applications
./desktop-entry-list

# List autostart entries
./desktop-entry-list -a

# Show only file paths (useful for scripts)
./desktop-entry-list -p

# Show which directories are being searched
./desktop-entry-list -d

Filtering with Regular Expressions

# Filter by application name (case-insensitive)
./desktop-entry-list browser

# Find applications starting with "fire"
./desktop-entry-list "^fire"

# Find Firefox or Chrome
./desktop-entry-list "firefox|chrome"

# Find text editors
./desktop-entry-list "text.*editor"

# Filter autostart entries
./desktop-entry-list -a mail

# Find applications with Python or shell scripts
./desktop-entry-list "\.(py|sh)$"

# Get paths for filtered results
./desktop-entry-list -p "code|vim|emacs"

Script integration

# Get all Snap applications
./desktop-entry-list -p | grep snapd

# Count installed applications
./desktop-entry-list -p | wc -l

Searched Directories

The tool automatically searches these XDG-compliant directories:

Applications

  • System: /usr/share/applications/, /usr/local/share/applications/
  • User: ~/.local/share/applications/
  • Snap: /var/lib/snapd/desktop/applications/
  • Flatpak: /var/lib/flatpak/exports/share/applications/, ~/.local/share/flatpak/exports/share/applications/

Autostart

  • System: /etc/xdg/autostart/
  • User: ~/.config/autostart/

License

This project is licensed under the GNU General Public License v3.0 or later. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

Author

Mikhail Yatsenko mikhail.yatsenko@gmail.com

About

CLI tool for discovering XDG .desktop files and autostart entries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages