diff options
| author | Mike Vink <mike@pionative.com> | 2024-06-09 12:14:20 +0200 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-06-09 12:14:44 +0200 |
| commit | 5013daa0e8b7e2db35d30f3c73b552b4f96b58c4 (patch) | |
| tree | 6fc6d2a6b4090964619e29e6948aea0e8b457d5e | |
| parent | a0d36ed6a666c14c0d92ce2732e23289771778f4 (diff) | |
fzf-tail
| -rw-r--r-- | machines/work.nix | 42 | ||||
| -rwxr-xr-x | mut/bin/lfub | 7 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 11 | ||||
| -rw-r--r-- | overlays/fzf.nix | 12 | ||||
| -rw-r--r-- | overlays/treesitter.nix | 19 | ||||
| -rw-r--r-- | profiles/core/configuration.nix | 2 | ||||
| -rw-r--r-- | profiles/core/home.nix | 30 |
7 files changed, 80 insertions, 43 deletions
diff --git a/machines/work.nix b/machines/work.nix index 38c1978..4ee0814 100644 --- a/machines/work.nix +++ b/machines/work.nix @@ -194,15 +194,26 @@ -----END CERTIFICATE----- ''; }; +# cmd - 1 : osascript -e 'tell application "alacritty" to activate' +# cmd - 2 : osascript -e 'tell application "Google Chrome" to activate' +# cmd - 3 : osascript -e 'tell application "slack" to activate' +# cmd - 4 : osascript -e 'tell application "Microsoft Teams (work or school)" to activate' +# cmd - 5 : osascript -e 'tell application "calendar" to activate' +# cmd - 6 : osascript -e 'tell application "mail" to activate' services.skhd = { enable = true; skhdConfig = '' - cmd - 1 : osascript -e 'tell application "alacritty" to activate' - cmd - 2 : osascript -e 'tell application "Google Chrome" to activate' - cmd - 3 : osascript -e 'tell application "slack" to activate' - cmd - 4 : osascript -e 'tell application "Microsoft Teams (work or school)" to activate' - cmd - 5 : osascript -e 'tell application "calendar" to activate' - cmd - 6 : osascript -e 'tell application "mail" to activate' + cmd - 1 : yabai -m space --focus 1 + cmd - 2 : yabai -m space --focus 2 + cmd - 3 : yabai -m space --focus 3 + cmd - 4 : yabai -m space --focus 4 + cmd - 5 : yabai -m space --focus 5 + cmd - 6 : yabai -m space --focus 6 + cmd - 7 : yabai -m space --focus 7 + cmd - 0x2F : yabai -m display --focus next || yabai -m display --focus first + + cmd - h : yabai -m window --resize right:-40:0 2> /dev/null || yabai -m window --resize left:-40:0 2> /dev/null + cmd - l : yabai -m window --resize right:40:0 2> /dev/null || yabai -m window --resize left:40:0 2> /dev/null cmd - k : ${pkgs.writers.writeBash "cycle_cclockwise" '' if ! yabai -m window --focus prev &>/dev/null; then yabai -m window --focus last @@ -235,15 +246,19 @@ ''} cmd - w [ "Google Chrome" ~ - * : osascript -e 'tell application "Google Chrome" to activate' + * : /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ] cmd - e : osascript -e 'tell application "mail" to activate' cmd - m : osascript -e 'tell application "Slack" to activate' cmd + shift - m : osascript -e 'tell application "Microsoft Teams (work or school)" to activate' + cmd - q : yabai -m window --close + cmd + shift - r : /Applications/Alacritty.app/Contents/MacOS/alacritty -e htop cmd - return : /Applications/Alacritty.app/Contents/MacOS/alacritty - cmd - space : yabai -m window --swap first + cmd - space : ${pkgs.writers.writeBash "swap_first_or_recent" '' + yabai -m window --swap first || yabai -m window --swap recent + ''} cmd + shift - space : yabai -m window --toggle float - cmd - d : ${pkgs.writers.writeBash "passautotype" '' + cmd + shift - p : ${pkgs.writers.writeBash "passautotype" '' shopt -s nullglob globstar dmenu="/opt/homebrew/bin/dmenu-mac" @@ -265,6 +280,7 @@ /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.loadSpoon([[PassAutotype]]):autotype([[$password]])" ) >/tmp/debug 2>&1 ''} + cmd - d : /opt/homebrew/bin/dmenu-mac cmd + shift - d : ${pkgs.writers.writeBash "passmenu" '' shopt -s nullglob globstar @@ -332,13 +348,11 @@ # rules yabai -m rule --add app='System Settings' manage=off yabai -m rule --add app='alacritty' title='dap' display='2' - yabai -m signal --add event=display_changed action=${pkgs.writers.writeBash "padding" '' - if ! yabai -m window --focus prev &>/dev/null; then - yabai -m window --focus last - fi - ''} # Any other arbitrary config here + yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent || yabai -m window --focus first" + yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent || yabai -m window --focus first" + yabai -m signal --add event=window_created action="yabai -m window --warp east" ''; }; # Auto upgrade nix package and the daemon service. diff --git a/mut/bin/lfub b/mut/bin/lfub index ffcb52a..50bae0d 100755 --- a/mut/bin/lfub +++ b/mut/bin/lfub @@ -18,6 +18,11 @@ else mkfifo "$FIFO_UEBERZUG" ueberzug layer -s <"$FIFO_UEBERZUG" -p json & exec 3>"$FIFO_UEBERZUG" - trap cleanup HUP INT QUIT TERM PWR EXIT + sys="$(uname)" + if ! [ "$sys" = "Darwin" ]; then + trap cleanup HUP INT QUIT TERM PWR EXIT + else + trap cleanup HUP INT QUIT TERM EXIT + fi lf "$@" 3>&- fi diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index c5a3f86..da78287 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -85,6 +85,17 @@ (map :n "[x" ":lprevious<cr>") (map :n "]x" ":lnext<cr>") (map :n :<leader>xp #(fzf.files)) + (map :n "<leader>:" #(do + (var keys "") + (if (not= (vim.opt_local.filetype:get) "oil") + (set keys (.. ":silent grep <c-r><c-w> " (vim.fn.bufname "%") "<c-f>B<left>i<space>")) + (do + (local f (vim.fn.bufname "%")) + (set keys (.. ":silent grep " (f:gsub "oil://" "") "<c-f>B<left>i<space>")))) + (vim.api.nvim_feedkeys + (vim.api.nvim_replace_termcodes + keys true false true) + :n false))) (map :n "<leader>;" #(do (var keys "") (if (not= (vim.opt_local.filetype:get) "oil") diff --git a/overlays/fzf.nix b/overlays/fzf.nix new file mode 100644 index 0000000..80b6f07 --- /dev/null +++ b/overlays/fzf.nix @@ -0,0 +1,12 @@ +{pkgs, lib, ...}: with pkgs; (final: prev: { + fzf = (prev.fzf.overrideAttrs (oldAttrs: rec { + version = "0.53.0"; + src = fetchFromGitHub { + owner = "junegunn"; + repo = "fzf"; + rev = version; + hash = "sha256-2g1ouyXTo4EoCub+6ngYPy+OUFoZhXbVT3FI7r5Y7Ws="; + }; + vendorHash = "sha256-Kd/bYzakx9c/bF42LYyE1t8JCUqBsJQFtczrFocx/Ps="; + })); +}) diff --git a/overlays/treesitter.nix b/overlays/treesitter.nix deleted file mode 100644 index 35b75a0..0000000 --- a/overlays/treesitter.nix +++ /dev/null @@ -1,19 +0,0 @@ -{...}: (final: prev: { - tree-sitter = mvinkioPkgs.tree-sitter; - vimPlugins = - prev.vimPlugins - // { - nvim-treesitter = mvinkioPkgs.vimPlugins.nvim-treesitter.overrideAttrs (old: { - version = "2022-10-28"; - passthru.withPlugins = grammarFn: - final.vimPlugins.nvim-treesitter.overrideAttrs (_: { - postPatch = let - grammars = mvinkioPkgs.tree-sitter.withPlugins grammarFn; - in '' - rm -r parser - ln -s ${grammars} parser - ''; - }); - }); - }; -}) diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix index 7b4fec3..b74c1c8 100644 --- a/profiles/core/configuration.nix +++ b/profiles/core/configuration.nix @@ -82,7 +82,7 @@ usbutils ]); - nix.package = pkgs.nixUnstable; + nix.package = pkgs.nixVersions.latest; nix.extraOptions = '' experimental-features = nix-command flakes configurable-impure-env ''; diff --git a/profiles/core/home.nix b/profiles/core/home.nix index 9434fc5..4010aff 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -82,14 +82,14 @@ }; }; - programs.ssh = { - enable = true; - matchBlocks = { - "*" = { - identityFile = "${config.ivi.home}/.ssh/id_ed25519_sk"; - }; - }; - }; + # programs.ssh = { + # enable = true; + # matchBlocks = { + # "*" = { + # identityFile = "${config.ivi.home}/.ssh/id_ed25519_sk"; + # }; + # }; + # }; programs.starship.enable = true; @@ -148,6 +148,19 @@ } bindkey -s '^o' '^ulfcd\n' + fzf-tail () { + fzf --tail 100000 --tac --no-sort --exact + } + + fzf-stern () { + kubectl config set-context --current --namespace "$1" + kubectl stern -n "$1" "$2" --color always 2>&1 | + fzf --ansi --tail 100000 --tac --no-sort --exact \ + --bind 'ctrl-o:execute:kubectl logs {1} | nvim -' \ + --bind 'enter:execute:kubectl exec -it {1} -- bash' \ + --header '╱ Enter (kubectl exec) ╱ CTRL-O (open log in vim) ╱' + } + login-to-cloud () { case $1 in aws) @@ -218,6 +231,7 @@ lock-pass = "gpgconf --kill gpg-agent"; use-gpg-ssh = "export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)"; use-fido-ssh = "export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock"; + sshdo = "ssh -f -q -o 'StrictHostKeyChecking no' "; }; }; |
