Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-12-21 15:01:32

iuomo
Member
Registered: 2013-12-07
Posts: 21

created icon for open windows

I am building a application and I will create the  app.desktop file in   /usr/share/applications

I believe the desktop icon go in /usr/share/pixmaps/

Where do the icons get placed for the Windows button?

Offline

#2 2017-12-21 17:52:05

PCNetSpec
Member
Registered: 2017-12-21
Posts: 4

Re: created icon for open windows

Window buttons are part of whatever xfwm4 (Xfce window manager) theme you are currently using .. these themes are located at:-
/usr/share/themes/<name of theme you're currently using>/xfwm4
(for system-wide themes)

or
~/.themes/<name of theme you're currently using>/xfwm4
(for themes installed only for the specific user)

So if you want your own custom window buttons, you're also going to need to write your own xfwm4 theme (or edit an existing one), but there's no way for your application to pick up these window buttons unless the user changes xfwm4 theme to yours (or you script a theme change as part of the installation, which I'll guarantee won't please people as it will change the theming of their entire system).

As far as I'm aware their's no way to override xfwm4 window decoration themes on a per application basis

Last edited by PCNetSpec (2017-12-21 18:16:13)

Offline

#3 2017-12-21 20:53:11

iuomo
Member
Registered: 2013-12-07
Posts: 21

Re: created icon for open windows

thank you very much.  makes sense now!

Offline

#4 2017-12-22 00:15:19

PCNetSpec
Member
Registered: 2017-12-21
Posts: 4

Re: created icon for open windows

You're most welcome iuomo.

Offline

#5 2017-12-25 22:06:04

Misko_2083
Member
Registered: 2015-10-13
Posts: 77
Website

Re: created icon for open windows

iuomo You can set the window icon with xseticon http://www.leonerd.org.uk/code/xseticon/.

Edit----------------

Found my notes for comiling xseticon on debian:

Install build depends: sudo apt install libx11-dev libxmu-dev libgd2-xpm-dev
Also make sure you have installed build-essential and pkg-config

download the tar.gz file and extract it.
Open the text editor and patch the xseticon.c and Makefile

Patch to make it comipile:

xseticon.c line 312:

    printf("Have selected window 0x%08x\n", window);

change it to

    printf("Have selected window 0x%08lx\n", window);

xseticon.c at line 32 add next:

#include <string.h>

Patch the Makefile:
Line 21

	gcc ${LIBS} $^ -o $@

Replace it with:

	 gcc $^ -o $@ ${LIBS}

Then open terminal and change directory to the folder you extracted

cd ~/Downloads/xseticon-0.1+bzr13

run make

make

Don't run "sudo make install" just copy the binary to the home dir /home/USER/bin
and use it to set the icon.

You'll need a wrapper script for each application.

This is an example for zathura app:

#!/bin/bash
zathura $@ & APP_PID=$!
until xdotool getwindowname $(xdotool search --pid "$APP_PID" | tail -1) &>/dev/null; do   # sleep until the window opens
        sleep 0.1        
done
# One second extra
sleep 1
# get window name
WINDOW_NAME="$(xprop -id  $(xdotool search --pid "$APP_PID" | tail -1) _NET_WM_NAME | awk -F'"' '{print $2}')"
~/path/to/xseticon -name "$WINDOW_NAME" /path/to/icon.png
wait $APP_PID
echo $?

Last edited by Misko_2083 (2017-12-25 23:16:06)

Offline

#6 2017-12-25 23:27:18

Misko_2083
Member
Registered: 2015-10-13
Posts: 77
Website

Re: created icon for open windows

It's been a long day big_smile
I've just realised that I've read window icons instead of window

buttons

Sorry fellows...

Offline

Board footer

Powered by FluxBB