mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 11:17:17 +00:00
Sets yabai to open new windows in focused space
This commit is contained in:
parent
d132cf47b8
commit
c27aaf2cd5
3 changed files with 14 additions and 8 deletions
|
@ -11,6 +11,7 @@
|
|||
editor "${config.programs.emacs.finalPackage.out}/bin/emacsclient" -nw -c
|
||||
|
||||
macos_option_as_alt yes
|
||||
confirm_os_window_close 0
|
||||
'';
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ in {
|
|||
enableScriptingAddition = true;
|
||||
|
||||
config = {
|
||||
window_origin_display = "focused";
|
||||
window_placement = "second_child";
|
||||
window_shadow = "on";
|
||||
window_border = "off";
|
||||
|
@ -70,7 +71,6 @@ in {
|
|||
set +x
|
||||
|
||||
echo "yabai configuration loaded.."
|
||||
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
home = config.home-manager.users.willem;
|
||||
homeDir = config.users.users.willem.home;
|
||||
emacsCfg = home.programs.emacs;
|
||||
kittyCfg = home.programs.kitty;
|
||||
in {
|
||||
services.yabai = {
|
||||
enableScriptingAddition = true;
|
||||
extraConfig = ''
|
||||
|
@ -14,7 +19,7 @@
|
|||
|
||||
environment.etc = {
|
||||
"sudoers.d/yabai".text = ''
|
||||
willem ALL=(root) NOPASSWD: ${pkgs.yabai}/bin/yabai --load-sa
|
||||
%admin ALL=(root) NOPASSWD: ${pkgs.yabai}/bin/yabai --load-sa
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -29,10 +34,10 @@
|
|||
};
|
||||
|
||||
services.skhd.skhdConfig = let
|
||||
yabai = "${pkgs.yabai}/bin/yabai";
|
||||
yabai = "${config.services.yabai.package}/bin/yabai";
|
||||
# Don't use nix emacs. Homebrew has a better version
|
||||
# emacs = "${pkgs.emacs}/bin/emacs";
|
||||
kitty = "${pkgs.kitty}/bin/kitty";
|
||||
kitty = "${kittyCfg.package}/bin/kitty";
|
||||
# Handle any weird inversion bindings
|
||||
cmd = "cmd";
|
||||
ctrl = "ctrl";
|
||||
|
@ -42,7 +47,7 @@
|
|||
cmd - m : :
|
||||
rcmd - w : :
|
||||
|
||||
${ctrl} - return : ${kitty} --single-instance
|
||||
${ctrl} - return : ${kitty} --single-instance --working-directory ${homeDir}
|
||||
|
||||
# Close window
|
||||
${cmd} + shift - c : osascript -e 'tell application "System Events" to perform action "AXPress" of (first button whose subrole is "AXCloseButton") of (first window whose subrole is "AXStandardWindow") of (first process whose frontmost is true)'
|
||||
|
@ -114,8 +119,8 @@
|
|||
${yabai} -m window --toggle border
|
||||
|
||||
# Open Emacs
|
||||
${ctrl} + shift - n : ${kitty} --single-instance ${config.home-manager.users.willem.programs.emacs.finalPackage}/bin/emacsclient -nw -c
|
||||
${ctrl} + shift - n : ${kitty} --single-instance ${emacsCfg.finalPackage}/bin/emacsclient -nw
|
||||
# Open Firefox window
|
||||
${ctrl} + shift - f : /Applications/Firefox.app/Contents/MacOS/firefox -new-window
|
||||
${ctrl} + shift - b : /Applications/Firefox.app/Contents/MacOS/firefox -new-window
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue