You are not logged in.

#1 2012-05-26 07:55:56

jiewmeng
Member
Registered: 2012-02-09
Posts: 118

Double Icon on Docky for Sublime Text

5kljD.png

How can I fix this? When I try to pin Sublime Text 2 to Docky, its ok but when I launch Sublime Text 2, it appears as a separate icon/button. It happens sometimes with afew other applications too. Why is it like that and how can I fix it?


Computer Science Student, Web Developer

Offline

#2 2012-05-28 08:41:47

M4he
Member
Registered: 2011-08-11
Posts: 75

Re: Double Icon on Docky for Sublime Text

I'm experiencing the same issue with Plank (lightweight Docky).
I noticed that this happens with applications that seem to call another executable when executed.
They also don't keep the icon assigned to their .desktop file when shown in a dock.
For me it happens with Sublime Text 2, NetBeans and TeamSpeak 3.

Haven't found a solution for this yet though...


Arch - makes me feel right at /home

Offline

#3 2012-06-01 09:02:09

M4he
Member
Registered: 2011-08-11
Posts: 75

Re: Double Icon on Docky for Sublime Text

Found a solution for Docky:

create a file called "sublime_text" that points to subl within /usr/bin/:

/usr/bin/sublime_text

subl "$@"

(This is the only content of the file)

make it executable via chmod +x /usr/bin/sublime_text


now modify the Exec line in your .desktop entry for Sublime Text 2:

/usr/share/applications/sublime-text.desktop

Exec=sublime_text %U

You can now pin Sublime Text to your dock and it is correctly matched to the high resolution icon!

EDIT: added chmod +x to the instruction

EDIT2: this breaks file open support for Sublime Text via file manager (it just opens Sublime Text). I'll look into it...

EDIT3: fixed issue mentioned in 2nd edit by adding "$@" to the code (see above)

Last edited by M4he (2012-06-09 22:35:26)


Arch - makes me feel right at /home

Offline

#4 2012-06-09 17:43:35

M4he
Member
Registered: 2011-08-11
Posts: 75

Re: Double Icon on Docky for Sublime Text

I'm still having problems with opening files when using the above line

subl $1

within the executable.

It is splitting the string whenever there is a space character in it and treating those parts as seperate files.

Example:

Double clicking on "/some/folder/notes" opens up the file "notes" within sublime text.
But double clicking on "/some/folder/notes 2" opens up the file "notes" and a new file named "2" within sublime text.

Is it possible to fix this behaviour somehow without solely relying on the original sublime text executable?

Last edited by M4he (2012-06-09 17:45:03)


Arch - makes me feel right at /home

Offline

#5 2012-06-09 17:47:15

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Double Icon on Docky for Sublime Text

Try subl $@

Offline

#6 2012-06-09 22:33:48

M4he
Member
Registered: 2011-08-11
Posts: 75

Re: Double Icon on Docky for Sublime Text

JokerBoy wrote:

Try subl $@

It seems to work if you add quotes to it:

subl "$@"

I'll add this to my post above.

Thanks for your help, JokerBoy!


Arch - makes me feel right at /home

Offline

Board footer

Powered by FluxBB