in linux, programming

HOWTO Get Custom Icons With Each New XTerm Terminal Window

Use Xterm? Want to have custom icons for each instance like this?

Here’s how you do it:

1. Alias xterm to

xterm -e “;bash”

Save the script below into your $PATH somewhere (and make it executable):


# icon from
# xseticon from
# Solutions from

running=$(ps aux | grep “xterm” | grep -v “grep” | grep -c “xterm”)

if [ “$running” -gt “7” ];then

snark=$(echo $WINDOWID)
xseticon -id $snark /home/MYUSERNAME/.icons/terms/terminal_prompt$running.png
wmctrl -i -r “$snark” -T “xterm”

And get the icons from here: Note that the filenames should be terminal_prompt0.png, terminal_prompt1.png, and so on.


Write a Comment