Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-04-19 17:54:55

yolo7398
Member
Registered: 2017-04-19
Posts: 7

Set icons for the window bottons plugin

I am using xfce 4.12 on ubuntu 17.04. The window buttons plugin is not showing the correct application icon for some applications, specifically for sublime text 2, foxit reader and lollypop. I have checked the .desktop files and they have the path to the icons. Whisker menu is also showing the correct icons. Can someone tell me where the window buttons plugin gets its icons from so that I can manually set the icons for these applications. You can find a screenshot here:

http://imgur.com/t3ZKtrq

Last edited by yolo7398 (2017-04-19 17:55:21)

Offline

#2 2017-04-19 19:29:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,488

Re: Set icons for the window bottons plugin

Hello and welcome.

yolo7398 wrote:

Can someone tell me where the window buttons plugin gets its icons from so that I can manually set the icons for these applications.

The Window Buttons (tasklist) plugin uses libwnck to extract the icon information from the application's supported Extended Window Manager Hints. Lollypop doesn't seem to provide an icon. You can view this by running "xprop" and clicking on the Lollypop window and comparing the results with doing the same on an app that does provide an icon like xfce4-terminal or mousepad.

You can, however, still set an icon that the tasklist plugin will use in place of the default one that is displayed now. Please refer to this thread for more information.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-04-19 22:51:44

yolo7398
Member
Registered: 2017-04-19
Posts: 7

Re: Set icons for the window bottons plugin

I tried out the information in the thread. I installed xseticon and solved all of its dependency problems. Then I tried the script that was in the thread but it did not work, so I wrote my own script as shown below:

#!/bin/bash

ICON="/home/pranav/.local/share/applications/lollypop.png"    	  # icon file - only png supported
WAIT=1                			  # wait time for application window to display - adjust to suit

sleep $WAIT
activeWinName=$(xdotool getwindowfocus getwindowname)
xseticon -name "$activeWinName" "$ICON"

Then I edited the .desktop file for lollypop to launch this script along with the application. It works for lollypop but not for Foxit Reader or Sublime Text. I had tried adjusting the wait time but still no result.

Offline

#4 2017-04-19 23:13:09

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,488

Re: Set icons for the window bottons plugin

Your script is missing the executable. For example, here is the script that I use for sublime text 3:

#!/bin/bash

### EDIT THESE VALUES #########################################################
APP="/usr/bin/subl3"
ICON="/usr/share/icons/Vibrancy-Colors/apps/32/sublime-text.png" 
WAIT=2          
###############################################################################

###############################################################################
### 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

The file is saved as /usr/local/bin/subl3 and made executable so I don't have to change anything in the .desktop file.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2017-04-20 15:51:53

yolo7398
Member
Registered: 2017-04-19
Posts: 7

Re: Set icons for the window bottons plugin

I tried using this script but it does not work. When I launch lollypop, it launches the application and the script, then the script changes the icon and terminates. For sublime text, both the application and the script get executed but the icon does not change and the script remains active until I close sublime text.

Offline

#6 2017-04-20 20:17:45

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,488

Re: Set icons for the window bottons plugin

Can you post the contents of the scripts that you are using?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2017-04-20 23:56:55

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,488

Re: Set icons for the window bottons plugin

Just tried it on my Xubuntu 17.04 install and ran into some issues. Here is what I did to get it to work.

1. Download the correct architecture version of xseticon.
2. Extract the xseticon from that archive and place is in /usr/local/bin
3. Go to your architecture's lib directory  -> /usr/lib/$(uname -m)-linux-gnu
4. Create a symbolic link to libgd:

sudo ln -s libgd.so.3.0.4 libgd.so.2

5. Run:

ldconfig

6. Then use the following script for lollypop:

#!/bin/bash

### EDIT THESE VALUES #########################################################
APP="/usr/bin/lollypop"
ICON="/usr/local/share/lollypop.png"                                  
WAIT=2          
###############################################################################

###############################################################################
### 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

...make sure you point to the correct png icon file you want to use.

screenshot2017-04-2019-59-15.png


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2017-04-21 11:34:19

yolo7398
Member
Registered: 2017-04-19
Posts: 7

Re: Set icons for the window bottons plugin

There was a typo in my script for sublime text. It works now. Thank for your help

Offline

#9 2017-04-21 11:38:40

yolo7398
Member
Registered: 2017-04-19
Posts: 7

Re: Set icons for the window bottons plugin

Although this is slightly off-topic and my problem has been solved. Can you tell me why my initial script worked for lollypop but not for sublime text?

Offline

#10 2017-04-21 23:26:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,488

Re: Set icons for the window bottons plugin

Your original script, at least the one posted above in comment #3, doesn't actually start lollypop. It's missing the executable. All it does is change the current terminal icon to the lollypop icon. Even adding the executable to start the lollypop app doesn't chane it's icon for me. The only way I can get the icon to properly change is by using the script I posted.

If you want to post the sublime script that didn't work, I can test that one out for you as well.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#11 2020-08-21 08:58:54

antisa
Member
Registered: 2012-02-12
Posts: 4

Re: Set icons for the window bottons plugin

Hello guys,

sorry for necroposting but I think this is relevant.

So I think the issue here arises from the fact that the icon name and the program name differ in .desktop file.

For example, I have my own app I am developing and I wrote a .desktop file for it. At the start, my Exec line contained the path to the executable at /usr/bin and Icon line had a path to /usr/share/pixmaps/. However the name of the executable was slightly different than the icon name itself. The program, when installed, shows the icon in Whisker menu and if I put the shortcut file on desktop, however no icon was shown when the program was running, only that blank icon - white window thingy.

Once I named my icon exactly like my executable name the icon started showing in the window buttons plugin on xfce panel.

I've tested this with Skype and Slack which show their icons correctly when installed because as mentioned before, the entries in .desktop files for Exec= and Icon= lines have the same name. Then I proceded to rename those icons and as expected their icons no longer showed  in window buttons.

I'm on Xubuntu 20.04.1, Xfce 4.14.3.

Hopefully this helps someone!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.015 seconds, 8 queries executed - Memory usage: 589.56 KiB (Peak: 606.41 KiB) ]