Wren Linux

wren-linux / data / tmux-console.conf

# Written by Wren Linux parts/console-tmux.sh
# tmux dressed like the sway desktop: the bar on top (workspace numbers at the left, then
# Wren Menu | wifi | vol | bright | bat | timer | date at the right), black and gray,
# Alt where sway uses Super. Alt+1 ... Alt+0 are the workspaces (tmux windows).
# tmux.conf loads this only when there is no sway session.

# the bar
set -g status on
set -g status-position top
set -g status-interval 5
set -g status-justify left
set -g status-style "bg=#000000,fg=#d0d0d0"
set -g status-left ""
set -g status-right-length 200
set -g status-right "#(~/.local/bin/sway-status --tmux) "
set -g window-status-separator ""
set -g window-status-format " #I "
set -g window-status-current-format " #I "
set -g window-status-style "bg=#000000,fg=#d0d0d0"
set -g window-status-current-style "bg=#d0d0d0,fg=#000000"
set -g window-status-activity-style "bg=#000000,fg=#ffffff"
set -g pane-border-style "fg=#606060"
set -g pane-active-border-style "fg=#d0d0d0"
set -g message-style "bg=#d0d0d0,fg=#000000"
set -g mode-style "bg=#d0d0d0,fg=#000000"
set -g popup-style "bg=#000000,fg=#d0d0d0"
set -g popup-border-style "fg=#d0d0d0"

# clicks and scrolls on the right of the bar, for tmux used from a terminal program (over ssh,
# say); a real text console sends no mouse. The part clicked is named like sway's bar.
bind -n MouseDown1StatusRight run-shell "~/.local/bin/console-click '#{mouse_status_range}' 1 '#{client_name}'"
bind -n WheelUpStatusRight run-shell "~/.local/bin/console-click '#{mouse_status_range}' 4 '#{client_name}'"
bind -n WheelDownStatusRight run-shell "~/.local/bin/console-click '#{mouse_status_range}' 5 '#{client_name}'"

# pop-ups: floating over the screen, Esc closes (like the sway ones)
bind -n M-m display-popup -E -w 72% -h 85% "~/.local/bin/wren-menu --tui"
bind -n 'M-?' display-popup -E -w 72% -h 85% "~/.local/bin/keys"
bind -n M-t display-popup -E -w 60% -h 60% "~/.local/bin/timer"

# the bar's other items from the keyboard (a text console has no mouse): same as clicking them
bind -n M-w run-shell "~/.local/bin/console-click wifi 1 '#{client_name}'"
bind -n M-- run-shell "~/.local/bin/console-click vol 5 '#{client_name}'"
bind -n M-= run-shell "~/.local/bin/console-click vol 4 '#{client_name}'"
bind -n M-BSpace run-shell "~/.local/bin/console-click vol 1 '#{client_name}'"
bind -n M-, run-shell "~/.local/bin/console-click bright 5 '#{client_name}'"
bind -n M-. run-shell "~/.local/bin/console-click bright 4 '#{client_name}'"
bind -n M-b run-shell "~/.local/bin/console-click bat 1 '#{client_name}'"

# windows (sway's panes): focus, close, fullscreen, split
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-Left select-pane -L
bind -n M-Down select-pane -D
bind -n M-Up select-pane -U
bind -n M-Right select-pane -R
bind -n M-Enter split-window -h -c "#{pane_current_path}"
bind -n M-v split-window -v -c "#{pane_current_path}"
bind -n M-f resize-pane -Z
bind -n M-Q kill-pane

# workspaces: Alt+N goes to N (made when it is new); Alt+Shift+N sends the pane there
# (the shifted symbols are for a US keyboard)
bind -n M-1 if-shell 'tmux select-window -t :1' '' 'new-window -t :1'
bind -n 'M-!' if-shell 'tmux join-pane -d -t :1' '' 'break-pane -d -t :1'
bind -n M-2 if-shell 'tmux select-window -t :2' '' 'new-window -t :2'
bind -n 'M-@' if-shell 'tmux join-pane -d -t :2' '' 'break-pane -d -t :2'
bind -n M-3 if-shell 'tmux select-window -t :3' '' 'new-window -t :3'
bind -n 'M-#' if-shell 'tmux join-pane -d -t :3' '' 'break-pane -d -t :3'
bind -n M-4 if-shell 'tmux select-window -t :4' '' 'new-window -t :4'
bind -n 'M-$' if-shell 'tmux join-pane -d -t :4' '' 'break-pane -d -t :4'
bind -n M-5 if-shell 'tmux select-window -t :5' '' 'new-window -t :5'
bind -n 'M-%' if-shell 'tmux join-pane -d -t :5' '' 'break-pane -d -t :5'
bind -n M-6 if-shell 'tmux select-window -t :6' '' 'new-window -t :6'
bind -n 'M-^' if-shell 'tmux join-pane -d -t :6' '' 'break-pane -d -t :6'
bind -n M-7 if-shell 'tmux select-window -t :7' '' 'new-window -t :7'
bind -n 'M-&' if-shell 'tmux join-pane -d -t :7' '' 'break-pane -d -t :7'
bind -n M-8 if-shell 'tmux select-window -t :8' '' 'new-window -t :8'
bind -n 'M-*' if-shell 'tmux join-pane -d -t :8' '' 'break-pane -d -t :8'
bind -n M-9 if-shell 'tmux select-window -t :9' '' 'new-window -t :9'
bind -n 'M-(' if-shell 'tmux join-pane -d -t :9' '' 'break-pane -d -t :9'
bind -n M-0 if-shell 'tmux select-window -t :10' '' 'new-window -t :10'
bind -n 'M-)' if-shell 'tmux join-pane -d -t :10' '' 'break-pane -d -t :10'