diff options
Diffstat (limited to 'roles')
| -rw-r--r-- | roles/hyprland/meta/main.yml | 1 | ||||
| -rw-r--r-- | roles/hyprtheme/tasks/template-theme.yml | 1 | ||||
| -rw-r--r-- | roles/hyprtheme/templates/theme/tofi.config.j2 | 45 | ||||
| -rw-r--r-- | roles/tofi/files/config | 46 | ||||
| -rw-r--r-- | roles/tofi/meta/argument_specs.yml | 6 | ||||
| -rw-r--r-- | roles/tofi/meta/main.yml | 12 | ||||
| -rw-r--r-- | roles/tofi/tasks/main.yml | 38 |
7 files changed, 149 insertions, 0 deletions
diff --git a/roles/hyprland/meta/main.yml b/roles/hyprland/meta/main.yml index 572ca806..c22bcc84 100644 --- a/roles/hyprland/meta/main.yml +++ b/roles/hyprland/meta/main.yml @@ -10,6 +10,7 @@ dependencies: - role: "aur_font" - role: "waybar" - role: "clipse" + - role: "tofi" - role: "hyprcursor" - role: "hyprtheme" galaxy_info: diff --git a/roles/hyprtheme/tasks/template-theme.yml b/roles/hyprtheme/tasks/template-theme.yml index 375d059d..7af3a634 100644 --- a/roles/hyprtheme/tasks/template-theme.yml +++ b/roles/hyprtheme/tasks/template-theme.yml @@ -16,6 +16,7 @@ - "walker.css" - "waybar.css" - "clipse.json" + - "tofi.config" - name: "Template theme files for: {{ hyprtheme_name }}" ansible.builtin.template: diff --git a/roles/hyprtheme/templates/theme/tofi.config.j2 b/roles/hyprtheme/templates/theme/tofi.config.j2 new file mode 100644 index 00000000..3d71a758 --- /dev/null +++ b/roles/hyprtheme/templates/theme/tofi.config.j2 @@ -0,0 +1,45 @@ +text-color = {{ foreground }} + +prompt-color = {{ accent }} +prompt-background = {{ background }} + +placeholder-color = {{foreground }}A8 +placeholder-background = {{ background }} + +input-color = {{ foreground }} +input-background = {{ background }} + +# default-result-color = {{ foreground }} +default-result-background = {{ background }} + +selection-color = {{ accent }} +selection-background = {{ background }} +# Matching portion of selection text +selection-match-color = {{ color5 }} + +### Text cursor theme +text-cursor = false +# Supported values: bar, block, underscore +text-cursor-style = bar +text-cursor-thickness = 0 + + +### Window theming +# Using 875px causes fractional pixelization of the floating menu +width = 874 +height = 600 +background-color = {{ background }} + +outline-width = 0 +outline-color = {{ accent }} + +border-width = 2 +border-color = {{ accent }} + +corner-radius = 5 +padding-top = 14 +padding-bottom = 14 +padding-left = 14 +padding-right = 14 +clip-to-padding = true +scale = true diff --git a/roles/tofi/files/config b/roles/tofi/files/config new file mode 100644 index 00000000..0cc136e7 --- /dev/null +++ b/roles/tofi/files/config @@ -0,0 +1,46 @@ +# Default config for tofi +# +# To use the following line to ~/.config/tofi/config +# include = /etc/xdg/tofi/config +# A complete reference of available options can be found in `man 5 tofi`. +# Ref: https://github.com/philj56/tofi/blob/1eb6137572ab6c257ab6ab851d5d742167c18120/doc/config + +### Fonts +font = "monospace" +font-size = 14 +font-features = "" +font-variations = "" +hint-font = true + +### Text layout +prompt-text = "Run: " +prompt-padding = 0 +placeholder-text = "Application" +num-results = 0 +result-spacing = 14 +horizontal = false +min-input-width = 0 + +### Window positioning +output = "" +anchor = center +exclusive-zone = 0 +margin-top = 0 +margin-bottom = 0 +margin-left = 0 +margin-right = 0 + +### Behaviour +hide-cursor = false +text-cursor = false +history = false +# history-file = /path/to/histfile +matching-algorithm = normal +require-match = true +auto-accept-single = false +hide-input = false +physical-keybindings = false +print-index = false +drun-launch = false +late-keyboard-init = false +multi-instance = true diff --git a/roles/tofi/meta/argument_specs.yml b/roles/tofi/meta/argument_specs.yml new file mode 100644 index 00000000..91cdfcf5 --- /dev/null +++ b/roles/tofi/meta/argument_specs.yml @@ -0,0 +1,6 @@ +--- +argument_specs: + main: + short_description: "Install tofi" + description: "Install tofi" + options: {} diff --git a/roles/tofi/meta/main.yml b/roles/tofi/meta/main.yml new file mode 100644 index 00000000..82a1aa8c --- /dev/null +++ b/roles/tofi/meta/main.yml @@ -0,0 +1,12 @@ +--- +dependencies: + - role: "yay" +galaxy_info: + author: "a14m" + description: "Install tofi" + license: "MIT" + min_ansible_version: "2.18" + platforms: + - name: "ArchLinux" + versions: + - "all" diff --git a/roles/tofi/tasks/main.yml b/roles/tofi/tasks/main.yml new file mode 100644 index 00000000..56b24972 --- /dev/null +++ b/roles/tofi/tasks/main.yml @@ -0,0 +1,38 @@ +--- +- name: "Ensure tofi is installed" + become: true + become_user: "aur_builder" + kewlfft.aur.aur: + name: "tofi" + state: "present" + use: "yay" + +- name: "Create config directories" + become: true + ansible.builtin.file: + path: "{{ item }}" + state: "directory" + mode: "0755" + loop: + - "/etc/xdg/tofi" + - "{{ ansible_facts['env']['HOME'] }}/.config/tofi" + +- name: "Configure system defaults" + become: true + ansible.builtin.copy: + src: "config" + dest: "/etc/xdg/tofi/config" + mode: "0644" + +- name: "Configure user defaults" + ansible.builtin.blockinfile: + path: "{{ ansible_facts['env']['HOME'] }}/.config/tofi/config" + state: "present" + prepend_newline: true + append_newline: true + marker: "# ==== {mark} ANSIBLE TOFI CONFIG" + block: | + # System defaults + include = /etc/xdg/tofi/config + # Load Theme + include = ../hyprtheme/current/tofi.config |
