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
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,785

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.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

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
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,785

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.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

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
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,785

Re: Set icons for the window bottons plugin

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


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

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

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,785

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


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

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
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,785

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.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

Board footer

Powered by FluxBB