Mark a floating window as "Pinned" that follows me between workspaces #833
webdz9r
started this conversation in
feature-ideas
Replies: 1 comment 1 reply
-
My workaround for this was the following, I set in the config: exec-on-workspace-change = [
'/bin/bash', '-c',
'~/.config/aerospace/on-workspace-change.sh $AEROSPACE_PREV_WORKSPACE $AEROSPACE_FOCUSED_WORKSPACE'
] and then I have a script #!/usr/bin/env bash
# Define pinned windows with app-bundle-id:window-title-regex-pattern format
PINNED_WINDOWS=("com.microsoft.Outlook:^.+ Reminder")
####################################################################################################
## Start of script, don't modify beyond this line
####################################################################################################
AEROSPACE_PREV_WORKSPACE=$1
AEROSPACE_FOCUSED_WORKSPACE=$2
# Function to check if a window matches any pinned window criteria
function is_pinned_window() {
local app_id=$1
local window_title=$2
for entry in "${PINNED_WINDOWS[@]}"; do
IFS=':' read -r pinned_app_id pinned_pattern <<< "$entry"
if [[ "$app_id" == "$pinned_app_id" ]] && echo "$window_title" | grep -E -q "$pinned_pattern"; then
return 0
fi
done
return 1
}
# Function to move pinned windows to the focused workspace
function move_pinned_windows_to_focused_workspace() {
aerospace list-windows --all --format '%{window-id} %{app-bundle-id} %{window-title}' | while IFS=' ' read -r window_id app_id window_title; do
if is_pinned_window "$app_id" "$window_title"; then
aerospace move-node-to-workspace --window-id $window_id $AEROSPACE_FOCUSED_WORKSPACE
fi
done
}
# Main logic to handle workspace change
move_pinned_windows_to_focused_workspace |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As a user .... At times (try not to) I have to multi task and switch workspaces. It would be great if I can mark a floating window as pinned (IE: terminal windows with process running) this would mean the pinned floating window will follow me as I navigate between workspaces.
Reason:
This would allow me to keep the window open and floating regardless of the workspace I change so I can monitor my window progress.
Beta Was this translation helpful? Give feedback.
All reactions