Quake-like terminal - how to change its size and position

Updated: 2023-09-04T22:00:00Z

Mabox have a little wrapper around terminator, which works like drop-down quake-like terminal.
Keybind for it is super + Grave (tilde) or F12.

By default its size is 75% width and 50% height.
With recent update you can change its size and position. No GUI for that sorry :wink:

How to:

  1. Resize window: Alt + r then resize by mouse.
  2. Move to your prefered place: Alt + m then move by mouse
  3. Hide and show terminal with F12

Next time you start quake-like terminal it will have new size and position.
You can reset settings to default by command:

mabox-terminal reset

Short video :slight_smile:

5 Likes

My quake-terminal is not saving the adjustments in size and position that I save with mabox-terminal save command.

If I resize and move, then do mabox-terminal save inside the same quake terminal that I just opened, everything is OK. Whenever I toggle the visibility of the quake-terminal, position and size are OK, as long as I do not close definitely the quake terminal (exit).

When I call the quake terminal again, the position and size is default, which is not my configuration!

How do I troubleshoot it?

I must say that I do not use the default shortcut because it’s not easy to get the grave accent in Spanish keyboards. I use W-ñ, instead. However, it toggles, and it works.


(Just a tiny extra thing:)
In the User Guide, the instructions say the shortcut is C-, and the video shows W-.
But this shortcut W-` is also used for Exposé (show all windows).


Works for me :slight_smile:

Check file:

cat ~/.config/mabox/.quake-term

Hey!

Great for me to say hello!

There are just coordinates in there. The default coordinates.

I moved the window, saved, cat, but coordinates remain the same.

Did you modified mabox-terminal script?

whereis mabox-terminal

No, I didn’t.

Strange, works for me on all (PC/Laptop/virtual_machines) :thinking:

Anyway, I took a look at the script and simplified it a bit, could you try it?
Now there is no need to type mabox-terminal save anymore.
Geometry is saved automatically with the show/hide action.
Modified script (save it in ~/bin/mabox-terminal).

#!/bin/bash

GEOMETRY_FILE="$HOME/.config/mabox/.quake-term"
NAME="quake-term"

__run() {
ID=$(wmctrl -x -l | grep ${NAME} | awk '{print $1}' | head -n 1)
if [ -z "${ID}" ]; then
    if [ -f "$GEOMETRY_FILE" ]; then
    POS=$(head -n 1 $GEOMETRY_FILE)
    terminator -T ${NAME} -b --geometry "$POS" -i utilities-terminal
    else
	TOP=$(wmctrl -d|grep "*"|awk '{print $8}'|cut -d',' -f2)
	LEFT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1)/8]
	HEIGHT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f2)/2]
	WIDTH=$[${LEFT}*6]
	terminator -T ${NAME} -b --geometry "${WIDTH}x${HEIGHT}+${LEFT}+${TOP}" -i utilities-terminal
    fi
else
	ID_DEC=$((${ID}))
	ACTIVE_WIN_DEC=$(xdotool getactivewindow)
	if [ "${ACTIVE_WIN_DEC}" == "${ID_DEC}" ]; then
		xdotool windowminimize ${ID_DEC}
	else
		xdotool windowactivate ${ID_DEC}
	fi
	eval $(xdotool getwindowgeometry --shell $(xdotool search --name $NAME))
	echo "${WIDTH}x${HEIGHT}+${X}+${Y}" > $GEOMETRY_FILE
fi
}

__reset() {
	rm "$GEOMETRY_FILE"
}

case "$1" in 
	reset) __reset;;
    *) __run;;
esac

exit 0
1 Like

Well, first of all, thanks for helping me. That’s most important.

No, it didn’t solved the thing.

As soon as I close the quake-term windows, the position and size is lost. In this last screenshot, you can see that even I still have the correct new position and size in .quake-term file, the newly quake-like terminal opens in the default position, which is where the terminator program defines as default for default profile. Maybe this last thing got to do something with it.

This is not a deal-breaker thing, so I will further investigate and try to make changes in terminator profiles.

I just want to let you know that this is a fresh Mabox installation because I had problems with my hard disk.

So, thanks, again.

EDIT: Yes, I validated that the default layout in Terminator determines the position of the quake-like terminal. I will test if more than one layout I can handle this…

I just checked on freshly installed latest ISO in Spanish language… but I can’t reproduce.

All works as it should with both system provided script and modified version.

With modified script position is saved to file only when show/hide action is invoked.
So after moving window to save its position just hit F12.

1 Like