nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
6.22k stars 101 forks source link

exec-and-forget not working #287

Closed suvasanket closed 2 months ago

suvasanket commented 3 months ago

so i'm using emacs with

after-startup-command = [
    'exec-and-forget /opt/homebrew/opt/sketchybar/bin/sketchybar',
    'exec-and-forget /usr/local/bin/emacs --daemon'
]

this for running the daemon and to open a new frame

alt-e = ['workspace 1','exec-and-forget emacsclient -a "" -c "$@"']

everything was working just fine but after some restarts of aerospace it doesn't seems to opening the "emacs frame" anymore the daemon is running fine though

DieracDelta commented 2 months ago

Did you ever come to a resolution to this? I'm running into the same issue (except the frame spawning never worked).

DieracDelta commented 2 months ago

I actually have it working now. I'm actually running a script instead. The script looks like:

#/usr/bin/env bash
/run/current-system/sw/bin/emacsclient -c --no-wait --socket=$(lsof -c emacs | grep server | grep -E -o '[^[:blank:]]*$' | tail -n 1)

worth noting I'm on nix. The problem I was encountering was that emacsclient wasn't in my path.

suvasanket commented 2 months ago

Great, just a tip if you want to open the client right from the launchpad or any app launcher like alfred you can create a automator application workflow then you can set a keybind to open that or just use it like any other app

lentil32 commented 2 months ago

Refer to my config if you are using Nix:

file."${config.xdg.configHome}/aerospace/aerospace.toml".text = ''
      # Some configs...

      # open programs
      [mode.programs.binding]
      e = [ 'exec-and-forget ${pkgs.emacs}/bin/emacsclient -ca ""', 'mode main' ]
      f = [ 'exec-and-forget open -na "Firefox Developer Edition"', 'mode main' ]
      a = [ 'exec-and-forget open -na Alacritty', 'mode main' ]
      enter = 'mode main'
      esc = 'mode main'

      # Some configs...
''

I'm on MacOS nix-darwin + nix home-manager setting. Emacs is installed through nix. It works for me.

cristian-heredia commented 1 month ago

Refer to my config if you are using Nix:

file."${config.xdg.configHome}/aerospace/aerospace.toml".text = ''
      # Some configs...

      # open programs
      [mode.programs.binding]
      e = [ 'exec-and-forget ${pkgs.emacs}/bin/emacsclient -ca ""', 'mode main' ]
      f = [ 'exec-and-forget open -na "Firefox Developer Edition"', 'mode main' ]
      a = [ 'exec-and-forget open -na Alacritty', 'mode main' ]
      enter = 'mode main'
      esc = 'mode main'

      # Some configs...
''

I'm on MacOS nix-darwin + nix home-manager setting. Emacs is installed through nix. It works for me.

@lentil32 did you install aerospace with nix? If so can you share your flake file?

lentil32 commented 1 month ago

Refer to my config if you are using Nix:


file."${config.xdg.configHome}/aerospace/aerospace.toml".text = ''

      # Some configs...

      # open programs

      [mode.programs.binding]

      e = [ 'exec-and-forget ${pkgs.emacs}/bin/emacsclient -ca ""', 'mode main' ]

      f = [ 'exec-and-forget open -na "Firefox Developer Edition"', 'mode main' ]

      a = [ 'exec-and-forget open -na Alacritty', 'mode main' ]

      enter = 'mode main'

      esc = 'mode main'

      # Some configs...

''

I'm on MacOS nix-darwin + nix home-manager setting. Emacs is installed through nix. It works for me.

@lentil32 did you install aerospace with nix? If so can you share your flake file?

I installed AeroSpace with brew, but it's declaratively configured in apps.nix. Please refer to my repository: https://github.com/lentil32/dotfiles-nix/blob/main/modules/apps.nix

cristian-heredia commented 1 month ago

https://github.com/lentil32/dotfiles-nix/blob/main/modules/apps.nix @lentil32 thank you!