From 914d9d1bed1907dc360f41442099782dc6ff4dd0 Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 18 Mar 2024 15:04:52 +0900 Subject: [PATCH] Update --- home-manager/common/software/cli/bash.nix | 1 + home-manager/common/software/cli/tmux.nix | 42 +++++++++++++---------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/home-manager/common/software/cli/bash.nix b/home-manager/common/software/cli/bash.nix index 313feed5..37745a35 100644 --- a/home-manager/common/software/cli/bash.nix +++ b/home-manager/common/software/cli/bash.nix @@ -36,6 +36,7 @@ initExtra = '' GPG_TTY=$(tty) ssh-add > /dev/null &> /dev/null + [ -z "$TMUX" ] && { tmux attach || exec tmux new-session && exit;} ''; sessionVariables = { # Set the GTK Theme diff --git a/home-manager/common/software/cli/tmux.nix b/home-manager/common/software/cli/tmux.nix index 69066575..bb78d31b 100644 --- a/home-manager/common/software/cli/tmux.nix +++ b/home-manager/common/software/cli/tmux.nix @@ -1,32 +1,38 @@ -{ pkgs, ... }: { +{ config, pkgs, ... }: { programs.tmux = { enable = true; - clock24 = true; keyMode = "vi"; + mouse = true; terminal = "xterm-256color"; plugins = with pkgs.tmuxPlugins; [ - better-mouse-mode - sensible - sidebar { - plugin = sysstat; + plugin = power-theme; extraConfig = '' - set -g status-right "#{sysstat_cpu} | #{sysstat_mem} | #{sysstat_swap} | #{sysstat_loadavg} | #[fg=cyan]#(echo $USER)#[default]@#H" - ''; - } - { - plugin = battery; - extraConfig = '' - set-option -g status-right "#{battery}" + set -g @tmux_power_theme '#${config.lib.stylix.colors.base09}' + set -g @tmux_power_right_arrow_icon ' ' + set -g @tmux_power_left_arrow_icon ' ' + set -g @tmux_power_prefix_highlight_pos 'R' + set -g @tmux_power_show_upload_speed false + set -g @tmux_power_show_download_speed false + set -g @tmux_power_show_web_reachable false ''; } { - plugin = weather; + plugin = better-mouse-mode; extraConfig = '' - set-option -g @tmux-weather-location "Kyoto" - set-option -g status-right "#{weather}" - ''; - } + set -g @scroll-in-moused-over-pane "on" + set -g @scroll-speed-num-lines-per-scroll "3" + ''; + } + prefix-highlight ]; + extraConfig = '' + unbind C-b + set-option -g prefix C-a + bind-key C-a send-prefix + + bind | split-window -h + bind - split-window -v + ''; }; }