From fe986aec3bf0d12d67496157a1665b35177ff331 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 18 Jun 2024 00:02:32 +0200 Subject: [PATCH] amethyst, nvim: updates --- home/config/nvim/nifoc/statuscolumn.fnl | 2 +- home/hosts/Styx.nix | 1 + home/programs/aerospace.nix | 61 ---------------- home/programs/amethyst.nix | 97 +++++++++++++++++++++++++ home/programs/fish.nix | 4 + home/programs/nvim/default.nix | 2 +- system/hosts/Styx.nix | 4 +- 7 files changed, 106 insertions(+), 65 deletions(-) delete mode 100644 home/programs/aerospace.nix create mode 100644 home/programs/amethyst.nix diff --git a/home/config/nvim/nifoc/statuscolumn.fnl b/home/config/nvim/nifoc/statuscolumn.fnl index 20f7b34..f71f5ca 100644 --- a/home/config/nvim/nifoc/statuscolumn.fnl +++ b/home/config/nvim/nifoc/statuscolumn.fnl @@ -7,7 +7,7 @@ statusline (require :nifoc.statusline) diagnostic vim.diagnostic gitsigns (require :gitsigns) - gitsigns-ns (api.nvim_create_namespace :gitsigns_extmark_signs_) + gitsigns-ns (api.nvim_create_namespace :gitsigns_signs_) augroup (vim.api.nvim_create_augroup :NifocStatuscolumn {:clear true}) aucmd vim.api.nvim_create_autocmd] ;; Cache diff --git a/home/hosts/Styx.nix b/home/hosts/Styx.nix index fb1bb76..7268ce5 100644 --- a/home/hosts/Styx.nix +++ b/home/hosts/Styx.nix @@ -15,6 +15,7 @@ in ../programs/starship.nix ../programs/zoxide.nix + ../programs/amethyst.nix ../programs/wezterm.nix ../programs/nvim diff --git a/home/programs/aerospace.nix b/home/programs/aerospace.nix deleted file mode 100644 index de622f8..0000000 --- a/home/programs/aerospace.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ pkgs, lib, ... }: - -let - settingsFormat = pkgs.formats.toml { }; - - settings = { - start-at-login = true; - - enable-normalization-flatten-containers = false; - enable-normalization-opposite-orientation-for-nested-containers = false; - - default-root-container-layout = "tiles"; - default-root-container-orientation = "auto"; - - gaps = { - inner = { - horizontal = 10; - vertical = 10; - }; - - outer = { - left = 10; - bottom = 10; - top = 10; - right = 10; - }; - }; - - key-mapping = { - preset = "qwerty"; - }; - - mode.main.binding = - let - meh = "ctrl-alt-shift"; - in - { - "${meh}-h" = "move left"; - "${meh}-j" = "move down"; - "${meh}-k" = "move up"; - "${meh}-l" = "move right"; - - "${meh}-w" = "move-node-to-monitor --wrap-around left"; - "${meh}-e" = "move-node-to-monitor --wrap-around right"; - - "${meh}-f" = "fullscreen"; - - "${meh}-t" = "layout floating tiling"; - }; - }; -in -{ - home.packages = [ pkgs.aerospace ]; - - xdg.configFile."aerospace/aerospace.toml".source = settingsFormat.generate "aerospace.toml" settings; - - home.activation.aeorspaceConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] /* bash */ '' - $VERBOSE_ECHO "Reloading configuration" - $DRY_RUN_CMD ${pkgs.aerospace}/bin/aerospace reload-config - ''; -} diff --git a/home/programs/amethyst.nix b/home/programs/amethyst.nix new file mode 100644 index 0000000..66d5a8a --- /dev/null +++ b/home/programs/amethyst.nix @@ -0,0 +1,97 @@ +{ pkgs, ... }: + +let + settingsFormat = pkgs.formats.yaml { }; + + window_padding = 5; + disable-keybinding = { mod = ""; key = ""; }; + + settings = { + # Settings + layouts = [ + "tall" + "fullscreen" + "wide" + "two-pane" + "column" + ]; + enables-layout-hud = true; + enables-layout-hud-on-space-change = true; + + disable-padding-on-builtin-display = false; + window-margins = true; + smart-window-margins = true; + window-margin-size = window_padding; + window-resize-step = 5; + screen-padding-left = 0; + screen-padding-right = 0; + screen-padding-top = 0; + screen-padding-bottom = 0; + + window-max-count = 0; + window-minimum-height = 0; + window-minimum-width = 0; + + floating-is-blacklist = true; + float-small-windows = true; + floating = [ + "at.obdev.LaunchBar" + "com.apple.systempreferences" + "com.eltima.elmedia-setapp" + "com.jonny.mona" + "com.kapeli.dash-setapp" + "com.sindresorhus.Dato-setapp" + ]; + + new-windows-to-main = false; + follow-space-thrown-windows = true; + + ignore-menu-bar = false; + hide-menu-bar-icon = false; + mouse-follows-focus = false; + focus-follows-mouse = false; + mouse-swaps-windows = true; + mouse-resizes-windows = false; + restore-layouts-on-launch = true; + debug-layout-info = false; + use-canary-build = false; + + # Keybindings + mod1 = [ "option" "shift" ]; + mod2 = [ "option" "shift" "control" ]; + + focus-ccw = { mod = "mod1"; key = "h"; }; + focus-cw = { mod = "mod1"; key = "l"; }; + focus-main = { mod = "mod1"; key = "m"; }; + + focus-screen-ccw = { mod = "mod1"; key = "e"; }; + focus-screen-cw = { mod = "mod1"; key = "w"; }; + + swap-ccw = { mod = "mod2"; key = "h"; }; + swap-cw = { mod = "mod2"; key = "l"; }; + swap-main = { mod = "mod2"; key = "m"; }; + + swap-screen-ccw = { mod = "mod2"; key = "e"; }; + swap-screen-cw = { mod = "mod2"; key = "w"; }; + + toggle-float = { mod = "mod2"; key = "t"; }; + + select-tall-layout = { mod = "mod2"; key = "a"; }; + select-wide-layout = { mod = "mod2"; key = "s"; }; + select-fullscreen-layout = { mod = "mod2"; key = "f"; }; + select-column-layout = { mod = "mod2"; key = "c"; }; + display-current-layout = { mod = "mod1"; key = "i"; }; + reevaluate-windows = { mod = "mod2"; key = "b"; }; + + throw-space-left = disable-keybinding; + throw-space-right = disable-keybinding; + + toggle-tiling = disable-keybinding; + + toggle-focus-follows-mouse = disable-keybinding; + relaunch-amethyst = { mod = "mod2"; key = "z"; }; + }; +in +{ + xdg.configFile."amethyst/amethyst.yml".source = settingsFormat.generate "amethyst.yml" settings; +} diff --git a/home/programs/fish.nix b/home/programs/fish.nix index 51d3d26..abafc74 100644 --- a/home/programs/fish.nix +++ b/home/programs/fish.nix @@ -111,6 +111,10 @@ in set user_agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" ${lib.getExe pkgs.aria2} -U "$user_agent" --file-allocation none --async-dns=false -x 2 $argv ''; + + macos-app-id = /* fish */ '' + osascript -e "id of app \"$argv\"" + ''; }; shellInit = /* fish */ '' diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 7302c38..7bba414 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -28,11 +28,11 @@ in universal-ctags # LSP + bash-language-server #elixir-ls fennel-ls lexical nil - nodePackages.bash-language-server nodePackages.dockerfile-language-server-nodejs nodePackages.svelte-language-server nodePackages.typescript-language-server diff --git a/system/hosts/Styx.nix b/system/hosts/Styx.nix index 73510d7..48c7ffa 100644 --- a/system/hosts/Styx.nix +++ b/system/hosts/Styx.nix @@ -16,8 +16,8 @@ in ../darwin/mas.nix - ../darwin/skhd.nix - ../darwin/yabai.nix + #../darwin/skhd.nix + #../darwin/yabai.nix ]; nix = {