From 016df3ff745cf3e37bcc33a49b54c27aa9852f4c Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 12 May 2024 22:03:38 +0000 Subject: [PATCH] sane-open: launch some .desktop files even when they point outside ~/.local/share/applications an unfortunate reality is that symlinks tend to get dereferenced too early by other programs. --- pkgs/additional/sane-open/sane-open | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/additional/sane-open/sane-open b/pkgs/additional/sane-open/sane-open index 80638006..e1b52359 100755 --- a/pkgs/additional/sane-open/sane-open +++ b/pkgs/additional/sane-open/sane-open @@ -101,8 +101,11 @@ open_desktopFile() { # derefs to an application local target="$(readlink "$path")" if [ -z "$target" ]; then - log "open_desktopFile: '$path' does not deref to anything in ~/.local/share/applications: don't know how to launch" - exit 1 + log "open_desktopFile: '$path' does not deref to anything in ~/.local/share/applications: falling back to heuristics" + # assume that the deref'd name matches the application name. + # there's nothing *guaranteeing* this, but i have yet to see it fail. + open_application "$(basename "$path")" + return fi if [[ "${target:0:1}" != "/" ]]; then target="$(dirname "$path")/$target"