You are not logged in.
Hi All! If you're like me, you often need a terminal to do quick terminal tasks. If you're very much like me and use several (many) workspaces this can often mean you end up with a bunch of terminals open using resouces and genrally taking up space. Some people have drop-down terminals like guake, and some people use uxrvtd so having multiple terminals open doesn't really affect system resoucres - but I don't really like those options, I prefer to use terminator.
So I wrote this little script, which combined with a hotkey or hotcorner (how I use it) checks to see if terminator is open with a forced title of "QuickTerm". If it is, pull it into focus from wherever it is, if it isn't open, open it, and if it's the active window, close it. It requires wmctrl and xdotool:
#!/bin/bash
# Check for the QuickTerm
qt="$(wmctrl -l | grep QuickTerm)"
# Is QuickTerm open?
if [ -z "$qt" ] ; then
# It's not open, so open it
terminator -T QuickTerm &
elif [ "$(xdotool getwindowfocus getwindowname)" == "QuickTerm" ] ; then
# It's currently active, so close it
wmctrl -c QuickTerm
else
# It's not currently active, so move it to the current workspace and make it active
wmctrl -R QuickTerm
fi
Something I've been thinking about is opening the terminal with screen or tmux, and then the 'elif' statement would including forking the screen session before closing the window, but I'm not sure I want to do that yet. Check it out, let me know what you think!
Last edited by woodape (2015-10-26 19:43:26)
Offline
Just found this little script and I think it's great!
I also put it on hotcorner and it does what it says: Opens a terminal or moves an open terminal from an other desktop or - if a terminal is already open - it closes that window. @woodape has not been online lately but nevertheless thank you for the script!
Offline
PS:
urxvt has a -dockapp switch:
-dockapp
Sets the initial state of the window to WithdrawnState, which makes window managers
that support this extension treat it as a dockapp.
how neat is that.
can the openbox dock be activated with a hotkey?
Offline