From 0b51c9dae4626e9b4c476a994e9782c07f3cea94 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 28 Mar 2020 13:01:30 +0100 Subject: [PATCH] bundles/users: deploy standard tmux config to /etc/tmux.conf instead of ~/.tmux.conf --- bundles/users/files/tmux.conf | 2 +- bundles/users/items.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bundles/users/files/tmux.conf b/bundles/users/files/tmux.conf index 74751f5..30d6857 100644 --- a/bundles/users/files/tmux.conf +++ b/bundles/users/files/tmux.conf @@ -1,6 +1,6 @@ unbind r # Reload with ctrl-r -bind r source-file ~/.tmux.conf \; display "Reloaded!" +bind r source-file /etc/tmux.conf \; source-file ~/.tmux.conf \; display "Reloaded!" bind C-a send-prefix # Pass on ctrl-a for other apps diff --git a/bundles/users/items.py b/bundles/users/items.py index 7dce1b8..6f21f19 100644 --- a/bundles/users/items.py +++ b/bundles/users/items.py @@ -21,6 +21,11 @@ files['/etc/bash.bashrc'] = { 'content_type': 'mako', } +files['/etc/tmux.conf'] = { + 'source': 'tmux.conf', + 'content_type': 'mako', +} + for username, attrs in node.metadata['users'].items(): home = attrs.get('home', '/home/{}'.format(username)) @@ -54,14 +59,15 @@ for username, attrs in node.metadata['users'].items(): files[home + '/.ssh/authorized_keys'] = {'delete': True} if exists(join(repo.path, 'data', 'users', 'files', 'tmux', '{}.conf'.format(username))): - tmux_src = 'tmux/{}.conf'.format(username) + files[home + '/.tmux.conf'] = { + 'content_type': 'mako', + 'source': 'tmux/{}.conf', + } else: - tmux_src = 'tmux.conf' + files[home + '/.tmux.conf'] = { + 'delete': True, + } - files[home + '/.tmux.conf'] = { - 'content_type': 'mako', - 'source': tmux_src, - } if exists(join(repo.path, 'data', 'users', 'files', 'fish', '{}.conf'.format(username))): fish_src = 'fisk/{}.conf'.format(username)