tenseleyflow/ndotfiles / 4827088

Browse files

workspace swap script

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
4827088859db9aa8a602fe90727ef976dbf1ba58
Parents
78cca14
Tree
a8d6a21

2 changed files

StatusFile+-
A Script/morkgui 26 0
M aerospace/aerospace.toml 11 5
Script/morkguiadded
@@ -0,0 +1,26 @@
1
+#!/usr/bin/env bash
2
+# If not running in a terminal, spawn a new WezTerm window to run this script
3
+if [ -z "$TERM" ] || [[ "$TERM" == "dumb" ]]; then
4
+  exec wezterm start -- bash -lc "$0"
5
+fi
6
+# move_workspace_fzf.sh — choose source & target via fzf
7
+
8
+# grab all workspace names
9
+mapfile -t WKS < <(aerospace list-workspaces --all --format '%{workspace}')
10
+
11
+# interactive picks
12
+SRC=$(printf '%s\n' "${WKS[@]}" | fzf --prompt="Move from workspace: ")
13
+[ -z "$SRC" ] && exit 1
14
+
15
+DST=$(printf '%s\n' "${WKS[@]}" | fzf --prompt="Move to workspace: ")
16
+[ -z "$DST" ] && exit 1
17
+
18
+# collect and move
19
+mapfile -t WINS < <(aerospace list-windows --all --format '%{window-id},%{workspace}' | \
20
+                   awk -F',' -v WS="$SRC" '$2==WS {print $1}')
21
+for win in "${WINS[@]}"; do
22
+  aerospace move-node-to-workspace "$DST" --window-id "$win" --focus-follows-window
23
+done
24
+
25
+# finally, jump you over
26
+aerospace workspace "$DST"
aerospace/aerospace.tomlmodified
@@ -44,7 +44,7 @@ start-at-login = true
4444
 # This is for aerospace
4545
 # post-startup, not the machine
4646
 # For commands, see: https://nikitabobko.github.io/AeroSpace/commands
47
-after-startup-command = ['exec-and-forget ghostty']
47
+after-startup-command = ['exec-and-forget wezterm']
4848
 
4949
 # :::
5050
 # Normalizations, nothing
@@ -236,7 +236,7 @@ ctrl-shift-i = 'move-node-to-workspace I --focus-follows-window'
236236
 # ctrl-shift-g = 'move-node-to-workspace G --focus-follows-window'
237237
 ctrl-shift-m = 'move-node-to-workspace M --focus-follows-window'
238238
 ctrl-shift-s = 'move-node-to-workspace S --focus-follows-window'
239
-ctrl-shift-x = 'move-node-to-workspace X --focus-follows-window'
239
+ctrl-shift-f = 'move-node-to-workspace F --focus-follows-window'
240240
 ctrl-shift-w = 'move-node-to-workspace W --focus-follows-window'
241241
 ctrl-shift-z = 'move-node-to-workspace Z --focus-follows-window'
242242
 
@@ -273,6 +273,12 @@ ctrl-alt-shift-minus = 'resize smart -150'
273273
 ctrl-alt-shift-equal = 'resize smart +150'
274274
 
275275
 
276
+ctrl-alt-shift-m = [
277
+  "exec-and-forget alacritty -e bash -lc 'morkgui'",
278
+  "mode main"
279
+]
280
+
281
+# FIXME
276282
 ctrl-alt-shift-w = [
277283
   'exec-and-forget open -n -a WezTerm --args --title WezFloat',
278284
   'mode main'
@@ -324,7 +330,7 @@ ctrl-alt-shift-w = [
324330
   run = 'layout floating'
325331
 
326332
 [[on-window-detected]]
327
-  if.app-name-regex-substring = '(?i)^(reminders|siri|weather|books|clock|notes|ghostty)'
333
+  if.app-name-regex-substring = '(?i)^(reminders|siri|weather|books|clock|notes|ghostty|terminal|alacritty)'
328334
   run = 'layout floating'
329335
 
330336
 
@@ -379,7 +385,7 @@ run = [
379385
 if.app-name-regex-substring = '(?i)firefox'
380386
 run = [
381387
 	'layout tiling',
382
-	'move-node-to-workspace B',
388
+	'move-node-to-workspace F',
383389
 ]
384390
 
385391
 # [[on-window-detected]]
@@ -455,7 +461,7 @@ run = 'layout tiling'
455461
   z = ['exec-and-forget open -a /Applications/Zen.app', 'mode main']
456462
   s = ['exec-and-forget open -a /Applications/Slack.app', 'mode main']
457463
   w = ['exec-and-forget open -a WezTerm', 'mode main']
458
-  x = ['exec-and-forget open -a /Applications/Firefox.app', 'mode main']
464
+  f = ['exec-and-forget open -a /Applications/Firefox.app', 'mode main']
459465
   g = ['exec-and-forget open -a /Applications/Ghostty.app', 'mode main']
460466
   i = ['exec-and-forget open -a /Applications/Discord.app', 'mode main']
461467
   a = ['exec-and-forget open -a /Applications/Audacity.app', 'mode main']