You are not logged in.

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

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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: 12,560
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)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

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: 5,592

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

#26 2017-08-14 23:45:44

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

Re: change icon for newly installed programs

@ap That's surprising as tint2 handles icons for launchers in a simple way (using the Icon= line in the .desktop file). If there is in /usr/share/applications/jasp.desktop

Icon=jasp

tint2 will look for an icon named jasp.png or jasp.svg (or even xpm, etc.).

Now in tint2.rc we can define

launcher_item_app = jasp.desktop
launcher_icon_theme = gnome

which means tint2 will get back to that icon line, so it will search for a jasp.* file in /usr/share/icons (and also usr/share/pixmaps). If the theme is given as gnome, it will use the /usr/share/icons/gnome directory, where there is an index.theme file. This file points to the subdirectories. There are directories after icon-sizes like 8x8, 16x16, 22x22, etc. Now the 8x8 directory is NOT mentioned in index.theme as it points to directories from 16x16 upwards. If there is a jasp.svg file in the 16x16 folder already, it will be shown in tint2 as a launcher icon (after a restart). [It's also possible to put jasp.svg in /usr/share/pixmaps and that file will be used for the launcher if there is no specific file for the icon theme].

This is different from the menu by bl-obmenu-generator, because that menu uses /usr/share/icons/gnome/scalable/mimetypes/jasp.svg (interestingly jasp.png does not work here). Why? Because it's defined in jasp itself (see my post above) - if I remove that .svg file, there is no icon in the menu for jasp. Now the question arises: If it is shown in the menu by bl-obmenu-generator, why it is not there in the tint2 panel? It might have something to do with application-jasp.svg (if I recall correctly it's a symlink to /usr/share/JASP/Resources/jasp.svg)

Btw I checked keepassx too. Those icon lines in the .xml files don't do much as keepassx only uses the icons called keepassx (and not application-x-keepassx). So if keepassx is opened, this is the icon file used by tint2: /usr/share/icons/hicolor/16x16/apps/keepassx.png (if I remember correctly this hicolor directory is a fallback folder if there is no theme-specific file).

Offline

#27 2017-08-16 02:46:13

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: change icon for newly installed programs

ohnonot wrote:
johnraff wrote:
ohnonot wrote:

fbpanel "in the background", changing ugly icons...

Any hints for fbpanel global settings to minimize system use?

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.

No, not much, but still at 0.3% of 4G RAM it's in the same league as conky, xfce4-power-manager, tint2 (0.4%)... sure there are things around using much more than that.

anyhow, here's my most recent ~/.config/fbpanel/iconsonly

Thanks!


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#28 2017-08-16 06:01:05

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

Re: change icon for newly installed programs

@matrix thanks very much for the detailed response, that's interesting and I'll keep it in mind for the future. However, regarding the specific problems for which I opened this thread, I used the fbpanel solution proposed here and I have customized my fbpanel nicely and am pretty happy with that so I am not going to try further modifications, also given the amount of time I have spent on this issue. Nonetheless, thanks for the help, it has really helped me understand the whole issue better.
AP

Offline

#29 2017-09-16 13:26:07

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

Re: change icon for newly installed programs

Hi all, I post here again because I have a related question.

I believe some of you are familiar with xseticon. I managed to install xseticon (quite tricky installation) and for most applications (except one!) that have an executable I can use a script similar to the one that is here

https://forum.xfce.org/viewtopic.php?id=10845

Basically something like

#!/bin/bash

### EDIT THESE VALUES #########################################################
APP="/usr/bin/executable"       # path to real executable
ICON="/full/path/to/png/icon"          # icon file - only png supported
WAIT=2                              # wait time for application window to display - adjust to suit
###############################################################################

###############################################################################
### DON'T CHANGE ANYTHING BELOW
###############################################################################
function change-panel-icon {

    sleep $WAIT
    activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
    activeWinId="${activeWinLine:40}"

    xseticon -id "$activeWinId" "$ICON"
}

$APP & change-panel-icon

My question is: how can I adapt this for feh? Once I open feh, the icon on the taskbar is not displayed correctly. However if I use the executable above, I input /usr/bin/feh as APP, feh won't even open. Someone has an idea on how to use xseticon for feh? Thanks :-D

Last edited by ap (2017-09-16 13:26:45)

Offline

Board footer

Powered by FluxBB