Add tmux theme toggle configuration
This commit is contained in:
parent
3b50e0ee67
commit
a68558e4ae
2 changed files with 32 additions and 1 deletions
|
|
@ -38,9 +38,15 @@
|
|||
- src: '{{ ansible_env.HOME }}/dotfiles/.profile'
|
||||
dest: '{{ ansible_env.HOME }}/.profile'
|
||||
|
||||
- src: '{{ ansible_env.HOME }}/dotfiles/.tmux.conf'
|
||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf'
|
||||
dest: '{{ xdg_config_dir }}/tmux/tmux.conf'
|
||||
|
||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/light.conf'
|
||||
dest: '{{ xdg_config_dir }}/tmux/light.conf'
|
||||
|
||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/dark.conf'
|
||||
dest: '{{ xdg_config_dir }}/tmux/dark.conf'
|
||||
|
||||
- src: '{{ ansible_env.HOME }}/dotfiles/.gitignore'
|
||||
dest: '{{ xdg_config_dir }}/git/ignore'
|
||||
|
||||
|
|
@ -49,3 +55,9 @@
|
|||
src: 'templates/gitconfig.j2'
|
||||
dest: '{{ xdg_config_dir }}/git/config'
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy tmux toggle script
|
||||
ansible.builtin.template:
|
||||
src: 'templates/tmux-toggle.j2'
|
||||
dest: '{{ ansible_env.HOME }}/.local/bin/tmux-toggle.sh'
|
||||
mode: '0755'
|
||||
|
|
|
|||
19
templates/tmux-toggle.j2
Normal file
19
templates/tmux-toggle.j2
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env sh
|
||||
#
|
||||
# {{ ansible_managed }}
|
||||
#
|
||||
# Toggle the current window (all panes) between light and dark themes.
|
||||
|
||||
set -e
|
||||
|
||||
current_window_style=$(tmux show -Av window-style)
|
||||
|
||||
case $current_window_style in
|
||||
'fg=#000000,bg=#eff0f1')
|
||||
tmux source-file ~/.config/tmux/dark.conf
|
||||
;;
|
||||
*)
|
||||
# Change back to the default window style.
|
||||
tmux source-file ~/.config/tmux/light.conf
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue