From bd7290fe63c0a9fcc9bdb3e8127b11d8f8066ff5 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 19 Jun 2022 10:02:06 -0400 Subject: [PATCH] darwin alacritty statusbar --- modules/darwin/alacritty.nix | 2 +- modules/darwin/tmux.nix | 49 ++++++++++++++++++++++++++++++++++++ modules/editor/dotfiles.nix | 16 ++++++++---- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/modules/darwin/alacritty.nix b/modules/darwin/alacritty.nix index 2a783c4..3424797 100644 --- a/modules/darwin/alacritty.nix +++ b/modules/darwin/alacritty.nix @@ -3,7 +3,7 @@ # MacOS-specific settings for Alacritty home-manager.users.${config.user} = { programs.alacritty.settings = { - font.size = lib.mkForce 18.0; + font.size = lib.mkForce 20.0; shell.program = "${pkgs.fish}/bin/fish"; key_bindings = [ { diff --git a/modules/darwin/tmux.nix b/modules/darwin/tmux.nix index b580b34..0f3d2ae 100644 --- a/modules/darwin/tmux.nix +++ b/modules/darwin/tmux.nix @@ -48,6 +48,55 @@ set -g status-interval 60 # Seconds between refreshes set -g renumber-windows on set-option -g status-position bottom + + ## COLORSCHEME: gruvbox dark + set-option -g status "on" + + # Default statusbar color + set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1 + + # Default window title colors + set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1 + + # Default window with an activity alert + set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3 + + # Active window title colors + set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1 + + # Pane border + set-option -g pane-active-border-style fg=colour250 #fg2 + set-option -g pane-border-style fg=colour237 #bg1 + + # Message infos + set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1 + + # Writing commands inactive + set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1 + + # Pane number display + set-option -g display-panes-active-colour colour250 #fg2 + set-option -g display-panes-colour colour237 #bg1 + + # Clock + set-window-option -g clock-mode-colour colour109 #blue + + # Bell + set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg + + # Theme settings mixed with colors (unfortunately, but there is no cleaner way) + set-option -g status-justify "left" + set-option -g status-left-style none + set-option -g status-left-length "80" + set-option -g status-right-style none + set-option -g status-right-length "80" + set-window-option -g window-status-separator "" + + set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]" + set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]" + + set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]" + set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]" ''; }; diff --git a/modules/editor/dotfiles.nix b/modules/editor/dotfiles.nix index aab77c2..ee9766b 100644 --- a/modules/editor/dotfiles.nix +++ b/modules/editor/dotfiles.nix @@ -18,17 +18,23 @@ programs.fish = let system = if pkgs.stdenv.isDarwin then "darwin" else "nixos"; - sudo = if pkgs.stdenv.isDarwin then "doas" else "sudo"; + sudo = if pkgs.stdenv.isDarwin then "" else "doas"; in { - shellAbbrs = { nr = lib.mkIf pkgs.stdenv.isLinux "rebuild-${system}"; }; + shellAbbrs = { + nr = "rebuild-${system}"; + nro = "rebuild-${system} offline"; + }; functions = { - rebuild-nixos = { + "rebuild-${system}" = { body = '' + if test "$argv[1]" = "offline" + set option "--option substitute false" + end pushd ${config.dotfilesPath} git add --all popd - echo "${sudo} ${system}-rebuild switch --flake ${config.dotfilesPath}" - ${sudo} ${system}-rebuild switch --flake ${config.dotfilesPath} + echo "${sudo} ${system}-rebuild switch $option --flake ${config.dotfilesPath}" + ${sudo} ${system}-rebuild switch $option --flake ${config.dotfilesPath} ''; }; };