From 071b91758e841847655a2c03d6c67872c713c056 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 28 Nov 2024 09:40:32 +0800 Subject: [PATCH] feat(darwin/aerospace): move-node-to-workspace & float --- home/darwin/aerospace/aerospace.toml | 42 +++++++++++++++++++++------- home/darwin/aerospace/default.nix | 6 ++-- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/home/darwin/aerospace/aerospace.toml b/home/darwin/aerospace/aerospace.toml index ce6f0c9e..a1fefe8d 100644 --- a/home/darwin/aerospace/aerospace.toml +++ b/home/darwin/aerospace/aerospace.toml @@ -127,9 +127,9 @@ alt-4 = 'workspace 4Firefox' alt-5 = 'workspace 5Chrome' alt-6 = 'workspace 6Chat' alt-7 = 'workspace 7Music' -alt-8 = 'workspace 8' -alt-9 = 'workspace 9' -alt-0 = 'workspace 10' +alt-8 = 'workspace 8Mail' +alt-9 = 'workspace 9File' +alt-0 = 'workspace 0Other' # See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace @@ -140,9 +140,9 @@ alt-shift-4 = 'move-node-to-workspace 4Firefox' alt-shift-5 = 'move-node-to-workspace 5Chrome' alt-shift-6 = 'move-node-to-workspace 6Chat' alt-shift-7 = 'move-node-to-workspace 7Music' -alt-shift-8 = 'move-node-to-workspace 8' -alt-shift-9 = 'move-node-to-workspace 9' -alt-shift-0 = 'move-node-to-workspace 10' +alt-shift-8 = 'move-node-to-workspace 8Mail' +alt-shift-9 = 'move-node-to-workspace 9File' +alt-shift-0 = 'move-node-to-workspace 0Other' # See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth alt-tab = 'workspace-back-and-forth' @@ -235,10 +235,32 @@ run = 'move-node-to-workspace 7Music' if.app-id = 'com.netease.163music' run = 'move-node-to-workspace 7Music' +[[on-window-detected]] +if.app-id = 'com.apple.mail' +run = 'move-node-to-workspace 8Mail' + +# calendar +[[on-window-detected]] +if.app-id = 'com.apple.iCal' +run = 'move-node-to-workspace 8Mail' + +[[on-window-detected]] +if.app-id = 'com.apple.finder' +run = ['layout floating', 'move-node-to-workspace 9File'] + +[[on-window-detected]] +if.app-id = 'com.apple.iBooksX' +run = ['layout floating', 'move-node-to-workspace 9File'] + +# Book/Picture Preview +[[on-window-detected]] +if.app-id = 'com.apple.Preview' +run = ['layout floating', 'move-node-to-workspace 9File'] + # Make all windows float by default [[on-window-detected]] check-further-callbacks = true -run = 'layout floating' +run = ['layout floating', 'move-node-to-workspace 0Other'] # ================================================================= # Multiple monitor configuration @@ -252,6 +274,6 @@ run = 'layout floating' 5Chrome = 'secondary' 6Chat = 'main' 7Music = 'main' -8 = 'main' -9 = 'main' -0 = 'main' +8Mail = 'main' +9File = 'main' +0Other = 'main' diff --git a/home/darwin/aerospace/default.nix b/home/darwin/aerospace/default.nix index 09009f4a..6be6f448 100644 --- a/home/darwin/aerospace/default.nix +++ b/home/darwin/aerospace/default.nix @@ -1,3 +1,5 @@ -{ - home.file.".aerospace.toml".source = ./aerospace.toml; +{config, ...}: { + home.file.".aerospace.toml".source = + config.lib.file.mkOutOfStoreSymlink + "${config.home.homeDirectory}/nix-config/home/darwin/aerospace/aerospace.toml"; }