ubuntu改变terminal window title
在网上找到的方法:
This approach uses xprop and xdotool
#!/bin/bash
# file name: set-title
# uses: xprop and xdotool
# requires 1 argument which is
# desired title string
# Determines what the currently focused
# window is and then its title to $1
thisWindow=`xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{ print $5}'`
xdotool set_window --name $1 $thisWindow
另外这个方法可以暂时地改变窗口标题,但是当回到命令提示符的时候窗口标题会变回原来的。
echo -en "\033]2;$1\007"; sleep 3

浙公网安备 33010602011771号