You are not logged in.
Hey,
I have a key F1 binded to this shell script:
#!/bin/sh
terminal_open="terminator --geometry=700x500 -T Shell"
terminal_focus="terminator"
# no terminal started, so start one
if [ -z "`wmctrl -lx | grep terminator`" ]; then
$terminal_open &
# terminal is opened, so focus on it
else
wmctrl -x -R $terminal_focus
fi;
If no terminator if opened, it opens one, and if it is, it focuses on already existing one. However, I need it to focus only on the terminator which is named "Shell", ie the terminator opened using this scripts.
How should I edit my script ?
Thanks
Last edited by riddle00 (2015-10-19 17:44:37)
Offline
Assuming you don't have two windows titled exactly "Shell", then -F should work:
-F Window name arguments (<WIN>) are to be treated as exact window
titles that are case sensitive. Without this options window
titles are considered to be case insensitive substrings of the
full window title.
One thing to keep in mind, your script doesn't check to see if a terminator window titled "Shell" exists before attempting to bring it into focus. You only check to see if a terminator window is open.
Offline
Thanks. Also, I found that wmctrl -a seems to work well.
Offline