status-left.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. #Print the status-left for tmux.
  3. # custom left/right status and segments
  4. custom_dir=$(dirname $0)
  5. # The powerline root directory. TODO any other neater way of getting fullpath?
  6. cd ~/dotfiles/tmux/tmux-powerline
  7. cwd=$(pwd)
  8. # Source global configurations.
  9. source "${custom_dir}/config.sh"
  10. # Source lib functions.
  11. source "${cwd}/lib.sh"
  12. segments_path="${cwd}/${segments_dir}"
  13. custom_segments_path="${custom_dir}/${segments_dir}"
  14. # Mute this statusbar?
  15. mute_status_check "left"
  16. # Segments
  17. declare -A tmux_session_info
  18. tmux_session_info+=(["script"]="${custom_segments_path}/tmux_session_info.sh")
  19. tmux_session_info+=(["foreground"]="colour234")
  20. tmux_session_info+=(["background"]="colour148")
  21. tmux_session_info+=(["separator"]="${separator_right_bold}")
  22. #tmux_session_info+=(["separator_fg"]="default")
  23. register_segment "tmux_session_info"
  24. declare -A hostname
  25. hostname+=(["script"]="${segments_path}/hostname.sh")
  26. hostname+=(["foreground"]="colour0")
  27. hostname+=(["background"]="colour33")
  28. hostname+=(["separator"]="${separator_right_bold}")
  29. register_segment "hostname"
  30. declare -A lan_ip
  31. lan_ip+=(["script"]="${segments_path}/lan_ip.sh")
  32. lan_ip+=(["foreground"]="colour255")
  33. lan_ip+=(["background"]="colour24")
  34. lan_ip+=(["separator"]="${separator_right_bold}")
  35. register_segment "lan_ip"
  36. # Print the status line in the order of registration above.
  37. print_status_line_left
  38. exit 0