You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
348 B

  1. #!/usr/bin/env bash
  2. set_tmux_option() {
  3. local option="$1"
  4. local value="$2"
  5. tmux set-option -gq "$option" "$value"
  6. }
  7. get_tmux_option() {
  8. local option="$1"
  9. local default_value="$2"
  10. local option_value="$(tmux show-option -gqv "$option")"
  11. if [ -z "$option_value" ]; then
  12. echo "$default_value"
  13. else
  14. echo "$option_value"
  15. fi
  16. }