Application Launcher/.desktop file not resolving the same executable path as a shell?

This feels like an odd enough issue that I’m sure I’m missing something obvious…I’ve built a few applications from source using KDE Builder. Once I built Konsole and Dolphin from source, the Application Launcher entries for them immediately started launching the built-from-source versions. This made sense, since my path environment variable starts with /home/johnkizer/kde/usr/bin, which is where the newly-built binaries were installed.

With Amarok built from source, though, I can only launch it by using the terminal - which amarok returns ~/kde/usr/bin/amarok, but clicking the Application Launcher entry, or even copying its .desktop file to my Desktop and double-clicking from there, launches the distro version in /usr/bin.

Rebooting and running kbuildsycoca6 didn’t seem to change this, so I’m a bit confused - maybe there’s a cache somewhere else that’s used to resolve .desktop file executables, and that’s stuck for some reason on this one?

If anyone has an idea to jog my brain, I would greatly appreciate it! :slight_smile:

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.80 (also tried in the regular distro 6.3.5 session, same results)
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland

It has been my experience that what is contained on the Exec= line is what the .desktop launches. So make certain it says Exec=/home/johnkizer/kde/usr/bin/amarok. This has worked for me for every single .desktop I have made using the absolute path to the binary to launch the program wanted.

1 Like

Thanks! Believe it or not, though, even with that path explicitly set in the .desktop file just as you mentioned, it’s still launching /usr/bin/amarok.

Just in case there’s something uniquely funky with the Fedora + Amarok desktop file somehow, it’s below (before being modified to try the explicit path):

