Removed world-clock plugin and customized my own one. Setup the left-status colors.
This commit is contained in:
17
tmux/.config/tmux/plugins/lan_ip.sh
Executable file
17
tmux/.config/tmux/plugins/lan_ip.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
function ip_address() {
|
||||
|
||||
# Loop through the interfaces and check for the interface that is up.
|
||||
for file in /sys/class/net/*; do
|
||||
|
||||
iface=$(basename $file);
|
||||
|
||||
read status < $file/operstate;
|
||||
|
||||
[ "$status" == "up" ] && ip addr show $iface | awk '/inet /{printf $2" "}'
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
6
tmux/.config/tmux/plugins/timezones.sh
Executable file
6
tmux/.config/tmux/plugins/timezones.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
PST=$(TZ=":America/Los_Angeles" date -R +%H:%M)
|
||||
EST=$(TZ=":America/New_York" date -R +%H:%M)
|
||||
CET=$(TZ=":Europe/Warsaw" date -R +%H:%M)
|
||||
echo "PST: $PST | EST: $EST | CET: $CET"
|
||||
1
tmux/.config/tmux/plugins/tmux-world-clock
Submodule
1
tmux/.config/tmux/plugins/tmux-world-clock
Submodule
Submodule tmux/.config/tmux/plugins/tmux-world-clock added at 07266df297
27
tmux/.config/tmux/plugins/wan_ip.sh
Executable file
27
tmux/.config/tmux/plugins/wan_ip.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
function wan_ip() {
|
||||
|
||||
tmp_file="./wan_ip.txt"
|
||||
wan_up="N/a"
|
||||
|
||||
if [ -z "$wan_ip" ]; then
|
||||
wan_ip=$(curl --max-time 2 -s http://whatismyip.akamai.com/)
|
||||
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "${wan_ip}" > $tmp_file
|
||||
elif [ -f "${tmp_file}" ]; then
|
||||
wan_ip=$(cat "$tmp_file")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$wan_ip" ]; then
|
||||
printf "ⓦ ${wan_ip}"
|
||||
fi
|
||||
}
|
||||
|
||||
function main() {
|
||||
wan_ip
|
||||
}
|
||||
|
||||
main
|
||||
1
tmux/.config/tmux/plugins/wan_ip.txt
Normal file
1
tmux/.config/tmux/plugins/wan_ip.txt
Normal file
@ -0,0 +1 @@
|
||||
104.246.2.167
|
||||
@ -22,10 +22,26 @@ nonactive='#6272a4'
|
||||
left_sep=''
|
||||
right_sep=''
|
||||
|
||||
wanip="~/.dotfiles/tmux/.config/tmux/plugins/wan_ip.sh"
|
||||
timezones="~/.dotfiles/tmux/.config/tmux/plugins/timezones.sh"
|
||||
|
||||
|
||||
set -g status on
|
||||
set -g status-interval 1
|
||||
set -g status-justify centre
|
||||
|
||||
set-window-option -g window-status-separator ''
|
||||
set-window-option -g window-status-current-format "#[fg=${active},bg=${dark_gray}]${right_sep}#[fg=${black},bg=${active}] #I #W #[fg=${active},bg=${dark_gray}]${left_sep}"
|
||||
set-window-option -g window-status-format "#[fg=${white},bg=${dark_gray}] #I #W "
|
||||
# set-window-option -g window-status-format "#[fg=${nonactive},bg=${dark_gray}]${right_sep}#[fg=${white},bg=${nonactive}] #I #W#[fg=${nonactive},bg=${nonactive}]${left_sep}"
|
||||
set-option -g status-bg ${dark_gray}
|
||||
# set-option -g status-fg white
|
||||
set -g status-left-length 50
|
||||
# set -g status-left-style default
|
||||
set -g status-left "#[fg=${black},bg=${dark_purple}] #(${wanip}) #[fg=${dark_purple},bg=${dark_gray}]${left_sep}"
|
||||
|
||||
set -g status-right-length 60
|
||||
set -g status-right "#[fg=${pink},bg=${dark_gray}]${right_sep}#[fg=${black},bg=${pink}]#(${timezones}) "
|
||||
set -g status-right-style default
|
||||
|
||||
|
||||
# Standard Plugins
|
||||
@ -39,6 +55,7 @@ set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
# Search your Scrollback using fzf
|
||||
# set -g @plugin 'roosta/tmux-fuzzback'
|
||||
|
||||
|
||||
# Allow Focus Events
|
||||
set -g focus-events on
|
||||
|
||||
@ -59,7 +76,5 @@ bind % split-window -h -c "#{pane_current_path}"
|
||||
# Vim-Tmux-Navigator plugin/
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
|
||||
set -g @plugin 'erikw/tmux-powerline'
|
||||
|
||||
# Initiazlie TMUX plugin manager - kept at bottom of file
|
||||
# Initialize TMUX plugin manager - kept at bottom of file
|
||||
run '~/.dotfiles/tmux/.config/tmux/plugins/tpm/tpm'
|
||||
|
||||
Reference in New Issue
Block a user