]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Manage tmux configuration
authorMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 13:55:57 +0000 (14:55 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 13:55:57 +0000 (14:55 +0100)
states/dotfiles.sls
states/tmux/files/tmux.conf [new file with mode: 0644]
states/tmux/gentoo.sls [new file with mode: 0644]
states/tmux/init.sls [new file with mode: 0644]

index 09b6ce878636ac820df81f08da938c1d7d2cbe2e..314556059cf79d27bec9719f59820bd2330378b3 100644 (file)
@@ -6,3 +6,4 @@ include:
   - mail
   - termite
   - qutebrowser
+  - tmux
diff --git a/states/tmux/files/tmux.conf b/states/tmux/files/tmux.conf
new file mode 100644 (file)
index 0000000..82d3cce
--- /dev/null
@@ -0,0 +1,88 @@
+# Set vi mode
+set -g mode-keys vi
+set -g history-limit 10000
+
+
+set -g default-command /bin/bash
+
+unbind C-b 
+set -g prefix C-a 
+bind C-a send-prefix
+
+set -g default-terminal "screen-256color"
+
+set -s escape-time 0
+
+# Options from https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
+# Better switching
+bind | split-window -h
+bind - split-window -v
+unbind '"'
+unbind %
+
+# Easier pane switching
+bind -n M-k select-pane -U
+bind -n M-j select-pane -D
+bind -n M-h select-pane -L
+bind -n M-l select-pane -R
+
+# Easy reloading of config
+bind r source-file ~/.tmux.conf
+
+# Mouse bindings. THIS IS AWESOME!
+set -g mouse on
+
+# Dont rename windows (allows setting mail for instance)
+set -g allow-rename off
+
+## move x clipboard into tmux buffer
+#bind C-p run "tmux set-buffer \"$(xclip -o)\""
+## move tmux copy buffer into x clipboard
+#bind C-y run "tmux save-buffer - | xclip -i"
+
+#move wayland clipbord into tmux buffer
+bind C-p run "tmux set-buffer \"$(wl-paste)\""
+# move tmux copy buffer into wayland clipboard
+bind C-y run "tmux save-buffer - | wl-copy"
+
+
+
+####################################
+# DESING ###########################
+# By /u/dothebarbwa on /r/unixporn #
+####################################
+
+# loud or quiet?
+set-option -g visual-activity off
+set-option -g visual-bell off
+set-option -g visual-silence off
+set-window-option -g monitor-activity off
+set-option -g bell-action none
+
+#  modes
+setw -g clock-mode-colour colour5
+setw -g mode-style bold,fg=colour7,bg=colour8
+
+# panes
+set -g pane-border-style bg=colour8,fg=colour0
+set -g pane-active-border-style bg=colour0,fg=colour7
+
+# statusbar
+set -g status-position bottom
+set -g status-justify left
+set -g status-style bg=colour0,fg=colour137,dim
+set -g status-left ''
+set -g status-right '#[fg=colour233,bg=colour8,bold] %d/%m #[fg=colour233,bg=colour7,bold] %H:%M:%S '
+set -g status-right-length 50
+set -g status-left-length 20
+
+setw -g window-status-current-style fg=colour3,bg=colour8,bold
+setw -g window-status-current-format ' #I#[fg=colour3]:#[fg=colour7]#W#[fg=colour249]#F '
+
+setw -g window-status-style fg=colour8,bg=colour7,none
+setw -g window-status-format ' #I#[fg=colour8]:#[fg=colour8]#W#[fg=colour8]#F '
+
+setw -g window-status-bell-style fg=colour255,bg=colour1,bold
+
+# messages
+set -g message-style fg=colour3,bg=colour0,bold
diff --git a/states/tmux/gentoo.sls b/states/tmux/gentoo.sls
new file mode 100644 (file)
index 0000000..a7137a8
--- /dev/null
@@ -0,0 +1,3 @@
+install tmux:
+  pkg.installed:
+    - name: app-misc/tmux
diff --git a/states/tmux/init.sls b/states/tmux/init.sls
new file mode 100644 (file)
index 0000000..83c49a8
--- /dev/null
@@ -0,0 +1,10 @@
+include:
+  - tmux.{{ grains['os'] |lower }}
+
+tmux configuration:
+  file.managed:
+    - name: {{ grains['homedir'] }}/.tmux.conf
+    - source: salt://tmux/files/tmux.conf
+    - user: {{ grains['user'] }}
+    - group: {{ grains['user'] }}
+    - mode: 640