This repository has been archived on 2021-03-17. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/root/.tmux.conf

29 lines
2.2 KiB
Plaintext

#############################################################################
# Copyright 2020 Ramon Fischer #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################
#set-option -g status-interval "2"
current_username="$(id -un)"
current_ram_usage="$(free --mebi | awk 'NR == 2 { printf \"%.0f/%.0f\", $3, $2; if($2 == 0) $2+=1; printf \"/%.2f%\", $3/$2*100 }')"
current_swap_usage="$(free --mebi | awk 'NR == 3 { printf \"%.0f/%.0f\", $3, $2; if($2 == 0) $2+=1; printf \"/%.2f%\", $3/$2*100 }')"
current_load="$(uptime | awk --field-separator 'average: ' '{ print $2 }')"
current_ip_address="$(ip route get 1 | awk 'NR == 1 { print $7 }')"
## "media-fonts/fs-fonts" is required to display the kanji character for "courage"
set-option -g status-left " Mem: [#[fg=cyan]#(echo ${current_ram_usage})#[fg=white]][#[fg=red]#(echo ${current_swap_usage})#[fg=white]] / Load: [#[fg=green]#(echo ${current_load})#[fg=white]] / #[fg=red]#(echo ${current_username})#[fg=white]@#{host_short} [#[fg=white]#[fg=#555555]#(echo ${current_ip_address})#[fg=white]]#[fg=white,nobold] 勇 "
# pane status
set-option -g pane-border-style "fg=red,dim"; set-option -g pane-active-border-style "fg=red"
set-option -g pane-border-format "#P:#{pane_current_command}[#{pane_synchronized}]"