Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
.desktop file not working on KDE!
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Wed Aug 01, 2018 5:50 pm    Post subject: .desktop file not working on KDE! Reply with quote

Hi

I've a little problem with my .desktop-file.

i created this file:

Code:

[Desktop Entry]
Name=Teamspeak 3 Client
GenericName=Teamspeak
Icon=/usr/local/share/teamspeak/teamspeak.png
Terminal=false
Exec=/usr/local/bin/teamspeak
StartupNotify=true
Version=1.0
Type=Application
Categories=Network


desktop-file-validate doesn't show me any error in the file itself, BUUUUUUUUUUUUUUUUUUT

the file doesn't work on KDE!

Gnome = working!
KDE = Not working!

Btw it doesn't matte if i put the file into /usr/share/applications, /usr/local/share/applications or ~/.local/share/applications, it's not working on KDE![/quote]

Can someone tell me wtf the problem is?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Thu Aug 02, 2018 1:42 am    Post subject: Reply with quote

The problem is that you did not tell us how it fails. "Does not work" is a very vague problem description. What did you do that you expected to work? What did the system do in response? What error messages did it print?
Back to top
View user's profile Send private message
mega_flow
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jun 2016
Posts: 84
Location: Belgium

PostPosted: Thu Aug 02, 2018 11:19 am    Post subject: Reply with quote

I create a Desktop file for world of warcraft and this work for me
Code:
[Desktop Entry]
Name=Battle.net
Comment=Blizzard® Battle.net® app
Exec=/home/user/bin/Battle.net
Icon=56B4_Battle.net Launcher.0
Type=Application
Categories=Game;Network;
Actions=Wow64;

[Desktop Action Wow64]
Name=World Of Warcraft
Exec=/home/user/bin/Wow64


kde plasma have a default menu-edit. Right click on the start icon
U cant create 1 for your app. This way
Back to top
View user's profile Send private message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Thu Aug 02, 2018 10:05 pm    Post subject: Reply with quote

Hu wrote:
The problem is that you did not tell us how it fails. "Does not work" is a very vague problem description. What did you do that you expected to work? What did the system do in response? What error messages did it print?


I click on the entry in the menu and for 1 second the icon/window-indicator appears in the taskbar and disappears... thats it..

No error message.. nothing...

Code:
[pycoder@gentoo applications]$ desktop-file-validate teamspeak.desktop
[pycoder@gentoo applications]$ pwd
/usr/share/applications
[pycoder@gentoo applications]$ cat teamspeak.desktop
[Desktop Entry]
Name=Teamspeak 3 Client
Comment=Teamspeak Client to communicate with other people
GenericName=Teamspeak
Icon=/usr/local/share/teamspeak/teamspeak.png
Terminal=false
Exec=/usr/local/bin/teamspeak
StartupNotify=true
Version=1.0
Type=Application
Categories=Network
[pycoder@gentoo applications]$


The file is valid, but doesn't work on KDE but on the other hand the file works on Gnome!

UPDATE: with "EXEC= sh /usr/local/bin/teamspeak" it works on KDE... WTF!

Why does it need "sh" on KDE but not on Gnome? It's working via terminal only with "teamspeak" and the teamspeak has the shebang (#!/bin/bash) and is executable!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Fri Aug 03, 2018 12:44 am    Post subject: Reply with quote

Appearing briefly and then vanishing is not the form of failure I first associate with "does not work", since it does work very briefly.

As for why it works in one and not the other, I suspect there are differences in how the program is executed. dev-util/strace could tell you exactly how the two paths differ.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Fri Aug 03, 2018 1:16 am    Post subject: Reply with quote

Quote:
Why does it need "sh" on KDE but not on Gnome? It's working via terminal only with "teamspeak" and the teamspeak has the shebang (#!/bin/bash) and is executable!


Ok, you are saying it runs fine if it is run in a terminal window, so shouldn't you also set

Code:
Terminal=true
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Aug 03, 2018 10:18 am    Post subject: Reply with quote

ct85711 wrote:
Quote:
Why does it need "sh" on KDE but not on Gnome? It's working via terminal only with "teamspeak" and the teamspeak has the shebang (#!/bin/bash) and is executable!


Ok, you are saying it runs fine if it is run in a terminal window, so shouldn't you also set

Code:
Terminal=true

Well spotted.

To launch a Bash script in a minimised terminal window, I use xterm with the '-iconic' X Toolkit Option, as follows:

Code:
Exec=xterm -iconic -e "bash -c /usr/local/bin/teamspeak"
Terminal=false

Setting 'Terminal' to 'false' is counter-intuitive but works if Exec is done this way. On the other hand, if one does not mind if the window is not minimised:

Code:
Exec=xterm -e "bash -c /usr/local/bin/teamspeak"
Terminal=false

or, to launch in Konsole rather than in xterm:
Code:
Exec=bash -c /usr/local/bin/teamspeak
Terminal=true

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Fri Aug 03, 2018 11:34 am    Post subject: Reply with quote

Hi guys

thanks for the respond...

The question is now.. "why does it work on gnome without "sh" (terminal) but not in kde", i mean they should follow the specifications of freedesktop?


Whatever, i thank you all for the help and set it to "solved" :)
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Aug 03, 2018 12:41 pm    Post subject: Reply with quote

With 'Terminal=true' you need to check which terminal program each DE is launching based on the key you specified in 'Exec='. KDE by default uses Konsole and GNOME by default uses gnome-terminal, i.e. two completely different programs, and their default behaviour and options could be different (have a look at their man pages).

Have a look at the Bash script itself, in case it contains any clues. I don't have TeamSpeak installed, but I do have a Bash script which I can launch successfully in KDE by double-clicking on a .desktop file containing the following:

Code:
Exec=/home/fitzcarraldo/keep_mouse_moving.sh
Terminal=false

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum