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.
This commit is contained in:
parent
d827235d31
commit
016df3ff74
|
@ -101,8 +101,11 @@ open_desktopFile() {
|
||||||
# derefs to an application
|
# derefs to an application
|
||||||
local target="$(readlink "$path")"
|
local target="$(readlink "$path")"
|
||||||
if [ -z "$target" ]; then
|
if [ -z "$target" ]; then
|
||||||
log "open_desktopFile: '$path' does not deref to anything in ~/.local/share/applications: don't know how to launch"
|
log "open_desktopFile: '$path' does not deref to anything in ~/.local/share/applications: falling back to heuristics"
|
||||||
exit 1
|
# 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
|
fi
|
||||||
if [[ "${target:0:1}" != "/" ]]; then
|
if [[ "${target:0:1}" != "/" ]]; then
|
||||||
target="$(dirname "$path")/$target"
|
target="$(dirname "$path")/$target"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user