diff --git a/home/terminal/fish/default.nix b/home/terminal/fish/default.nix index 8a8334a..e58af9d 100644 --- a/home/terminal/fish/default.nix +++ b/home/terminal/fish/default.nix @@ -1,54 +1,28 @@ { config, pkgs, ... }: - { + home.packages = with pkgs; [ kdePackages.qttools ]; + programs.fish = { enable = true; - + shellAliases = { + ssh = "kitty-ssh"; + }; functions = { fish_prompt = { description = "Write out the prompt"; - body = '' - set -l last_status $status - - set -l nix_shell_info ( - if test -n "$IN_NIX_SHELL" - echo -n " " - end - ) - - set -g fish_color_user 89dceb - - # Set host color based on hostname - if test (hostname) = "peach" - set -g fish_color_host fab387 - else if test (hostname) = "alien" - set -g fish_color_host 89b4fa - else if test (hostname) = "vm-aarch64" - set -g fish_color_host a6e3a1 - else if test (uname) = "Darwin" - set -g fish_color_host f9e2af - end - - set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal) - - set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal) - - set -l git_info (fish_git_prompt) - - echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info" - echo -n -s "> " - ''; - # echo -n -s "$user_host" " " "$nix_shell_info" "$cwd" "$git_info" "> " + body = builtins.readFile ./functions/fish-prompt.fish; + }; + kitty-ssh = { + description = "Integrate Kitten SSH with Fish"; + body = builtins.readFile ./functions/kitty-ssh.fish; }; nix-shell = { description = "Wrapper for nix-shell that runs fish by default"; - body = '' - if test (count $argv) -eq 0 - command nix-shell --run fish - else - command nix-shell --run fish $argv - end - ''; + body = builtins.readFile ./functions/nix-shell.fish; + }; + logout = { + description = "Log out of KDE Plasma"; + body = builtins.readFile ./functions/logout.fish; }; }; }; diff --git a/home/terminal/fish/functions/fish-prompt.fish b/home/terminal/fish/functions/fish-prompt.fish new file mode 100644 index 0000000..f38e382 --- /dev/null +++ b/home/terminal/fish/functions/fish-prompt.fish @@ -0,0 +1,24 @@ +set -l last_status $status +set -l nix_shell_info ( + if test -n "$IN_NIX_SHELL" + echo -n " " + end +) +set -g fish_color_user 89dceb + +# Set host color based on hostname +if test (hostname) = "peach" + set -g fish_color_host fab387 +else if test (hostname) = "alien" + set -g fish_color_host 89b4fa +else if test (hostname) = "vm-aarch64" + set -g fish_color_host a6e3a1 +else if test (uname) = "Darwin" + set -g fish_color_host f9e2af +end + +set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal) +set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal) +set -l git_info (fish_git_prompt) +echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info" +echo -n -s "> " diff --git a/home/terminal/fish/functions/kitty-ssh.fish b/home/terminal/fish/functions/kitty-ssh.fish new file mode 100644 index 0000000..bfb1e77 --- /dev/null +++ b/home/terminal/fish/functions/kitty-ssh.fish @@ -0,0 +1,5 @@ +if set -q KITTY_WINDOW_ID + kitty +kitten ssh $argv +else + command ssh $argv +end diff --git a/home/terminal/fish/functions/logout.fish b/home/terminal/fish/functions/logout.fish new file mode 100644 index 0000000..9dcc3e0 --- /dev/null +++ b/home/terminal/fish/functions/logout.fish @@ -0,0 +1,5 @@ +if status is-login + builtin exit +else + /run/current-system/sw/bin/qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logout +end diff --git a/home/terminal/fish/functions/nix-shell.fish b/home/terminal/fish/functions/nix-shell.fish new file mode 100644 index 0000000..588e4a1 --- /dev/null +++ b/home/terminal/fish/functions/nix-shell.fish @@ -0,0 +1,5 @@ +if test (count $argv) -eq 0 + command nix-shell --run fish +else + command nix-shell --run fish $argv +end diff --git a/home/terminal/kitty/default.nix b/home/terminal/kitty/default.nix index e550e3e..b06c2df 100644 --- a/home/terminal/kitty/default.nix +++ b/home/terminal/kitty/default.nix @@ -21,6 +21,7 @@ tab_bar_edge = "top"; tab_bar_style = "powerline"; tab_powerline_style = "slanted"; + mouse_hide_wait = "-1.0"; }; }; } diff --git a/home/terminal/nvim/default.nix b/home/terminal/nvim/default.nix index 9a5ad17..fc2024c 100644 --- a/home/terminal/nvim/default.nix +++ b/home/terminal/nvim/default.nix @@ -1,10 +1,14 @@ { pkgs, ... }: { + home.sessionVariables = { + EDITOR = "nvim"; + }; + programs.nixvim = { enable = true; enablePrintInit = true; - # defaultEditor = true; + defaultEditor = true; waylandSupport = true; viAlias = true; vimAlias = true; diff --git a/home/vscode/default.nix b/home/vscode/default.nix index 129d86a..0191599 100644 --- a/home/vscode/default.nix +++ b/home/vscode/default.nix @@ -11,9 +11,9 @@ let (lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str); in { - home.sessionVariables = { - EDITOR = "code"; - }; + # home.sessionVariables = { + # EDITOR = "code"; + # }; catppuccin.vscode.profiles.default = { enable = true;