Skip to content

Commit

Permalink
common tool rustify (#28)
Browse files Browse the repository at this point in the history
* feat(dwm/roles/pkg): add useful rust pkgs for core task

resort already present to highlight them

* feat(fish): use `starship` and `zoxide`

[starship](https://starship.rs/) is automatically
bootstrapped, no more need all boilerplate around fish
prompt, all can be configured using a simple toml file

[zoxide](https://github.com/ajeetdsouza/zoxide) acts exactly
as zjump fisher plugin but faster an better, remember to
import data from zjump db

* feat(ranger): s/zoxide/zjump

* feat(fish/aliases): add useful aliases

to use by default newly installed rust pkgs

* feat(sb-cpu): s/htop/btop

* feat(README): add changelog after rustify

* feat(pavucontrol-qt): s/pulsemixer/pavucontrol-qt

pulsemixer unmaintained, so switching temporally to
graphical fronted, waiting for new tui (maybe in rust :slurp:)

* chore(git/config): change email address with an alias

* fix(fish/functions/): use fd in mount/umount instead ls

otherwise after aliases ls=exa errors arise

* fix(ranger): change zoxide interactive jump keymap

* feat(fish/aliases): add tree and tree -a aliases

using `exa --tree`

* feat(fish): pin commit hash for fisher plugins

bump PatrickF1/fzf.fish to v9.8

* feat(dwm/roles/pkg): add `just` command runner

* feat(dwm/roles/pkg): add `kubectl` and `helm` pkgs

yeah no rust here

* feat(fish/aliases): add `kubectl` alias

* chore(fish/fisher): bump `PatrickF1/fzf.fish` to v9.9 sha

* chore(fish/fisher): bump fisher deps

* `PatrickF1/fzf.fish` to v10.0
* `jorgebucaran/fisher` to 4.4.4

since v10.0 is possible to configure custom pager via
`fzf_diff_highlighter`: use `delta`

* feat(dwm/roles)!: remove `ctags` install automation

no more used inside `nvim` lua config so useless

* fix(dwm): ansible-lint var-naming[no-role-prefix]

wish no error committed :/

* chore(lint.yml): pip inside venv and fix shellcheck warnings
  • Loading branch information
andros21 authored Sep 24, 2023
1 parent 10efbab commit 51b019c
Show file tree
Hide file tree
Showing 42 changed files with 305 additions and 997 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Shellcheck scripts
run: |
find * -type f -executable -exec shellcheck {} \;
find -- * -type f -executable -exec shellcheck {} \;
lint-playbook:
name: Lint playbooks
needs: changes
Expand All @@ -49,33 +49,35 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Setup some envs
- name: Setup env
run: |
echo "HOME=$HOME" >> $GITHUB_ENV
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
echo "ansible_dwm=ansible/.ansible/dwm/" >> $GITHUB_ENV
python -m venv "$HOME/.venv"
{ echo "HOME=$HOME";
echo "PATH=$HOME/.venv/bin:$PATH";
echo "ansible_dwm=ansible/.ansible/dwm/";
} >> "$GITHUB_ENV"
- name: Install requirements-dev.txt
run: |
cd $ansible_dwm
python -m pip install -r requirements-dev.txt
cd "$ansible_dwm"
pip install -r requirements-dev.txt
- name: Check ansible version
run: |
ansible --version
ansible-lint --version
- name: Install requirements.yml
run: |
cd $ansible_dwm
cd "$ansible_dwm"
ansible-galaxy collection install -r requirements.yml
- name: Run yaml-lint
run: |
cd $ansible_dwm
cd "$ansible_dwm"
yamllint .
- name: Run playbook syntax-check
run: |
cd $ansible_dwm
cd "$ansible_dwm"
ansible-playbook --syntax-check dwm.yml
ansible-playbook --syntax-check update.yml
- name: Run ansible-lint
run: |
cd $ansible_dwm
cd "$ansible_dwm"
ansible-lint
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ Custom [Luke's build of dwm](https://github.com/LukeSmithxyz/dwm), here my build

#### Shell `fish`

- Minimal custom fish shell prompt with git symbol integration (see [here](https://github.com/magicmonty/bash-git-prompt))
- [starship](https://starship.rs/) cross-shell prompt
- [zoxide](https://github.com/ajeetdsouza/zoxide) smarter cd command
- Switch from ssh-agent to gpg-agent for ssh-key authentication
- Speed up shell loading, dividing `login` tasks, from `no-login` tasks
- [Fisher](https://github.com/jorgebucaran/fisher) as default plugin manager
- [fzf.fish](https://github.com/PatrickF1/fzf.fish) fzf fisher plugin
- Custom aliases and functions for fish, aesthetics and functional purpose
- [Nord dir colors](https://github.com/arcticicestudio/nord-dircolors)
- udisksctl mount simple functions and relative aliases
Expand Down Expand Up @@ -110,8 +112,8 @@ Here my build [slock](https://github.com/andros21/slock)

- custom `rc.conf`
- custom `commands.py`:
- z jump (using fish z database)
- devicons
- [zoxide](https://github.com/jchook/ranger-zoxide)
- [devicons](https://github.com/alexanderjeurissen/ranger_devicons)
- fzf search
- compress/extract with [atool](https://www.nongnu.org/atool/)

Expand All @@ -121,7 +123,6 @@ Here my build [slock](https://github.com/andros21/slock)
- [rofi-power](https://github.com/okraits/rofi-tools) as systemctl power tool
- [teiler](https://github.com/carnager/teiler) as powerful screenshots and screencasts tool
- [ytdl-mpv](https://github.com/andros21/ytdl-mpv) as yt player
- [ctags](https://github.com/universal-ctags/ctags) as universal ctags generator
- [distrobox](https://github.com/89luca89/distrobox) as podman wrapper

## :rocket: Usage
Expand Down
2 changes: 1 addition & 1 deletion Xorg/xsessions/dwm-xorg.desktop.j2
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,5 @@ Comment[zh_CN]=此会话将让您登录到 DWM
Comment[zh_HK]=這個作業階段讓你登入 DWM
Comment[zh_TW]=這個工作階段讓您登入 DWM
Comment=This session logs you into DWM
Exec={{ dwm_path }}
Exec={{ conf_dwm_path }}
Type=Application
14 changes: 4 additions & 10 deletions ansible/.ansible/dwm/roles/build/tasks/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
chdir: '{{ ansible_user_dir }}/Documents/dev/clone/{{ item | basename }}'
params:
PREFIX: ~/.local
with_items: '{{ cloned_gits_make }}'
with_items: '{{ build_cloned_gits_make }}'
when: item | basename != 'ytdl-mpv'
ignore_errors: yes
- name: Make ytdl-mpv
Expand All @@ -18,22 +18,16 @@
chdir: '{{ ansible_user_dir }}/Documents/dev/{{ item | basename }}'
params:
PREFIX: ~/.local
with_items: '{{ cloned_gits_make }}'
with_items: '{{ build_cloned_gits_make }}'
when: item | basename == 'ytdl-mpv'
- name: Meson build system
ansible.builtin.shell: |
cd '{{ ansible_user_dir }}/Documents/dev/clone/{{ item | basename }}'
meson setup build --prefix '~/.local'
meson compile -C build
meson install -C build
with_items: '{{ cloned_gits_meson }}'
when: cloned_gits_meson is iterable
- name: Automake ctags
ansible.builtin.shell: |
cd '{{ ansible_user_dir }}/Documents/dev/clone/{{ ctags_git | basename }}'
./autogen.sh
./configure --prefix=$HOME/.local
make install
with_items: '{{ build_cloned_gits_meson }}'
when: build_cloned_gits_meson is iterable
- name: Install distrobox
ansible.builtin.shell: |
cd '{{ ansible_user_dir }}/Documents/dev/clone/{{ distrobox_git | basename }}'
Expand Down
4 changes: 2 additions & 2 deletions ansible/.ansible/dwm/roles/build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
target: install
chdir: '{{ ansible_user_dir }}/Documents/dev/fork/{{ item.origin | basename }}'
when: item.origin | basename != 'slock'
with_items: '{{ forked_gits }}'
with_items: '{{ build_forked_gits }}'
- name: Make slock
community.general.make:
target: install
chdir: '{{ ansible_user_dir }}/Documents/dev/fork/{{ item.origin | basename }}'
become: yes
when: item.origin | basename == 'slock'
with_items: '{{ forked_gits }}'
with_items: '{{ build_forked_gits }}'

- name: Latest build
ansible.builtin.include_tasks:
Expand Down
31 changes: 15 additions & 16 deletions ansible/.ansible/dwm/roles/build/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
# vars/main.yml

forked_gits:
- origin: https://github.com/andros21/dwm-luke
remote: https://github.com/lukesmithxyz/dwm
- origin: https://github.com/andros21/dwmblocks-luke
remote: https://github.com/lukesmithxyz/dwmblocks
- origin: https://github.com/andros21/slock
remote: https://git.suckless.org/slock
build_forked_gits:
- origin: https://github.com/andros21/dwm-luke
remote: https://github.com/lukesmithxyz/dwm
- origin: https://github.com/andros21/dwmblocks-luke
remote: https://github.com/lukesmithxyz/dwmblocks
- origin: https://github.com/andros21/slock
remote: https://git.suckless.org/slock

cloned_gits_make:
- https://github.com/andros21/ytdl-mpv
- https://github.com/carnager/rofi-pass
- https://github.com/carnager/teiler
cloned_gits_meson:
ctags_git: https://github.com/universal-ctags/ctags
distrobox_git: https://github.com/89luca89/distrobox
build_cloned_gits_make:
- https://github.com/andros21/ytdl-mpv
- https://github.com/carnager/rofi-pass
- https://github.com/carnager/teiler
build_cloned_gits_meson:
build_distrobox_git: https://github.com/89luca89/distrobox

ranger_gits:
- https://github.com/alexanderjeurissen/ranger_devicons
build_ranger_gits:
- https://github.com/alexanderjeurissen/ranger_devicons
2 changes: 1 addition & 1 deletion ansible/.ansible/dwm/roles/conf/tasks/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
- name: Enable services
ansible.builtin.command:
cmd: rc-update add '{{ item }}'
with_items: '{{ rc_services }}'
with_items: '{{ conf_rc_services }}'
when: item != 'fwupd'

- name: Enable fwupd
Expand Down
12 changes: 6 additions & 6 deletions ansible/.ansible/dwm/roles/conf/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
ansible.builtin.file:
path: '{{ ansible_user_dir }}/{{ item }}'
state: absent
with_items: '{{ file_to_rm }}'
with_items: '{{ conf_file_to_rm }}'
- name: Create some locations
ansible.builtin.file:
path: '{{ ansible_user_dir }}/{{ item }}'
state: directory
with_items: '{{ path_to_mk }}'
with_items: '{{ conf_path_to_mk }}'
- name: Collect paths to stow
ansible.builtin.find:
paths: '{{ ansible_user_dir }}/.dotfiles/'
Expand All @@ -33,7 +33,7 @@
ansible.builtin.file:
path: '{{ ansible_user_dir }}/{{ item }}'
state: directory
with_items: '{{ my_std_xdg_path }}'
with_items: '{{ conf_my_std_xdg_path }}'

- name: Syncthing .stignore
block:
Expand Down Expand Up @@ -62,7 +62,7 @@
block:
- name: Download nord theme
ansible.builtin.get_url:
url: '{{ nord_alatty_url }}'
url: '{{ conf_nord_alatty_url }}'
dest: '{{ ansible_user_dir }}/.config/alacritty/nord.yml'
- name: Temp patch it (lazy upstream)
ansible.builtin.replace:
Expand All @@ -74,7 +74,7 @@
block:
- name: Download Hack Nerd Fonts
ansible.builtin.get_url:
url: '{{ font_url }}'
url: '{{ conf_font_url }}'
dest: '{{ ansible_user_dir }}/.local/share/fonts/Hack/'
- name: Install Hack Nerd Fonts
ansible.builtin.command: fc-cache -f
Expand All @@ -83,4 +83,4 @@
ansible.builtin.get_url:
url: '{{ item.url }}'
dest: '{{ ansible_user_dir }}/Pictures/Wallpapers/{{ item.name }}'
with_items: '{{ wallpapers }}'
with_items: '{{ conf_wallpapers }}'
6 changes: 3 additions & 3 deletions ansible/.ansible/dwm/roles/conf/tasks/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
block:
- name: Create dir conf
ansible.builtin.file:
path: '{{ xorg_conf.dest | dirname }}'
path: '{{ conf_xorg.dest | dirname }}'
state: directory
- name: Copy conf from template
ansible.builtin.template:
src: '{{ xorg_conf.src }}'
dest: '{{ xorg_conf.dest }}'
src: '{{ conf_xorg.src }}'
dest: '{{ conf_xorg.dest }}'
owner: root
group: root
mode: 0644
Expand Down
2 changes: 1 addition & 1 deletion ansible/.ansible/dwm/roles/conf/vars/alpine.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# vars/alpine.yml

rc_services:
conf_rc_services:
- cgroups
- dbus
- dhcpcd
Expand Down
4 changes: 2 additions & 2 deletions ansible/.ansible/dwm/roles/conf/vars/fedora.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# vars/fedora.yml

xorg_conf:
conf_xorg:
src: '{{ ansible_user_dir }}/.dotfiles/Xorg/xsessions/dwm-xorg.desktop.j2'
dest: '/usr/local/share/xsessions/dwm-xorg.desktop'

dwm_path: '{{ ansible_user_dir }}/.local/bin/dwm'
conf_dwm_path: '{{ ansible_user_dir }}/.local/bin/dwm'
12 changes: 6 additions & 6 deletions ansible/.ansible/dwm/roles/conf/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# vars/main.yml

file_to_rm:
conf_file_to_rm:
- .bash_profile
- .bashrc
- .config/fish/

path_to_mk:
conf_path_to_mk:
- .config/alacritty/
- .config/fish/conf.d/
- .config/fish/functions/
Expand All @@ -15,17 +15,17 @@ path_to_mk:
- .local/share/fonts/Hack/
- .tmux/

my_std_xdg_path:
conf_my_std_xdg_path:
- Pictures/Paste
- Pictures/Screenshots
- Pictures/Wallpapers
- Videos/Screencasts

nord_alatty_url: https://raw.githubusercontent.com/nordtheme/alacritty/main/src/nord.yaml
conf_nord_alatty_url: https://raw.githubusercontent.com/nordtheme/alacritty/main/src/nord.yaml

font_url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/Hack/Regular/HackNerdFont-Regular.ttf
conf_font_url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/Hack/Regular/HackNerdFont-Regular.ttf

wallpapers:
conf_wallpapers:
- url: https://r4.wallpaperbetter.com/wallpaper/912/256/892/landscape-forest-deer-artwork-wallpaper-19d0082d01fa2debd647a8df70a166fd.jpg
name: nord00.jpg
- url: https://r4.wallpaperbetter.com/wallpaper/208/967/794/lake-artwork-gradient-vector-wallpaper-68665d38c080fca8809ca18e8862342a.jpg
Expand Down
2 changes: 1 addition & 1 deletion ansible/.ansible/dwm/roles/git/tasks/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
with_items: "{{ cloned_gits | map(attribute='origin') | list | select('match', '^.*com/.*/(?!(ytdl-mpv|teiler)).*') | list }}"
with_items: "{{ git_cloned_gits | map(attribute='origin') | list | select('match', '^.*com/.*/(?!(ytdl-mpv|teiler)).*') | list }}"
10 changes: 5 additions & 5 deletions ansible/.ansible/dwm/roles/git/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
repo: '{{ item.origin }}'
dest: '{{ ansible_user_dir }}/Documents/dev/fork/{{ item.origin | basename }}'
version: master
with_items: '{{ forked_gits }}'
with_items: '{{ git_forked_gits }}'

- name: Add upstream to forked gits
ansible.builtin.command:
cmd: git remote add upstream '{{ item.upstream | quote }}'
chdir: '{{ ansible_user_dir }}/Documents/dev/fork/{{ item.origin | basename }}'
with_items: '{{ forked_gits }}'
with_items: '{{ git_forked_gits }}'

- name: Clone cloned gits
block:
Expand All @@ -21,22 +21,22 @@
repo: '{{ item.origin }}'
dest: '{{ ansible_user_dir }}/Documents/dev/clone/{{ item.origin | basename }}'
version: '{{ item.branch }}'
with_items: '{{ cloned_gits }}'
with_items: '{{ git_cloned_gits }}'
when: item.origin | basename != 'ytdl-mpv'
- name: Git clone ytdl-mpv
ansible.builtin.git:
repo: '{{ item.origin }}'
dest: '{{ ansible_user_dir }}/Documents/dev/{{ item.origin | basename }}'
version: '{{ item.branch }}'
with_items: '{{ cloned_gits }}'
with_items: '{{ git_cloned_gits }}'
when: item.origin | basename == 'ytdl-mpv'

- name: Clone ranger gits
ansible.builtin.git:
repo: '{{ item }}'
dest: '{{ ansible_user_dir }}/.config/ranger/plugins/{{ item | basename }}'
version: main
with_items: '{{ ranger_gits }}'
with_items: '{{ git_ranger_gits }}'

- name: Latest tag
ansible.builtin.include_tasks:
Expand Down
Loading

0 comments on commit 51b019c

Please sign in to comment.