added several ansible roles
This commit is contained in:
31
ansible/roles/lsd/tasks/main.yml
Normal file
31
ansible/roles/lsd/tasks/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: Install lsd
|
||||
become: true
|
||||
community.general.cargo:
|
||||
name: lsd
|
||||
locked: true
|
||||
path: '{{ ansible_user_dir }}/.cargo'
|
||||
executable: /usr/bin/cargo
|
||||
|
||||
- name: Create required folders
|
||||
file:
|
||||
state: directory
|
||||
dest: "{{ lookup('env', 'XDG_CONFIG_HOME') }}/{{ item.path }}"
|
||||
with_filetree: ../templates
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Install lsd config files
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ lookup('env', 'XDG_CONFIG_HOME') }}/lsd/{{ item.path }}"
|
||||
owner: "{{ ansible_user_uid }}"
|
||||
group: "{{ ansible_user_gid }}"
|
||||
mode: '{{ item.mode }}'
|
||||
with_filetree: templates/lsd/
|
||||
|
||||
- name: Add to .zshrc
|
||||
lineinfile:
|
||||
path: "{{ ansible_user_dir }}/.zshrc"
|
||||
insertafter: '\[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}.* \] && source {{ lookup("env", "XDG_CONFIG_HOME") }}.*'
|
||||
regexp: '\[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}/lsd/lsd\.rc \] && source {{ lookup("env", "XDG_CONFIG_HOME") }}/lsd/lsd\.rc'
|
||||
line: '[ -f {{ lookup("env", "XDG_CONFIG_HOME") }}/lsd/lsd.rc ] && source {{ lookup("env", "XDG_CONFIG_HOME") }}/lsd/lsd.rc'
|
||||
|
||||
27
ansible/roles/lsd/templates/colors.yaml
Normal file
27
ansible/roles/lsd/templates/colors.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
user: 253
|
||||
group: 253
|
||||
permission:
|
||||
read: dark_green
|
||||
write: dark_yellow
|
||||
exec: dark_red
|
||||
exec-sticky: 5
|
||||
no-access: 245
|
||||
octal: 6
|
||||
acl: dark_cyan
|
||||
context: cyan
|
||||
date:
|
||||
hour-old: [0x00, 0xAF, 0xFF]
|
||||
day-old: [0x00,0x5f,0xaf]
|
||||
older: 245
|
||||
size:
|
||||
none: 240
|
||||
small: 245
|
||||
medium: 250
|
||||
large: white
|
||||
inode:
|
||||
valid: 13
|
||||
invalid: 245
|
||||
links:
|
||||
valid: 13
|
||||
invalid: 245
|
||||
tree-edge: 245
|
||||
28
ansible/roles/lsd/templates/config.yaml
Normal file
28
ansible/roles/lsd/templates/config.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
blocks:
|
||||
- permission
|
||||
- user
|
||||
- group
|
||||
- size
|
||||
- date
|
||||
- name
|
||||
|
||||
color:
|
||||
# When to colorize the output.
|
||||
# When "classic" is set, this is set to "never".
|
||||
# Possible values: never, auto, always
|
||||
when: auto
|
||||
# How to colorize the output.
|
||||
# When "classic" is set, this is set to "no-color".
|
||||
# Possible values: default, <theme-file-name>
|
||||
# when specifying <theme-file-name>, lsd will look up theme file
|
||||
# XDG Base Directory if relative, e.g. ~/.config/lsd/themes/<theme-file-name>.yaml,
|
||||
# The file path if absolute
|
||||
theme: custom
|
||||
|
||||
# == Sorting ==
|
||||
sorting:
|
||||
column: name
|
||||
dir-grouping: first
|
||||
|
||||
no-symlink: false
|
||||
symlink-arrow: ⇒
|
||||
17
ansible/roles/lsd/templates/lsd.rc
Normal file
17
ansible/roles/lsd/templates/lsd.rc
Normal file
@@ -0,0 +1,17 @@
|
||||
alias ls='lsd --config-file $KHOME/.config/lsd/config.yaml'
|
||||
# ---
|
||||
alias l='ls -l'
|
||||
alias la='ls -a'
|
||||
alias ll='ls -lah'
|
||||
alias lt='ls -a --tree --depth 2 --ignore-glob .git'
|
||||
alias lt2='ls -a --tree --depth 3 --ignore-glob .git'
|
||||
alias lt3='ls -a --tree --depth 4 --ignore-glob .git'
|
||||
alias lt4='ls -a --tree --depth 5 --ignore-glob .git'
|
||||
alias lt5='ls -a --tree --depth 6 --ignore-glob .git'
|
||||
alias ltu='ls -a --tree --ignore-glob .git'
|
||||
alias ltl='ls -lah --tree --depth 2 --ignore-glob .git'
|
||||
alias ltl2='ls -lah --tree --depth 3 --ignore-glob .git'
|
||||
alias ltl3='ls -lah --tree --depth 4 --ignore-glob .git'
|
||||
alias ltl4='ls -lah --tree --depth 5 --ignore-glob .git'
|
||||
alias ltl5='ls -lah --tree --depth 6 --ignore-glob .git'
|
||||
alias ltlu='ls -lah --tree --ignore-glob .git'
|
||||
Reference in New Issue
Block a user