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 “xicons.sh;bash”

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

#!/bin/bash

# icon from http://www.iconfinder.com/icondetails/17547/48/prompt_terminal_icon
# xseticon from http://www.leonerd.org.uk/code/xseticon/
# Solutions from
# http://superuser.com/questions/363614/leave-xterm-open-after-task-is-complete
# http://unix.stackexchange.com/questions/3197/how-to-identify-which-xterm-a-shell-or-process-is-running-in
# http://unix.stackexchange.com/questions/16774/how-to-assign-an-icon-to-a-program-in-openbox

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

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

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:
http://imgur.com/a/5Q9dn#0 Note that the filenames should be terminal_prompt0.png, terminal_prompt1.png, and so on.

Result:

Popular posts:

  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • SOLVED: Command line BPM (beats per minute) Analysis in Linux
  • Bash string padding with SED
  • The difference between boundaries and rules
  • Everything Is Awful and I'm Not Okay, in multiple formats.
  • Whole house audio, easily, freely, for Linux and MacOSX using SnapCast