feat: add terminal configuration
This commit is contained in:
parent
9e7b380bba
commit
0882a6a0c9
9 changed files with 190 additions and 0 deletions
49
roles/terminal/files/alacritty.yml
Normal file
49
roles/terminal/files/alacritty.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
font:
|
||||
normal:
|
||||
family: JetBrains Mono
|
||||
style: Regular
|
||||
|
||||
bold:
|
||||
family: JetBrains Mono
|
||||
style: Bold
|
||||
|
||||
italic:
|
||||
family: JetBrains Mono
|
||||
style: Italic
|
||||
|
||||
bold_italic:
|
||||
family: JetBrains Mono
|
||||
style: Bold Italic
|
||||
|
||||
size: 13
|
||||
|
||||
# Colors (Gruvbox dark)
|
||||
colors:
|
||||
# Default colors
|
||||
primary:
|
||||
# hard contrast: background = '0x1d2021'
|
||||
background: '0x282828'
|
||||
# soft contrast: background = '0x32302f'
|
||||
foreground: '0xebdbb2'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0x282828'
|
||||
red: '0xcc241d'
|
||||
green: '0x98971a'
|
||||
yellow: '0xd79921'
|
||||
blue: '0x458588'
|
||||
magenta: '0xb16286'
|
||||
cyan: '0x689d6a'
|
||||
white: '0xa89984'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0x928374'
|
||||
red: '0xfb4934'
|
||||
green: '0xb8bb26'
|
||||
yellow: '0xfabd2f'
|
||||
blue: '0x83a598'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x8ec07c'
|
||||
white: '0xebdbb2'
|
3
roles/terminal/files/bash_aliases.sh
Normal file
3
roles/terminal/files/bash_aliases.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
alias ls='ls --color=auto'
|
||||
alias ll='ls -l'
|
||||
alias grep='grep --color=auto'
|
7
roles/terminal/files/bash_logout.sh
Normal file
7
roles/terminal/files/bash_logout.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
# ~/.bash_logout: executed by bash(1) when login shell exits.
|
||||
|
||||
# when leaving the console clear the screen to increase privacy
|
||||
|
||||
if [ "$SHLVL" = 1 ]; then
|
||||
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
|
||||
fi
|
59
roles/terminal/files/bashrc.sh
Normal file
59
roles/terminal/files/bashrc.sh
Normal file
|
@ -0,0 +1,59 @@
|
|||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
shopt -s globstar
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# Alias definitions.
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
23
roles/terminal/files/profile.sh
Normal file
23
roles/terminal/files/profile.sh
Normal file
|
@ -0,0 +1,23 @@
|
|||
# ~/.profile: executed by the command interpreter for login shells.
|
||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists.
|
||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
||||
# the files are located in the bash-doc package.
|
||||
|
||||
# if running bash
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/.local/bin" ] ; then
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
16
roles/terminal/tasks/alacritty.yml
Normal file
16
roles/terminal/tasks/alacritty.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
- name: Install alacritty and JetBrains Mono font
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- alacritty
|
||||
- fonts-jetbrains-mono
|
||||
- name: Create alacritty config dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_env.HOME }}/.config/alacritty"
|
||||
state: directory
|
||||
mode: '1770'
|
||||
- name: Copy alacritty config
|
||||
ansible.builtin.copy:
|
||||
src: files/alacritty.yml
|
||||
dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml"
|
||||
mode: '0660'
|
25
roles/terminal/tasks/bash.yml
Normal file
25
roles/terminal/tasks/bash.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
- name: Install bash
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- bash
|
||||
- name: Copy bash config
|
||||
ansible.builtin.copy:
|
||||
src: files/bashrc.sh
|
||||
dest: "{{ ansible_env.HOME }}/.bashrc"
|
||||
mode: '0660'
|
||||
- name: Copy bash aliases
|
||||
ansible.builtin.copy:
|
||||
src: files/bash_aliases.sh
|
||||
dest: "{{ ansible_env.HOME }}/.bash_aliases"
|
||||
mode: '0660'
|
||||
- name: Copy profile
|
||||
ansible.builtin.copy:
|
||||
src: files/profile.sh
|
||||
dest: "{{ ansible_env.HOME }}/.profile"
|
||||
mode: '0660'
|
||||
- name: Copy bash logout
|
||||
ansible.builtin.copy:
|
||||
src: files/profile.sh
|
||||
dest: "{{ ansible_env.HOME }}/.bash_logout"
|
||||
mode: '0660'
|
4
roles/terminal/tasks/main.yml
Normal file
4
roles/terminal/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Bash
|
||||
import_tasks: bash.yml
|
||||
- name: Alacritty
|
||||
import_tasks: alacritty.yml
|
4
terminal.yml
Normal file
4
terminal.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Terminal
|
||||
hosts: odhosts
|
||||
roles:
|
||||
- terminal
|
Loading…
Reference in a new issue