Skip to main content

executable_path

Function executable_path 

Source
pub fn executable_path() -> Result<PathBuf, Error>
Expand description

Get the stable executable path for spawning subprocesses.

When running from an AppImage, current_exe() returns the temporary mount path (e.g., /tmp/.mount_hyprXXX/usr/bin/hyprstream) which becomes invalid when the AppImage exits. Instead, we use the $APPIMAGE environment variable which points to the stable AppImage file path.

See: https://docs.appimage.org/packaging-guide/environment-variables.html

ยงReturns

  • $APPIMAGE path if set and the file exists
  • current_exe() otherwise