misc

xdotool

  • Send to window named iKVM

    xdotool windowactivate --sync $(xdotool search --name iKVM) type "$(printf "hello\nworld\n")"
    

tmux

  • toggle syncronization of panes (aka merge screen with clusterssh)

    :set-window-option synchronize-panes
    
  • create a window

    tmux new-window -dn "name-it" "command"
    
  • create multiple panes

    for i in {1..9}; do
      tmux split-window -t session-name:window-id "ssh server$i"
      tmux select-layout tiled
    done
    
  • get the name of current session

    tmux display-message -p '#S'
    
  • my ~/.tmux.conf

    # add prefix key to Ctrl+y
    set -g prefix2 C-y
    
    
    # Last active window
    bind C-y last-window
    bind C-p previous-window
    bind C-n next-window
    bind -n f7 previous-window
    bind -n f8 next-window
    
    
    # Sync panes on y
    bind y setw synchronize-panes
    
    
    # Change window move behavior
    bind . command-prompt "swap-window -t '%%'"
    bind > command-prompt "move-window -t '%%'"
    
    
    # History
    set -g history-limit 8192
    
    
    # Terminal emulator window title
    set -g set-titles on
    set -g set-titles-string '#S:#I.#P #W'
    
    
    # Notifying if other windows has activities
    setw -g monitor-activity off
    set -g visual-activity on
    
    
    # colors
    set-option -g status-bg colour235 #base02
    set-option -g status-fg colour136 #yellow
    set-option -g status-attr default
    
    
    # default window title colors
    set-window-option -g window-status-fg colour244
    set-window-option -g window-status-bg default
    #set-window-option -g window-status-attr dim
    
    
    # active window title colors
    set-window-option -g window-status-current-fg colour166 #orange
    set-window-option -g window-status-current-bg default
    #set-window-option -g window-status-current-attr bright
    
    
    # pane border
    set-option -g pane-border-fg colour235 #base02
    set-option -g pane-active-border-fg colour240 #base01
    
    
    # message text
    set-option -g message-bg colour235 #base02
    set-option -g message-fg colour166 #orange
    
    
    # pane number display
    set-option -g display-panes-active-colour colour33 #blue
    set-option -g display-panes-colour colour166 #orange
    
    
    # clock
    set-window-option -g clock-mode-colour colour64 #green
    

all pages tagged tmux

misc
Posted