diff --git a/tasks/setup.yml b/tasks/setup.yml index 9a2b399..101a7e9 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -33,15 +33,32 @@ state: touch mode: '0644' -- name: create alacritty configuration dir +- name: create wezterm configuration dir file: - path: '{{ xdg_config_dir }}/alacritty' + path: '{{ xdg_config_dir }}/wezterm/includes' state: directory -- name: copy alacritty configuration +- name: copy wezterm configuration files template: - dest: '{{ xdg_config_dir }}/alacritty/alacritty.toml' - src: 'templates/alacritty.j2' + src: '{{ item.src }}' + dest: '{{ item.dest }}' + loop: + - { + src: 'templates/wezterm/wezterm.lua.j2', + dest: '{{ xdg_config_dir }}/wezterm/wezterm.lua' + } + - { + src: 'templates/wezterm/includes/colors.lua.j2', + dest: '{{ xdg_config_dir }}/wezterm/includes/colors.lua' + } + - { + src: 'templates/wezterm/includes/fonts.lua.j2', + dest: '{{ xdg_config_dir }}/wezterm/includes/fonts.lua' + } + - { + src: 'templates/wezterm/includes/window.lua.j2', + dest: '{{ xdg_config_dir }}/wezterm/includes/window.lua' + } - name: enable fstrim timer become: true diff --git a/templates/alacritty.j2 b/templates/alacritty.j2 deleted file mode 100644 index d8217d2..0000000 --- a/templates/alacritty.j2 +++ /dev/null @@ -1,62 +0,0 @@ -# {{ ansible_managed }} -# -import = [ "{{ xdg_config_dir }}/alacritty/include.toml" ] - -[selection] -save_to_clipboard = true - -[keyboard] -bindings = [{ key = "N", mods = "Control | Shift", action = "SpawnNewInstance" },] - -[font] -normal = { family = "monospace", style = "Regular" } - -[colors] - [colors.primary] - # Terminal stying - # Defaults - # foreground = "#d8d8d8" - # background = "#181818" - - foreground = "#000000" - background = "#ffffff" - - [colors.normal] - # Defaults - # black = "#181818" - # red = "#ac4242" - # green = "#90a959" - # yellow = "#f4bf75" - # blue = "#6a9fb5" - # magenta = "#aa759f" - # cyan = "#75b5aa" - # white = "#d8d8d8" - - black = "#353535" - red = "#e84f4f" - green = "#77d62f" - yellow = "#e1aa5d" - blue = "#7dc1cf" - magenta = "#9b64fb" - cyan = "#6d878d" - white = "#dddddd" - - [colors.dim] - # Defaults - # black = "#0f0f0f" - # red = "#712b2b" - # green = "#5f6f3a" - # yellow = "#a17e4d" - # blue = "#456877" - # magenta = "#704d68" - # cyan = "#4d7770" - # white = "#8e8e8e" - - black = "#0f0f0f" - red = "#712b2b" - green = "#5f6f3a" - yellow = "#a17e4d" - blue = "#456877" - magenta = "#704d68" - cyan = "#4d7770" - white = "#8e8e8e" diff --git a/templates/wezterm/includes/colors.lua.j2 b/templates/wezterm/includes/colors.lua.j2 new file mode 100644 index 0000000..b8cd344 --- /dev/null +++ b/templates/wezterm/includes/colors.lua.j2 @@ -0,0 +1,10 @@ +-- {{ ansible_managed }} + +return { + colors = { + -- The default text color + foreground = 'black', + -- The default background color + background = 'white' + } +} diff --git a/templates/wezterm/includes/fonts.lua.j2 b/templates/wezterm/includes/fonts.lua.j2 new file mode 100644 index 0000000..3394be8 --- /dev/null +++ b/templates/wezterm/includes/fonts.lua.j2 @@ -0,0 +1,14 @@ +-- {{ ansible_managed }} + +local wezterm = require 'wezterm'; + +return { + font = wezterm.font( + 'MonaspiceNe Nerd Font Mono', + { weight = 'Regular', stretch = 'Normal', style = 'Normal' } + ), + + font_size = 11, + freetype_load_target = 'Light', + freetype_render_target = 'HorizontalLcd' +} diff --git a/templates/wezterm/includes/window.lua.j2 b/templates/wezterm/includes/window.lua.j2 new file mode 100644 index 0000000..392724a --- /dev/null +++ b/templates/wezterm/includes/window.lua.j2 @@ -0,0 +1,17 @@ +-- {{ ansible_managed }} + +return { + -- disable the tabbar + enable_tab_bar = false, + + -- window size + initial_cols = 145, + initial_rows = 35, + + window_padding = { + left = 0, + right = 0, + top = 0, + bottom = 0, + } +} diff --git a/templates/wezterm/wezterm.lua.j2 b/templates/wezterm/wezterm.lua.j2 new file mode 100644 index 0000000..557bebb --- /dev/null +++ b/templates/wezterm/wezterm.lua.j2 @@ -0,0 +1,22 @@ +-- {{ ansible_managed }} + +local wezterm = require 'wezterm'; +local config = wezterm.config_builder(); + +config.term = 'wezterm'; + +local modules = { + 'colors', + 'fonts', + 'window', +} + +for _, module_name in pairs(modules) do + local module_path = string.format('includes.%s', module_name) + local module = require(module_path) + for key, value in pairs(module) do + config[key] = value; + end +end + +return config diff --git a/vars/main.yml b/vars/main.yml index 547dbde..daecfe9 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -14,7 +14,7 @@ packages: - postgresql - plasma-meta - syncthing - - alacritty + - wezterm - tmux - unrar - vim @@ -29,5 +29,6 @@ packages: - pipewire-pulse - pipewire-alsa - wireguard-tools + - otf-monaspace-nerd platform_packages: []