Sign in to follow this  
Followers 0
systems_glitch

Bash Alias to Rename a Terminal Window

1 post in this topic

gist: https://gist.github.com/chapmajs/44d1d064d70b34432ccdc006f80f55c1

 

I wanted a quick command to rename `st` (Suckless Terminal) windows in i3wm since sometimes I have a lot of them open at once, tiled all over the screen. Here's what I came up with:

# I added this snippet to my .bashrc to give me a `rename-window` command when 
# using a terminal (`st`, in my case). Invoke as:
#
# `rename-window "the name you desire"`
#
# If you don't have `xdotool` then we alias an echo so we'll know it's not there.

which xdotool >/dev/null 2>&1
if [ "$?" = "0" ]
then
	alias rename-window='xdotool selectwindow set_window --name'
else
	alias rename-window='echo "xdotool not found"'
fi

 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0