-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux_for_root.sls
41 lines (36 loc) · 1.03 KB
/
tmux_for_root.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
include:
- tools
{% set marker = "# saltstack tmux automatic config" %}
{% set start = marker+ " start" %}
{% set end = marker+ " end" %}
create_tmux_conf:
file.touch:
- name: /root/.tmux.conf
/root/.tmux.conf:
file.blockreplace:
- marker_start: "{{ start }}"
- marker_end: "{{ end }}"
- content: |
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g terminal-overrides '*rxvt*:smcup@:rmcup@'
set-option -g mouse on
set-option -g history-limit 10000
- append_if_not_found: True
- require:
- pkg: tmux
create_root_profile:
file.touch:
- name: /root/.profile
/root/.profile:
file.blockreplace: {# XXX file.blockreplace does use "content" instead of "contents" #}
- marker_start: "{{ start }}"
- marker_end: "{{ end }}"
- content: |
if test -n "$PS1"; then
if test $TERM != "screen"; then
if tmux has; then tmux a; else tmux; fi
fi
fi
- append_if_not_found: True
- require:
- pkg: tmux