[Desktop Entry]
Type=Application
Version=1.0
Name=Amarok
Name[be]=Amarok
Name[bg]=Amarok
Name[bs]=Amarok
Name[ca]=Amarok
Name[ca@valencia]=Amarok
Name[cs]=Amarok
Name[csb]=Amarok
Name[da]=Amarok
Name[de]=Amarok
Name[el]=AmaroK
Name[en_GB]=Amarok
Name[eo]=Amarok
Name[es]=Amarok
Name[et]=Amarok
Name[eu]=Amarok
Name[fi]=Amarok
Name[fr]=Amarok
Name[ga]=Amarok
Name[gl]=Amarok
Name[he]=Amarok
Name[hi]=अमारॉक
Name[hne]=अमाराक
Name[hu]=Amarok
Name[ia]=Amarok
Name[id]=Amarok
Name[is]=Amarok
Name[it]=Amarok
Name[ja]=Amarok
Name[ka]=Amarok
Name[km]=Amarok
Name[ko]=Amarok
Name[ku]=Amarok
Name[lt]=Amarok
Name[lv]=Amarok
Name[ms]=Amarok
Name[nb]=Amarok
Name[nds]=Amarok
Name[ne]=अमारोक
Name[nl]=Amarok
Name[nn]=Amarok
Name[oc]=Amarok
Name[pa]=ਅਮਰੋਕ
Name[pl]=Amarok
Name[pt]=Amarok
Name[pt_BR]=Amarok
Name[ro]=Amarok
Name[ru]=Amarok
Name[sk]=Amarok
Name[sl]=Amarok
Name[sq]=Amarok
Name[sr]=Амарок
Name[sr@ijekavian]=Амарок
Name[sr@ijekavianlatin]=Amarok
Name[sr@latin]=Amarok
Name[sv]=Amarok
Name[th]=แอมอะร็อก
Name[tr]=Amarok
Name[ug]=Amarok
Name[uk]=Amarok
Name[wa]=Amarok
Name[x-test]=xxAmarokxx
Name[zh_CN]=Amarok
Name[zh_TW]=Amarok
GenericName=Audio Player
GenericName[be]=Аўдыёпрайгравальнік
GenericName[bg]=Аудио плеър
GenericName[bs]=Audio plejer
GenericName[ca]=Reproductor d'àudio
GenericName[ca@valencia]=Reproductor d'àudio
GenericName[cs]=Zvukový přehrávač
GenericName[csb]=Grôcz aùdio
GenericName[da]=Lydafspiller
GenericName[de]=Audio-Wiedergabe
GenericName[el]=Αναπαραγωγή ήχου
GenericName[en_GB]=Audio Player
GenericName[eo]=Sonludilo
GenericName[es]=Reproductor de audio
GenericName[et]=Helifailide mängija
GenericName[eu]=Audio erreproduzigailua
GenericName[fi]=Musiikkisoitin
GenericName[fr]=Lecteur audio
GenericName[ga]=Seinnteoir Fuaime
GenericName[gl]=Reprodutor de son
GenericName[he]=נגן שמע
GenericName[hne]=आडियो प्लेयर
GenericName[hu]=Zenelejátszó
GenericName[ia]=Reproductor de audio
GenericName[id]=Pemutar Audio
GenericName[is]=Tónlistarspilari
GenericName[it]=Lettore audio
GenericName[ja]=オーディオプレーヤー
GenericName[ka]=მუსიკის დამკვრელი
GenericName[km]=កម្មវិធី​ចាក់​អូឌីយ៉ូ
GenericName[ko]=오디오 재생기
GenericName[ku]=Lêdarê Muzîkê
GenericName[lt]=Muzikos grotuvas
GenericName[lv]=Audio atskaņotājs
GenericName[mai]=आडियो प्लेयर
GenericName[ms]=Pemain Audio
GenericName[nb]=Lydavspiller
GenericName[nds]=Klangafspeler
GenericName[ne]=अडियो प्लेयर
GenericName[nl]=Audiospeler
GenericName[nn]=Musikkspelar
GenericName[pa]=ਆਡੀਓ ਪਲੇਅਰ
GenericName[pl]=Odtwarzacz dźwięku
GenericName[pt]=Leitor de Áudio
GenericName[pt_BR]=Reprodutor de áudio
GenericName[ro]=Redare audio
GenericName[ru]=Аудиопроигрыватель
GenericName[sk]=Audio prehrávač
GenericName[sl]=Predvajalnik glasbe
GenericName[sq]=Lexues audio
GenericName[sr]=Аудио плејер
GenericName[sr@ijekavian]=Аудио плејер
GenericName[sr@ijekavianlatin]=Audio plejer
GenericName[sr@latin]=Audio plejer
GenericName[sv]=Musikspelare
GenericName[th]=เครื่องเล่นเสียง
GenericName[tr]=Müzik Çalar
GenericName[ug]=ئۈن قويغۇچ
GenericName[uk]=Аудіопрогравач
GenericName[wa]=Djouweu d' son
GenericName[x-test]=xxAudio Playerxx
GenericName[zh_CN]=音频播放器
GenericName[zh_TW]=音效播放器
Exec=amarok %U
StartupWMClass=amarok
Comment=Amarok - Rediscover Your Music!
Comment[be]=Amarok - адкрыйце для сябе сваю музыку!
Comment[bg]=Amarok - преоткрийте музиката!
Comment[bs]=Amarok — otkrijte svoju muziku!
Comment[ca]=Amarok - Redescobreix la teva música!
Comment[ca@valencia]=Amarok - Redescobrix la teua música!
Comment[cs]=AmaroK - znovu objevte svou hudbu.
Comment[csb]=Amarok - òdrëjë znowa swòją mùzykã
Comment[da]=Amarok - Genopdag din musik!
Comment[de]=Amarok – Musik neu erleben!
Comment[el]=Amarok - Ανακαλύψτε ξανά τη μουσική σας!
Comment[en_GB]=Amarok - Rediscover Your Music!
Comment[eo]=Amarok - Remalkovru vian muzikon!
Comment[es]=Amarok - ¡Vuelve a descubrir tu música!
Comment[et]=Amarok - naudi oma muusikat!
Comment[eu]=Amarok - Aurkitu berriro zure musika!
Comment[fi]=Amarok – löydä musiikkisi uudelleen
Comment[fr]=Amarok - Redécouvrez votre musique !
Comment[ga]=Amarok - Athaimsigh do chuid Ceoil!
Comment[gl]=Amarok — Descubra de novo a súa música!
Comment[he]=Amarok - לגלות את המוזיקה שלך מחדש!
Comment[hne]=अमाराक - अपन संगीत ल फिर से खोजव!
Comment[hu]=Amarok - fedezze fel a zenéjét
Comment[id]=Amarok - Temukan Kembali Musik Anda!
Comment[is]=Amarok - Enduruppgötvaðu tónlistina þína!
Comment[it]=Amarok - Riscopri la tua musica!
Comment[ja]=Amarok - あなたの音楽を再発見
Comment[ka]=Amarok - თავიდან აღმოაჩინეთ თქვენი მუსიკა!
Comment[km]=Amarok - រក​ឃើញ​តន្ត្រី​របស់​អ្នក​ឡើង​វិញ !
Comment[ko]=Amarok - 음악의 재발견!
Comment[ku]=Amarok - muzîkê ji nû ve keşif bike
Comment[lt]=Amarok – atraskite savo muziką iš naujo!
Comment[lv]=Amarok - atklāj savu mūziku!
Comment[ms]=Amarok - Temui Muzik Anda!
Comment[nb]=Amarok – Oppdag musikken din på nytt!
Comment[nds]=Amarok - Beleev Dien Musik nieg!
Comment[ne]=अमारोक - आफ्नो बाजा फेरि पत्ता लगाउनुहोस्!
Comment[nl]=Amarok - Herontdek uw muziek!
Comment[nn]=Amarok – gjenoppdag musikken din!
Comment[pa]=ਅਮਰੋਕ - ਆਪਣਾ ਸੰਗੀਤ ਮੁੜ ਲੱਭੋ!
Comment[pl]=Amarok - odkryj na nowo swoją muzykę!
Comment[pt]=Amarok - Descubra de Novo a sua Música!
Comment[pt_BR]=Amarok - Redescubra suas músicas!
Comment[ro]=Amarok - Redescoperă-ți muzica!
Comment[ru]=Amarok - посмотрите на музыку по-другому
Comment[sk]=Amarok - Znova objavte svoju hudbu!
Comment[sl]=Amarok - Znova odkrijte svojo glasbo!
Comment[sr]=Амарок — откријте своју музику!
Comment[sr@ijekavian]=Амарок — откријте своју музику!
Comment[sr@ijekavianlatin]=Amarok — otkrijte svoju muziku!
Comment[sr@latin]=Amarok — otkrijte svoju muziku!
Comment[sv]=Amarok - Återupptäck din musik!
Comment[th]=แอมอะร็อก - ค้นพบมิติใหม่ในดนตรีของคุณ !
Comment[tr]=Amarok — Müziğinizi yeniden keşfedin!
Comment[ug]=Amarok - مۇزىكىلىرىڭىزنى قايتا بايقايسىز
Comment[uk]=Amarok — відкрийте свою музику знову!
Comment[wa]=Amarok - Ridiscovroz vosse muzike!
Comment[x-test]=xxAmarok - Rediscover Your Music!xx
Comment[zh_CN]=Amarok - 重新感悟音乐之美!
Comment[zh_TW]=Amarok - 重新探索您的音樂世界!
Icon=amarok
SingleMainWindow=true
# Add pure audio formats here, for other formats see amarok_*.desktop files
# See bug 242292
MimeType=audio/aac;audio/mp4;audio/mpeg;audio/mpegurl;audio/vnd.rn-realaudio;audio/vorbis;audio/x-flac;audio/x-mp3;audio/x-mpegurl;audio/x-ms-wma;audio/x-musepack;audio/x-oggflac;audio/x-pn-realaudio;audio/x-scpls;audio/x-speex;audio/x-vorbis;audio/x-wav;application/x-ogm-audio;audio/x-vorbis+ogg;audio/ogg;
X-DocPath=amarok/index.html
X-KDE-Keywords=music,podcast
X-KDE-Keywords[bg]=music,podcast
X-KDE-Keywords[bs]=muzika,podemisija
X-KDE-Keywords[ca]=música,pòdcast
X-KDE-Keywords[ca@valencia]=música,pòdcast
X-KDE-Keywords[cs]=hudba,podcast
X-KDE-Keywords[da]=musik,podcast
X-KDE-Keywords[de]=Musik
X-KDE-Keywords[el]=μουσική,podcast
X-KDE-Keywords[en_GB]=music,podcast
X-KDE-Keywords[eo]=muziko, podkasto
X-KDE-Keywords[es]=música,podcast
X-KDE-Keywords[et]=muusika,podcast
X-KDE-Keywords[eu]=musika,podcast
X-KDE-Keywords[fi]=musiikki,podcast
X-KDE-Keywords[fr]=musique, podcast
X-KDE-Keywords[ga]=ceol,podchraoladh
X-KDE-Keywords[gl]=música,podcast
X-KDE-Keywords[he]=מוזיקה,הסכתים
X-KDE-Keywords[hu]=zene,podcast
X-KDE-Keywords[id]=musik,podcast
X-KDE-Keywords[it]=musica,podcast
X-KDE-Keywords[ja]=music,podcast
X-KDE-Keywords[ka]=music,podcast
X-KDE-Keywords[km]=តន្ត្រី ផតខាស់
X-KDE-Keywords[ko]=음악, 팟캐스트
X-KDE-Keywords[lt]=muzika,prenumerata
X-KDE-Keywords[lv]=mūzika,podraide
X-KDE-Keywords[nb]=musikk,podkasting
X-KDE-Keywords[nl]=muziek,podcast
X-KDE-Keywords[pl]=muzyka,podcast
X-KDE-Keywords[pt]=música,podcast
X-KDE-Keywords[pt_BR]=música,podcast
X-KDE-Keywords[ro]=muzică,podcast
X-KDE-Keywords[ru]=music,podcast,музыка,подкаст
X-KDE-Keywords[sk]=hudba,podcast
X-KDE-Keywords[sl]=glasba,podcast
X-KDE-Keywords[sq]=music,podcast
X-KDE-Keywords[sr]=music,podcast,музика,подемисија
X-KDE-Keywords[sr@ijekavian]=music,podcast,музика,подемисија
X-KDE-Keywords[sr@ijekavianlatin]=music,podcast,muzika,podemisija
X-KDE-Keywords[sr@latin]=music,podcast,muzika,podemisija
X-KDE-Keywords[sv]=musik,podsändning
X-KDE-Keywords[tr]=müzik,podcast,pod yayını
X-KDE-Keywords[uk]=music,podcast,музика,трансляція,подкаст
X-KDE-Keywords[x-test]=xxmusicxx,xxpodcastxx
X-KDE-Keywords[zh_CN]=music,podcast,音乐,播客,yinyue,boke
X-KDE-Keywords[zh_TW]=music,podcast
X-KDE-Protocols=http
DBusActivatable=true
Terminal=false
Categories=Qt;KDE;AudioVideo;Audio;Player;

Very often such differences are the result of where the environment is changed.

Some shells have two (or more) different files they read for config depending on how they are started, e.g.. different environment in interactive shells and non-interactive.

For example if the user’s login shell is Bash it won’t be reading .bashrc when starting the Plasma session but would when running in a terminal.

In this case, given the amarok .desktop file, I am wondering though if is launched via “D-Bus Activation” and that has a different environment/cache.

1 Like

I definitely would believe it, I have seen some strange BS in my forty plus years of using these things. It seems Fedora is doing some funky foolishness with either the PATH or the launching of .desktop files. No more than ten minutes ago I just created a new .desktop on a Debian based system and it worked perfectly once I fixed the damn typo I made in the Exec= line for the proper path to the executable. I put all such things in my ~/bin directory which is in my PATH and they just work once the proper file is made.

Thank you! I haven’t exactly figured out how it all works to set the directory search order used in D-Bus Activation, and where in that process it’s putting /usr over ~, but that points me exactly the direction I need to look :slight_smile: