You are not logged in.

#1 2017-08-09 15:02:46

ap
Member
Registered: 2017-08-09
Posts: 47

change icon for newly installed programs

Hi there! I am completely new to the BunsenLabs world...have been using Ubuntu for quite a long time but just fell in love with BunsenLabs and am now using it on my main machine smile

I have a question: basically the same 'anonymous' (kind of a blank window icon) icon is displayed for all new programs I have installed (i.e., not those that came already with the BL installation), even though in the newprogram.desktop file for the newly installed program I set Icon=/path/to/icon.png

I know this may be a very simple question, what I want to ask is: how do I change the icon shown in tint2 for when a program is opened?

Thanks!
PS: sorry for my English

Offline

#2 2017-08-09 15:16:38

damo
....moderator....
Registered: 2015-08-20
Posts: 4,315

Re: change icon for newly installed programs

How are you installing these programs? Which icon theme are you using? Most applications will include their own icon, or the icon theme already has it.

Please show the content one of the .desktop files you have, which has a problem.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2017-08-09 16:34:20

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

Hi Damo, thanks for your help. I am installing those programs through 'sudo apt get install'; I am using as icon theme Numix-icon.

For example I have a program (I added a specific repository) called JASP

Its .desktop file contains

[Desktop Entry]
Name=JASP
Comment=Statistical analysis package
Keywords=statistics;data
Exec=jasp %f
Terminal=false
Type=Application
MimeType=application/jasp
StartupNotify=true
Icon=/usr/lib/JASP/Resources/jasp.svg

I have made sure of course that jasp.svg is in the specified path...however when I open the program, rather than its icon I get a kind of window icon. This also happens with some other programs.

Thanks for the help

Offline

#4 2017-08-09 16:56:06

damo
....moderator....
Registered: 2015-08-20
Posts: 4,315

Re: change icon for newly installed programs

The developer of Tint2 suggests

o9000 wrote:

For task icon issues, it's extremely useful to check the openbox Alt+Tab switcher. If the icons look the same as those shown in tint2, then it's not a tint2 problem. If they are different, there is something wrong in tint2 (either the config or the code).


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#5 2017-08-09 17:01:50

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

I have checked and icons look the same as those shown in tint2,so it's not a tint2 problem....any ideas what else can be?

Offline

#6 2017-08-09 17:14:15

damo
....moderator....
Registered: 2015-08-20
Posts: 4,315

Re: change icon for newly installed programs

tint2 wrote:

Taskbar icons are not looked up by tint2, tint2 uses whatever the application sets. Normally, the icon shown by tint2 should be consistent with the icon shown by the openbox alt-tab switcher (it also uses what the application sets).

So....first thing I would try is to see if the svg file renders properly - open it in an image editor or viewer to check.

If it is OK, copy the icon to somewhere else and change the iconpath in the .desktop file to point to it (eg /usr/share/pixmaps, ~/.icons). Or put it in the icon theme you are using - try in "/usr/share/icons/themename/scaleable/apps"

Perhaps the iconpath can just be "Icon=jasp"?


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#7 2017-08-09 18:53:32

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,579

Re: change icon for newly installed programs

Also, there is desktop-file-validate which is part of the package desktop-file-utils, your lts.desktop looks fine thought (You fail to mention where it is located?). The icon should display when observing specific desktop file in thunar (there are bunch in /usr/share/applications for example) < easy way to check.

And finnaly, what happens if you move your desktop file to
~/.local/share/applications
?

edit: typos.

Last edited by brontosaurusrex (2017-08-09 19:34:57)

Offline

#8 2017-08-09 19:07:43

ohnonot
...again
Registered: 2015-09-29
Posts: 3,125
Website

Re: change icon for newly installed programs

why do you need to create/edit a .desktop file for programs installed the usual way?
normally, in most cases, this should all happen automatically.
(though be aware that tint2, openbox, and GTK might behave slightly differently in that respect)

Offline

#9 2017-08-09 22:16:22

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: change icon for newly installed programs

damo wrote:

Or put it in the icon theme you are using - try in "/usr/share/icons/themename/scaleable/apps"

Perhaps the iconpath can just be "Icon=jasp"?

^I'd also suggest this solution (if I'm not mistaken you could also try to put it in  /usr/share/icons/hicolor/scalable/apps ). Otherwise check also the permissions. If the file itself is working, it should be ok. Please check also the tint2 version - as far as I can recall there was something with tint2 and svg-files but it is fixed now.

Offline

#10 2017-08-10 02:05:52

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

Hi, first of all thanks for the great help...it's amazing the kind of support one gets on this forum. I really had messed up my icons but I managed to sort it out for almost all programs following the suggestion damo proposed (although I copied all icons to /usr/share/icons/hicolor/scalable/apps as proposed by matrix rather than to /usr/share/icons/themename/scaleable/apps). Interestingly though, the problem still persist for the one I have put in the example. The .svg renders properly, and it is displayed in thunar observing the specific desktop file, both if my file is in /usr/share/applications or if it's in ~/.local/share/applications. However, when I launch the program, the icon is not displayed correctly on tint2. I also tried putting the icon to  /usr/share/icons/hicolor/scalable/apps or in my theme folder but nothing...also tried with png in case the problem was with svg, but yet the icon didn't show correctly.

Interestingly, I have another machine with lubuntu with the default icon pack and I noticed that actually I get the same icon also there! I mean, the window icon rather than the program icon when I launch this specific program. So, I don't know why but this program does not seem to show the icon properly that is however shown in thunar when one looks at the destop file. Go figure...Not a big deal though, since the remaining programs are now fine...

Thanks again for your help smile

Offline

#11 2017-08-10 08:17:13

damo
....moderator....
Registered: 2015-08-20
Posts: 4,315

Re: change icon for newly installed programs

^ It sounds like that application isn't giving the correct icon information to the window manager. Does the application window itself have the icon in the titlebar?


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#12 2017-08-10 08:21:32

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

Hi damo, no the application window itself doesn't have the proper icon in the titlebar, but still that window like icon

Last edited by ap (2017-08-10 08:22:01)

Offline

#13 2017-08-10 12:59:42

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: change icon for newly installed programs

^It is similar to a tool I just recently installed: yt-get (youtube-downloader). There is a desktop file in /usr/share/applications and yt-get in /usr/bin. In the bl-obmenu-generator dynamic menu and in Thunar for yt-get.desktop I have a different icon from the one in tint2 after opening yt-get. Why? Because in yt-get.desktop there is:

Icon=browser-download

while in the yt-get file

ICON="/tmp/yt.svg"

so in tint2 the yt.svg is shown from the /tmp directory, while in the menu (and Thunar) the browser-download icon from one of the /usr/share/icons directories.

Edit: ...and I used to have a similar issue with Zathura.

Last edited by martix (2017-08-10 13:08:33)

Offline

#14 2017-08-10 13:34:53

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

hi matrix, that's interesting thanks. now, it's not that important for me to change the icon but I like to fully understand things...so I ask you this question more as a curiosity than really as a way to show a single icon for one program. how do you access files in /usr/bin? in my case it's a  binary executable  and I can't read it with a text editor. and also, how to force the /usr/bin file to read the same icon as the .desktop file?
Many thanks!

Offline

#15 2017-08-10 15:39:53

damo
....moderator....
Registered: 2015-08-20
Posts: 4,315

Re: change icon for newly installed programs

^ I suspect that this application doesn't deal with the WM properly. You would need to get the source code and see how the icon is set, then compile the binary. Probably not worth the effort!

There is a utility (not in Debian unfortunately) called "xseticon" that may do the job, but it may not work with Debian 8, and I know it is incompatible with Debian 9. Also it may not deal with applications that don't play nice with Openbox.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#16 2017-08-10 16:18:22

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

I see, that sounds troublemosome and sure not worth the effort, I was just curious. I believe now the issue for which I opened the thread is solved. Regarding the last application I was having a problem with, as damo said it's very likely that it doesn't deal properly with the WM, given that the problem is consistent across various distros as I noticed.  Thanks very much everyone for your great help smile

Offline

#17 2017-08-10 17:12:30

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: change icon for newly installed programs

Actually it's an interesting issue. Where the culprit might be? I don't know, but e.g. creating a jasp launcher in tint2rc via

launcher_item_app = jasp.desktop

(restart tint2) works nicely as it obviously uses the path in the .desktop file. Also jgmenu finds the icon for jasp.

Having a look at the source code here, trying to find a hint regarding icon path (after a search: icon) it reveals that there is also jasp.xml in /usr/share/mime/packages with an "icon name" line. According to this the icon name it uses is jasp.svg. I'm not sure where it looks for that file (obviously not in the "normal" icons directories in /usr/share/icons).

Last edited by martix (2017-08-10 17:16:04)

Offline

#18 2017-08-10 20:05:10

ohnonot
...again
Registered: 2015-09-29
Posts: 3,125
Website

Re: change icon for newly installed programs

ap wrote:

Hi damo, no the application window itself doesn't have the proper icon in the titlebar, but still that window like icon

this is another case for fbpanel.
it has a native "icons" plugin that allows you to replace troublesaome icons with nicer ones.
same rules as for .desktop files, i.e. full path or symbolic name.
the good thing is that you can run fbpanel (a really old gtk2 panel) with ONLY the icons plugin, so you do not see any panel at all, but it still does the icon changing in the background.
advantages over an xseticon script: icons are changed IMMEDIATELY, not only after the window is mapped.

Offline

#19 2017-08-11 01:34:30

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

matrix: creating a jasp launcher in tint2rc via

launcher_item_app = /usr/share/applications/jasp.desktop

(restart tint2) doesn't show the icon of the .desktop file (i.e., the jasp.svg in /usr/lib/JASP/Resources/jasp.svg). To quote damo, I suspect that this application doesn't deal with the WM properly.

Regarding ohnonot observation, I was using fbpanel on SparkyLinux and I agree that it's easier to deal with such issues there. Nonetheless, I am trying to get used to tint2 and so far so good...I am not too bothered for a single icon tbh.

Offline

#20 2017-08-11 03:05:30

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,611
Website

Re: change icon for newly installed programs

damo wrote:

There is a utility (not in Debian unfortunately) called "xseticon" that may do the job, but it may not work with Debian 8, and I know it is incompatible with Debian 9. Also it may not deal with applications that don't play nice with Openbox.

I'm using xseticon to set an icon for Dillo with openbox, on Debian 8. Not good news about D9. neutral (Unless dillo gets its act together of course.)

ohnonot wrote:

another case for fbpanel.
it has a native "icons" plugin that allows you to replace troublesaome icons with nicer ones.
same rules as for .desktop files, i.e. full path or symbolic name.
the good thing is that you can run fbpanel (a really old gtk2 panel) with ONLY the icons plugin, so you do not see any panel at all, but it still does the icon changing in the background.
advantages over an xseticon script: icons are changed IMMEDIATELY, not only after the window is mapped.

This sounds interesting! Thanks for the hint. cool


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#21 2017-08-11 17:33:45

ohnonot
...again
Registered: 2015-09-29
Posts: 3,125
Website

Re: change icon for newly installed programs

ap wrote:

Regarding ohnonot observation, I was using fbpanel on SparkyLinux and I agree that it's easier to deal with such issues there. Nonetheless, I am trying to get used to tint2 and so far so good...I am not too bothered for a single icon tbh.

you can still use tint2!
let fbpanel deal with the troublesome icons, otherwise just forget about it. you do not use the panel!
people seem to have a hard time wrapping their heads around that.
i have used it for years: fbpanel "in the background", changing ugly icons, and another panel (usually tint2) providing the actual panel.

Offline

#22 2017-08-11 19:16:35

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: change icon for newly installed programs

@ap Which tint2 version do you have? Did you have a restart of tint2? The launcher works on 0.12 with that line I mentioned. It's even enough to set

Icon=jasp

in jasp.desktop if you put jasp.svg in the right directory in /usr/share/icons. This also works for e.g. jgmenu or bl-obmenu-generator but not for the tint2 taskbar icon.

This "not showing icon in tint2" issue is rather interesting. First here is what forum member o900, developer of tint2, writes about icons: Some applications simply do not follow the icon theme. ... VLC for example comes with the icon hardcoded in the executable. Others look it up in the theme, but the lookup is buggy; GTK2 sometimes doesn't perform correct lookups if it cannot find a match of a certain size. ... taskbar icons are not looked up by tint2, tint2 uses whatever the application sets. Normally, the icon shown by tint2 should be consistent with the icon shown by the openbox alt-tab switcher (it also uses what the application sets).

When dealing with the JASP issue I had a look at a similar application - keepassx (where the icon works fine). Both apps have those .xml files in /usr/share/mime/application and /usr/share/mime/packages. Here are the automatically generated .xml files with the icon names:

<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/jasp">
  <!--Created automatically by update-mime-database. DO NOT EDIT!-->
  <comment>JASP File</comment>
  <icon name="jasp.svg"/>
  <glob-deleteall/>
  <glob pattern="*.jasp"/>
</mime-type>
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-keepass2">
  <!--Created automatically by update-mime-database. DO NOT EDIT!-->
  <comment>KeePass 2 database</comment>
  <glob pattern="*.kdbx"/>
  <icon name="application-x-keepassx"/>
</mime-type>

I'm not sure whether the jasp line is correct as it is jasp.svg instead of jasp. However: When I removed ALL application-x-keepassx.png files from the /usr/share/... folders and restarted #BĹ, tint2 still showed the correct keepassx icon! Icon=keepassx is defined in keepassx.desktop, but if I change it to - let's say - Icon=firefox, it will change the icon to firefox in the menu, BUT not in tint2 -> it will still show the correct icon.

In the end I made a little experiment: There is BLOB Themes Manager, which I use with a custom .desktop file (so it shows up in dynamic menus). When I change Icon=distributor-logo-bunsenlabs to Icon=firefox in the .desktop file, it will change the icon to firefox in the menu, but not in tint2. However: In /usr/bin/bl-obthemes there are

DIALOG="yad --center --undecorated --borders=20 --window-icon=distributor-logo-bunsenlabs"
DIALOGDEC="yad --center  --borders=20 --window-icon=distributor-logo-bunsenlabs"

where I replaced "distributor-logo-bunsenlabs" by "firefox". Result: In tint2 there was the same (no icon) shown just like with jast. After I copied firefox.svg to /usr/share/icons/hicolor/scalable/places (as this folder had a distributor-logo-bunsenlabs.svg file but no firefox.svg), tint2 finally showed the firefox icon after opening BLOB Themes Manager.

So I think there is probably an easy solution for that icon isssue, but it's just rather hard to find.

Edit: On the jasp github site there is even a hint regarding the icon in use:

[b]Tools/debian/jasp.install[/b]
debian/jasp.desktop usr/share/applications
debian/jasp.svg     usr/share/icons/gnome/scalable/mimetypes/application-jasp.svg
debian/jasp.xml usr/share/mime/packages

but somehow it still does not work.

Last edited by martix (2017-08-11 20:10:49)

Offline

#23 2017-08-12 04:57:02

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,611
Website

Re: change icon for newly installed programs

ohnonot wrote:

fbpanel "in the background", changing ugly icons, and another panel (usually tint2) providing the actual panel.

Working beautifully! Many thanks for that. Any hints for fbpanel global settings to minimize system use? (I've put the size down to 1px, transparent=false)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#24 2017-08-12 05:52:42

ap
Member
Registered: 2017-08-09
Posts: 47

Re: change icon for newly installed programs

@ohnonot thanks for the hint, that's brilliant and I didn't know that! I should be able to tweak fbpanel to my preferences now smile

matrix wrote:

@ap Which tint2 version do you have? Did you have a restart of tint2? The launcher works on 0.12 with that line I mentioned. It's even enough to set

Icon=jasp

in jasp.desktop if you put jasp.svg in the right directory in /usr/share/icons. This also works for e.g. jgmenu or bl-obmenu-generator but not for the tint2 taskbar icon.

This "not showing icon in tint2" issue is rather interesting. First here is what forum member o900, developer of tint2, writes about icons: Some applications simply do not follow the icon theme. ... VLC for example comes with the icon hardcoded in the executable. Others look it up in the theme, but the lookup is buggy; GTK2 sometimes doesn't perform correct lookups if it cannot find a match of a certain size. ... taskbar icons are not looked up by tint2, tint2 uses whatever the application sets. Normally, the icon shown by tint2 should be consistent with the icon shown by the openbox alt-tab switcher (it also uses what the application sets).

@matrix, thanks for the great detailed post. I am on tint2 0.12, and yes I have restarted tint2 every time....as you say in the end, there might be an easy solution for that icon isssue, but it's just rather hard to find. I have done a 1000 different tests at no avail, including all the suggestions that I got here on the forum plus many many other try. As you noticed with the last edit, nothing seems to work in this case to get tint2 read the right icon. Also, as you and o900 have reported, sometimes for various reasons, icons just don't show properly on tint2 and that's the case here...also, given that also on other os I get the same I bet the problem might not be too easy to figure. But really, thanks a lot for the effort you put in helping me with this issue smile

However, the fbpanel solution proposed by ohnonot should now put an end to all this I believe as it's actually pretty straightforward :-D

Thanks again for the help...it's great to see how many people are willing to provide help here!

Offline

#25 2017-08-12 09:58:04

ohnonot
...again
Registered: 2015-09-29
Posts: 3,125
Website

Re: change icon for newly installed programs

johnraff wrote:
ohnonot wrote:

fbpanel "in the background", changing ugly icons, and another panel (usually tint2) providing the actual panel.

Working beautifully! Many thanks for that. Any hints for fbpanel global settings to minimize system use? (I've put the size down to 1px, transparent=false)

glad to hear it still works.
not sure about system resources impact; my thought is that a panel that was always promoted as lightweight and hasn't seen any code change in the last 10 years or so - can't have much impact on the system.
anyhow, here's my most recent ~/.config/fbpanel/iconsonly:

#!conf

Global {
    edge = bottom
    allign = right
    margin = 0
    widthtype = pixel
    heightType = pixel
    width = 0
    height = 0
    transparent = true
    tintcolor = #CCCCAD
    alpha = 0
    setdocktype = false
    setpartialstrut = false
    autohide = false
    heightWhenHidden = 0
    roundcorners = false
    roundcornersradius = 7
    layer = below
    SetLayer = false
    MaxElemHeight = 0
}

# 'icons' plugin lets you customize window icons.
# these changes apply to entire desktop
Plugin {
    type = icons
    config {
#~      DefaultIcon = /usr/share/fbpanel/images/default.xpm
        application {
            icon = utilities-terminal
            #terminal-symbolic
            ClassName = URxvt
        }
        application {
            icon = dialog-password
            # emblem-key emblem-key-symbolic changes-prevent
            ClassName = Keepassx
        }
        application {
            icon = web-browser
            ClassName = QupZilla
        }
        application {
            icon = web-browser
            ClassName = Firefox
        }
        application {
            icon = image-x-generic
            ClassName = feh
        }
        application {
            icon = nethack
            ClassName = glhack
        }
        application {
            icon = extract-archive
            ClassName = Engrampa
        }
        application {
            icon =  message
            ClassName = Xmessage
        }
        application {
            icon =  accessories-calculator
            ClassName = XCalc
        }
        application {
            icon = application-default-icon
            ClassName = albert
        }
        application {
            icon = multimedia-player
            #audio-player
            ClassName = mpv
        }
        application {
            icon = accessories-text-editor
            # format-indent-more
            # emblem-root-symbolic
            # emblem-root
            # text-x-script
            ClassName = Geany
        }
    }
}

Offline

Board footer

Powered by FluxBB