From dcd6ddc91db6bde101ac6a85ac28f8592ebf1dc3 Mon Sep 17 00:00:00 2001 From: Kaholaz Date: Mon, 20 Feb 2023 01:05:39 +0100 Subject: [PATCH] Add weather inside and outside of tmux --- .tmux.conf | 2 +- .zshrc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 7fe9968..e2e8756 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -52,7 +52,7 @@ set -g status-position bottom set -g status-justify left set -g status-style 'dim' set -g status-left ' #S | ' -set -g status-right '%F %H:%M:%S #[fg=color100,bg=color237] #($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --interval 1 --mem-mode 0 --averages-count 0) #[fg=color82,bg=color236,bold] #H ' +set -g status-right '#(curl -s wttr.in/Trondheim\?format\="%%l:+%%c%%t") #[bg=color237] %a %b %d #[fg=color7]%H:%M #[fg=color82,bg=color236,bold] #H ' set -g status-right-length 80 set -g status-left-length 20 diff --git a/.zshrc b/.zshrc index 2e400ff..22a855c 100644 --- a/.zshrc +++ b/.zshrc @@ -41,10 +41,16 @@ else fi # Attach to a tmux session on startup -if [ -z "$TMUX" ] && [ -n "$SSH_CLIENT" ]; then +if [ -z "$TMUX" ] && [ -n "$SSH_CONNECTION" ]; then tmux attach -t Default || tmux new -s Default fi + +# Attach to a tmux session on startup +if [ -z "$TMUX" ]; then + curl -s 'wttr.in/Trondheim?format=%l:+%c%t\n' +fi + source ~/.profile source ~/.aliases