You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got sidetracked on having a hotkey-enabled popup terminal with Aerospace.
e.g.
Hyper-Space summons a terminal window to the top of your screen
Hyper-Space again toggles the window off
(not quite sure why... I've never played Quake or really used a popup terminal... but with all the fun of sending windows to workspaces and monitors it seemed Absolutely Necessary 🤷).
Got it working (listing below) and it seems to work quite well.
But there are a few trade-offs and gotchas. Wondering if anyone has any thoughts on improving it:
Identifying the window is a pain. I originally tried with Wezterm, where wezterm start --class some.fake.app-id looked promising, but seems not to work. (It either retains the main ID, or shows NULL-BUNDLE-ID)
Using the Window title might work? But terminals seem to want to overwrite that, so probably requires some careful configuration.
I settled with just using Terminal, and only having a single window. (e.g. I'll use WezTerm for my persistent windows)
Something like aerospace tag-window "quake" could maybe help, and might be useful for other scripting configurations?
If the terminal is launched, then it first renders in your current layout and is then coerced into floating.
That's a bit ugly, but aerospace enable off then prevents aerospace manipulating it in the background, so not sure what else to do.
aerospace move-node-to-workspace --fail-if-noop still gives an error on noop
Having to shell out to osascript to resize the Terminal window seems a bit redundant from a script for a window manager. But aerospace resize seems to be a noop for floating windows?
Here's the script if you'd like to play with it!
I have it mapped to cmd-ctrl-alt-space = 'exec-and-forget /Users/myname/bin/quake'
#!/bin/bash# Open a Quake / Visor style Terminal at the top of the screenexport PATH=$PATH:/opt/homebrew/bin/
get_term() {
aerospace list-windows --json --all \
| jq -r '.[]|select(.["app-name"] == "Terminal")["window-id"]' \
| head -n1
}
WORKSPACE=$(aerospace list-workspaces --monitor focused --visible)
TERMID=$(get_term)# Start Terminal if not already started.if [ -z"$TERMID" ];then
osascript -e \
'tell application "Terminal" do script activate end tell'
TERMID=$(get_term)else# If we are *already* focused on the Terminal, then hide it
CURR=$(aerospace list-windows --focused | cut -f1 -d"")if [ "$CURR"=="$TERMID" ];then
aerospace move-node-to-workspace --wrap-around next
exit 0
fifi# --fail-if-noop doesn't do anything, so hide failure
aerospace move-node-to-workspace --window-id $TERMID$WORKSPACE2>/dev/null ||true# set window to focused, floating, and positioned at top of screen
aerospace focus --window-id $TERMID
aerospace layout --window-id $TERMID floating
osascript -e 'tell application "Terminal" to set bounds of front window to {0, 0, 2100, 400}'
aerospace focus --window-id $TERMID
aerospace move-mouse window-force-center
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I got sidetracked on having a hotkey-enabled popup terminal with Aerospace.
e.g.
(not quite sure why... I've never played Quake or really used a popup terminal... but with all the fun of sending windows to workspaces and monitors it seemed Absolutely Necessary 🤷).
Got it working (listing below) and it seems to work quite well.
But there are a few trade-offs and gotchas. Wondering if anyone has any thoughts on improving it:
wezterm start --class some.fake.app-id
looked promising, but seems not to work. (It either retains the main ID, or showsNULL-BUNDLE-ID
)Using the Window title might work? But terminals seem to want to overwrite that, so probably requires some careful configuration.
aerospace tag-window "quake"
could maybe help, and might be useful for other scripting configurations?aerospace enable off
then prevents aerospace manipulating it in the background, so not sure what else to do.aerospace move-node-to-workspace --fail-if-noop
still gives an error on noopaerospace resize
seems to be a noop for floating windows?Here's the script if you'd like to play with it!
I have it mapped to
cmd-ctrl-alt-space = 'exec-and-forget /Users/myname/bin/quake'
Beta Was this translation helpful? Give feedback.
All reactions