From 946c28e7d47dc4fde0f8588b4ab12d82cb7c7635 Mon Sep 17 00:00:00 2001 From: kat Date: Fri, 29 Jul 2022 10:06:50 -0700 Subject: [PATCH] fix: misc fixes --- home/firefox/default.nix | 1 + home/shell/zsh.nix | 186 ++++++++++++++++++++------------------- home/waybar/default.nix | 1 + home/waybar/waybar.sass | 6 ++ 4 files changed, 104 insertions(+), 90 deletions(-) diff --git a/home/firefox/default.nix b/home/firefox/default.nix index be1d1197..3c751eae 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -117,6 +117,7 @@ in home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; + BROWSER = "firefox"; }; programs.firefox = { diff --git a/home/shell/zsh.nix b/home/shell/zsh.nix index 11d25c45..70114ff0 100644 --- a/home/shell/zsh.nix +++ b/home/shell/zsh.nix @@ -2,96 +2,102 @@ { - home.packages = with pkgs; [ - # programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions - zsh-completions - ]; + home.packages = with pkgs; [ +# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions + zsh-completions + ]; - programs.zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - initExtra = - let - zshOpts = [ - "auto_pushd" - "pushd_ignore_dups" - "pushdminus" - "rmstarsilent" - "nonomatch" - "long_list_jobs" - "interactivecomments" - "append_history" - "hist_ignore_space" - "hist_verify" - "inc_append_history" - "nosharehistory" - "nomenu_complete" - "auto_menu" - "no_auto_remove_slash" - "complete_in_word" - "always_to_end" - "nolistbeep" - "autolist" - "listrowsfirst" - ]; in - '' - ${if pkgs.hostPlatform.isLinux then '' - eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90") - '' else '' - ''} - PROMPT_EOL_MARK=''' - ZSH_TAB_TITLE_ADDITIONAL_TERMS='kitty' - ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true - zmodload -i zsh/complist - h=() - if [[ -r ~/.ssh/config ]]; then - h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) - fi - if [[ $#h -gt 0 ]]; then - zstyle ':completion:*:ssh:*' hosts $h - zstyle ':completion:*:slogin:*' hosts $h - fi - unset h - u=(root ${config.home.username}) - zstyle ':completion:*:ssh:*' users $u - unset u - zstyle ':completion:*:*:*:*:*' menu select - zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories - zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' - zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" - zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*' - zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath' - ${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)} - bindkey '^ ' autosuggest-accept - ''; - shellAliases = lib.mkMerge [ - { - nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; - dmesg = "dmesg -HP"; - hg = "history 0 | rg"; - } - (lib.mkIf pkgs.hostPlatform.isLinux { - sys = "systemctl"; - sysu = "systemctl --user"; - logu = "journalctl --user"; - log = "journalctl"; - lg = "log --no-pager | rg"; - }) - ]; - localVariables = { - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold"; - ZSH_AUTOSUGGEST_USE_ASYNC = 1; - }; - plugins = with pkgs.zsh-plugins; (map (plugin: plugin.zshPlugin) [ - tab-title - vim-mode - evil-registers - ]); - }; +xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec { + default = config.base16.defaultSchemeName; + current = default; +}; - home.sessionVariables = { - XDG_DATA_HOME = "${config.xdg.dataHome}"; - }; + + programs.zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + initExtra = + let + zshOpts = [ + "auto_pushd" + "pushd_ignore_dups" + "pushdminus" + "rmstarsilent" + "nonomatch" + "long_list_jobs" + "interactivecomments" + "append_history" + "hist_ignore_space" + "hist_verify" + "inc_append_history" + "nosharehistory" + "nomenu_complete" + "auto_menu" + "no_auto_remove_slash" + "complete_in_word" + "always_to_end" + "nolistbeep" + "autolist" + "listrowsfirst" + ]; in + '' + ${if pkgs.hostPlatform.isLinux then '' + eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90") + '' else '' + ''} + PROMPT_EOL_MARK=''' + ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm' + ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true + zmodload -i zsh/complist + h=() + if [[ -r ~/.ssh/config ]]; then + h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) + fi + if [[ $#h -gt 0 ]]; then + zstyle ':completion:*:ssh:*' hosts $h + zstyle ':completion:*:slogin:*' hosts $h + fi + unset h + u=(root ${config.home.username}) + zstyle ':completion:*:ssh:*' users $u + unset u + zstyle ':completion:*:*:*:*:*' menu select + zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories + zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' + zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" + zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*' + zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath' + ${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)} + bindkey '^ ' autosuggest-accept + ''; + shellAliases = lib.mkMerge [ + { + nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; + dmesg = "dmesg -HP"; + hg = "history 0 | rg"; + } + (lib.mkIf pkgs.hostPlatform.isLinux { + sys = "systemctl"; + sysu = "systemctl --user"; + logu = "journalctl --user"; + log = "journalctl"; + lg = "log --no-pager | rg"; + }) + ]; + localVariables = { + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold"; + ZSH_AUTOSUGGEST_USE_ASYNC = 1; + }; + plugins = with pkgs.zsh-plugins; (map (plugin: plugin.zshPlugin) [ + tab-title + vim-mode + evil-registers + ]); + }; + + home.sessionVariables = { + XDG_DATA_HOME = "${config.xdg.dataHome}"; + }; } diff --git a/home/waybar/default.nix b/home/waybar/default.nix index 99749423..c4d594b5 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -53,6 +53,7 @@ }; "sway/window" = { icon = true; + icon-size = 12; format = "{}"; }; tray = { diff --git a/home/waybar/waybar.sass b/home/waybar/waybar.sass index f42ddf93..fce39d6b 100644 --- a/home/waybar/waybar.sass +++ b/home/waybar/waybar.sass @@ -120,7 +120,13 @@ tooltip .modules-left margin: 0 4px + image + padding-left: 4px + margin-left: 8px + margin-right: 0px + background: $base01 #window + margin-left: 0px margin-right: 0px widget label