Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
Support for Environment Variable Expansion in .desktop Exec Keys Please consider allowing simple environment variable expansion (e.g. $HOME, $XDG_DATA_DIRS) in the Exec key of .desktop files, as defined in the XDG Desktop Entry Specification. Currently, .desktop entries require fully hardcoded absolute paths in the Exec key. This imposes several limitations: * User portability: Applications installed in per-user locations (e.g., within $HOME/.local/bin) must hardcode the username or path in each .desktop file, making them fragile when moved between systems or user accounts. * Dynamic environments: Many modern scripts and tools are aware of or depend on XDG_* environment variables, but .desktop files cannot make use of them. * Autostart scripts: Users creating .desktop entries in ~/.config/autostart/ for user login tasks must avoid $HOME and write out full paths, which is inelegant and error-prone. * Tooling complexity: Tools that generate .desktop files must resolve these values at generation time, leading to duplication of logic that could otherwise be standardized. * Script/package integration: Developers often write scripts or installer routines that dynamically generate .desktop files. These scripts could be greatly simplified by supporting environment variable expansion, removing the need for runtime resolution or complex path detection logic. Allow a restricted and clearly defined set of environment variables to be expanded at runtime only in the Exec key, such as: $HOME $USER $XDG_CONFIG_DIRS $XDG_SEAT $XDG_SESSION_PATH $XDG_CURRENT_DESKTOP $XDG_SEAT_PATH $XDG_SESSION_TYPE $XDG_DATA_DIRS $XDG_SESSION_CLASS $XDG_VTNR $XDG_GREETER_DATA_DIR $XDG_SESSION_DESKTOP $XDG_RUNTIME_DIR $XDG_SESSION_ID This could be optionally restricted to known safe variables to prevent arbitrary command execution, and/or specified in a new metadata key such as: X-Exec-Allow-Env=true Alternatively, expansion could be limited to environment variables already defined in the session, without permitting subshells or command substitution. This change would improve the flexibility and portability of .desktop files while remaining consistent with the XDG design goals. It would empower users and developers to write cleaner, more adaptable launch entries and reduce friction when scripting automation of .desktop files. If this functionality is indeed present, pardon me, perhaps I need to update or something.
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)