Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the xterm icon in xfce4?

Tags:

icons

xterm

xfce

To clarify, I mean the icon that is displayed when the app is running (e.g. inside the dock).

With trial and error, I found out that it uses "/usr/share/pixmap/xfce4-terminal.xpm" as the icon (tested by replacing this file with some other icon).

I was unable to find where it maps the running xterm to this icon.

If I copy the xterm binary to a different name and run that one, it gets a different icon, which shows that there is a possibility to change it.

I already tried setting the "xterm*iconPixmap:" resource, but that appears to have no effect at all.

like image 603
Sec Avatar asked Oct 18 '25 21:10

Sec


2 Answers

I finally managed to do by setting *iconHint on the xterm resource. The value needs to be a path to an .xpm file WITHOUT the extension.

X resources that you want to be loaded at login time need to go into an ~/.Xdefaults file.

So a complete solution for an icon my-xterm.xpm would be:

mkdir ~/.icons
mv my-xterm.xpm ~/.icons/
echo 'xterm*iconHint: '$HOME'/.icons/my-xterm' >> ~/.Xdefaults

If you want your changed ~/.Xdefaults to become active without logging in, run xrdb -merge ~/.Xdefaults

If you just want one xterm to have a different icon, you can start the xterm like this:

xterm -xrm 'xterm*iconHint: /full/path/to/icon' …
like image 188
Sec Avatar answered Oct 22 '25 05:10

Sec


You could try using xseticon

usage: xseticon [options] path/to/icon.png

options:

-name : apply icon to the window of the name supplied -id : apply icon to the window id supplied

Sets the window icon to the specified .png image. The image is loaded from the file at runtime and sent to the X server; thereafter the file does not need to exist, and can be deleted/renamed/modified without the X server or window manager noticing. If no window selection option is specified, the window can be interactively selected using the cursor.

Hints: xseticon -id "$WINDOWID" path/to/icon.png Will set the icon for an xterm.

********** EDIT **********

I think you need the imagemagick program installed to access the convert command. Then, find an icon that you like and convert it to an xbm file:

Code:

convert /path/to/icon/file /path/to/xterm.xbm

Create an ~/.Xresources file with the following content:

Code:

xterm*iconPixmap:   /path/to/xterm.xbm

Then merge in the ~/Xresources file:

Code:

xrdb -merge ~/.Xresources

The update came from: http://forum.xfce.org/viewtopic.php?id=6779

like image 42
gmaniac Avatar answered Oct 22 '25 05:10

gmaniac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!