From 51b019c012c02fd5a7090c3f757d7305f57b3ea9 Mon Sep 17 00:00:00 2001 From: andros21 Date: Sun, 24 Sep 2023 10:27:02 +0000 Subject: [PATCH] common tool rustify (#28) * 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 --- .github/workflows/lint.yml | 24 +- README.md | 9 +- Xorg/xsessions/dwm-xorg.desktop.j2 | 2 +- .../.ansible/dwm/roles/build/tasks/latest.yml | 14 +- .../.ansible/dwm/roles/build/tasks/main.yml | 4 +- .../.ansible/dwm/roles/build/vars/main.yml | 31 +-- .../.ansible/dwm/roles/conf/tasks/alpine.yml | 2 +- .../.ansible/dwm/roles/conf/tasks/common.yml | 12 +- .../.ansible/dwm/roles/conf/tasks/fedora.yml | 6 +- .../.ansible/dwm/roles/conf/vars/alpine.yml | 2 +- .../.ansible/dwm/roles/conf/vars/fedora.yml | 4 +- ansible/.ansible/dwm/roles/conf/vars/main.yml | 12 +- .../.ansible/dwm/roles/git/tasks/latest.yml | 2 +- ansible/.ansible/dwm/roles/git/tasks/main.yml | 10 +- ansible/.ansible/dwm/roles/git/vars/main.yml | 39 ++- .../.ansible/dwm/roles/pkg/tasks/alpine.yml | 12 +- .../.ansible/dwm/roles/pkg/tasks/common.yml | 4 +- .../.ansible/dwm/roles/pkg/tasks/fedora.yml | 2 +- .../.ansible/dwm/roles/pkg/vars/alpine.yml | 45 +-- .../.ansible/dwm/roles/pkg/vars/fedora.yml | 24 +- ansible/.ansible/dwm/roles/pkg/vars/main.yml | 5 +- .../.ansible/dwm/roles/repo/tasks/common.yml | 2 +- .../.ansible/dwm/roles/repo/tasks/fedora.yml | 4 +- .../.ansible/dwm/roles/repo/vars/fedora.yml | 4 +- ansible/.ansible/dwm/roles/repo/vars/main.yml | 2 +- dircolors/.dir_colors | 256 ------------------ dwmstatusbar/.local/bin/sb-cpu | 2 +- dwmstatusbar/.local/bin/sb-volume | 6 +- dwmstatusbar/.local/bin/sb-volume-mic | 6 +- fish/.config/fish/conf.d/aliases.fish | 114 ++++---- fish/.config/fish/config.fish | 93 ++++--- .../functions/.fish-git-prompt/gitstatus.py | 168 ------------ .../fish/functions/fish_mode_prompt.fish | 3 - fish/.config/fish/functions/fish_mount.fish | 26 +- fish/.config/fish/functions/fish_prompt.fish | 189 ------------- .../functions/fish_set_my_color_theme.fish | 32 --- fish/.config/fish/functions/fish_umount.fish | 26 +- fish/.config/fish/functions/ls.fish | 56 ---- git/.config/git/config-dev | 2 +- ranger/.config/ranger/commands.py | 29 -- ranger/.config/ranger/rc.conf | 1 + starship/.config/starship.toml | 16 ++ 42 files changed, 305 insertions(+), 997 deletions(-) delete mode 100644 dircolors/.dir_colors delete mode 100644 fish/.config/fish/functions/.fish-git-prompt/gitstatus.py delete mode 100644 fish/.config/fish/functions/fish_mode_prompt.fish delete mode 100644 fish/.config/fish/functions/fish_prompt.fish delete mode 100644 fish/.config/fish/functions/fish_set_my_color_theme.fish delete mode 100644 fish/.config/fish/functions/ls.fish create mode 100644 starship/.config/starship.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f53e810..0086bf9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 @@ -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 diff --git a/README.md b/README.md index 65a2cee..e36dbba 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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/) @@ -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 diff --git a/Xorg/xsessions/dwm-xorg.desktop.j2 b/Xorg/xsessions/dwm-xorg.desktop.j2 index 91bd4b2..16ec945 100644 --- a/Xorg/xsessions/dwm-xorg.desktop.j2 +++ b/Xorg/xsessions/dwm-xorg.desktop.j2 @@ -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 diff --git a/ansible/.ansible/dwm/roles/build/tasks/latest.yml b/ansible/.ansible/dwm/roles/build/tasks/latest.yml index 17fd3e0..66533f9 100644 --- a/ansible/.ansible/dwm/roles/build/tasks/latest.yml +++ b/ansible/.ansible/dwm/roles/build/tasks/latest.yml @@ -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 @@ -18,7 +18,7 @@ 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: | @@ -26,14 +26,8 @@ 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 }}' diff --git a/ansible/.ansible/dwm/roles/build/tasks/main.yml b/ansible/.ansible/dwm/roles/build/tasks/main.yml index 8066c4d..4ef5075 100644 --- a/ansible/.ansible/dwm/roles/build/tasks/main.yml +++ b/ansible/.ansible/dwm/roles/build/tasks/main.yml @@ -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: diff --git a/ansible/.ansible/dwm/roles/build/vars/main.yml b/ansible/.ansible/dwm/roles/build/vars/main.yml index c0d4b9c..ab3a309 100644 --- a/ansible/.ansible/dwm/roles/build/vars/main.yml +++ b/ansible/.ansible/dwm/roles/build/vars/main.yml @@ -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 diff --git a/ansible/.ansible/dwm/roles/conf/tasks/alpine.yml b/ansible/.ansible/dwm/roles/conf/tasks/alpine.yml index 029bb6e..d788b7c 100644 --- a/ansible/.ansible/dwm/roles/conf/tasks/alpine.yml +++ b/ansible/.ansible/dwm/roles/conf/tasks/alpine.yml @@ -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 diff --git a/ansible/.ansible/dwm/roles/conf/tasks/common.yml b/ansible/.ansible/dwm/roles/conf/tasks/common.yml index 8f687f6..cbe558d 100644 --- a/ansible/.ansible/dwm/roles/conf/tasks/common.yml +++ b/ansible/.ansible/dwm/roles/conf/tasks/common.yml @@ -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/' @@ -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: @@ -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: @@ -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 @@ -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 }}' diff --git a/ansible/.ansible/dwm/roles/conf/tasks/fedora.yml b/ansible/.ansible/dwm/roles/conf/tasks/fedora.yml index 04d0e01..05e254a 100644 --- a/ansible/.ansible/dwm/roles/conf/tasks/fedora.yml +++ b/ansible/.ansible/dwm/roles/conf/tasks/fedora.yml @@ -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 diff --git a/ansible/.ansible/dwm/roles/conf/vars/alpine.yml b/ansible/.ansible/dwm/roles/conf/vars/alpine.yml index 82b007e..7438ec4 100644 --- a/ansible/.ansible/dwm/roles/conf/vars/alpine.yml +++ b/ansible/.ansible/dwm/roles/conf/vars/alpine.yml @@ -1,7 +1,7 @@ --- # vars/alpine.yml -rc_services: +conf_rc_services: - cgroups - dbus - dhcpcd diff --git a/ansible/.ansible/dwm/roles/conf/vars/fedora.yml b/ansible/.ansible/dwm/roles/conf/vars/fedora.yml index 35c3b53..3e77a4c 100644 --- a/ansible/.ansible/dwm/roles/conf/vars/fedora.yml +++ b/ansible/.ansible/dwm/roles/conf/vars/fedora.yml @@ -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' diff --git a/ansible/.ansible/dwm/roles/conf/vars/main.yml b/ansible/.ansible/dwm/roles/conf/vars/main.yml index 321ebc0..bd246ef 100644 --- a/ansible/.ansible/dwm/roles/conf/vars/main.yml +++ b/ansible/.ansible/dwm/roles/conf/vars/main.yml @@ -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/ @@ -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 diff --git a/ansible/.ansible/dwm/roles/git/tasks/latest.yml b/ansible/.ansible/dwm/roles/git/tasks/latest.yml index 81a538f..74fa2bf 100644 --- a/ansible/.ansible/dwm/roles/git/tasks/latest.yml +++ b/ansible/.ansible/dwm/roles/git/tasks/latest.yml @@ -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 }}" diff --git a/ansible/.ansible/dwm/roles/git/tasks/main.yml b/ansible/.ansible/dwm/roles/git/tasks/main.yml index a0e2ad5..e147aaa 100644 --- a/ansible/.ansible/dwm/roles/git/tasks/main.yml +++ b/ansible/.ansible/dwm/roles/git/tasks/main.yml @@ -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: @@ -21,14 +21,14 @@ 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 @@ -36,7 +36,7 @@ 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: diff --git a/ansible/.ansible/dwm/roles/git/vars/main.yml b/ansible/.ansible/dwm/roles/git/vars/main.yml index 5ffc714..0c34aa8 100644 --- a/ansible/.ansible/dwm/roles/git/vars/main.yml +++ b/ansible/.ansible/dwm/roles/git/vars/main.yml @@ -1,25 +1,24 @@ --- # vars/main.yml -forked_gits: - - origin: https://github.com/andros21/dwm - upstream: https://github.com/lukesmithxyz/dwm - - origin: https://github.com/andros21/dwmblocks - upstream: https://github.com/lukesmithxyz/dwmblocks - - origin: https://github.com/andros21/slock - upstream: https://git.suckless.org/slock +git_forked_gits: + - origin: https://github.com/andros21/dwm + upstream: https://github.com/lukesmithxyz/dwm + - origin: https://github.com/andros21/dwmblocks + upstream: https://github.com/lukesmithxyz/dwmblocks + - origin: https://github.com/andros21/slock + upstream: https://git.suckless.org/slock -cloned_gits: - - origin: https://github.com/andros21/ytdl-mpv - branch: master - - origin: https://github.com/carnager/rofi-pass - branch: master - - origin: https://github.com/carnager/teiler - branch: master - - origin: https://github.com/universal-ctags/ctags - branch: master - - origin: https://github.com/89luca89/distrobox - branch: main +git_cloned_gits: + - origin: https://github.com/andros21/ytdl-mpv + branch: master + - origin: https://github.com/carnager/rofi-pass + branch: master + - origin: https://github.com/carnager/teiler + branch: master + - origin: https://github.com/89luca89/distrobox + branch: main -ranger_gits: - - https://github.com/alexanderjeurissen/ranger_devicons +git_ranger_gits: + - https://github.com/alexanderjeurissen/ranger_devicons + - https://github.com/jchook/ranger-zoxide diff --git a/ansible/.ansible/dwm/roles/pkg/tasks/alpine.yml b/ansible/.ansible/dwm/roles/pkg/tasks/alpine.yml index 1db9a1d..6fb5e1b 100644 --- a/ansible/.ansible/dwm/roles/pkg/tasks/alpine.yml +++ b/ansible/.ansible/dwm/roles/pkg/tasks/alpine.yml @@ -10,7 +10,7 @@ block: - name: Apk add community.general.apk: - name: '{{ base + base_deps + base_libs + build + utils }}' + name: '{{ pkg_base + pkg_base_deps + pkg_base_libs + pkg_build + pkg_utils }}' state: present update_cache: yes - name: Setup base xorg @@ -18,18 +18,18 @@ cmd: setup-xorg-base - name: Apk add plus community.general.apk: - name: '{{ audio_deps + input_deps + net_deps + uefi_bios_deps + video_deps + xorg_deps }}' + name: '{{ pkg_audio_deps + pkg_input_deps + pkg_net_deps + pkg_uefi_bios_deps + pkg_video_deps + pkg_xorg_deps }}' state: present update_cache: yes - name: Apk add edge/community community.general.apk: - name: '{{ edge_community }}' + name: '{{ pkg_edge_community }}' state: present update_cache: yes - repository: '{{ edge_community_repo }}' + repository: '{{ pkg_edge_community_repo }}' - name: Apk add edge/testing community.general.apk: - name: '{{ edge_testing }}' + name: '{{ pkg_edge_testing }}' state: present update_cache: yes - repository: '{{ edge_testing_repo }}' + repository: '{{ pkg_edge_testing_repo }}' diff --git a/ansible/.ansible/dwm/roles/pkg/tasks/common.yml b/ansible/.ansible/dwm/roles/pkg/tasks/common.yml index 3923466..470b374 100644 --- a/ansible/.ansible/dwm/roles/pkg/tasks/common.yml +++ b/ansible/.ansible/dwm/roles/pkg/tasks/common.yml @@ -8,11 +8,11 @@ name: '{{ item }}' state: present method: user - with_items: '{{ flathub }}' + with_items: '{{ pkg_flathub }}' - name: Pip install ansible.builtin.pip: name: '{{ item }}' state: present executable: /usr/bin/pip extra_args: --user - with_items: '{{ pypi }}' + with_items: '{{ pkg_pypi }}' diff --git a/ansible/.ansible/dwm/roles/pkg/tasks/fedora.yml b/ansible/.ansible/dwm/roles/pkg/tasks/fedora.yml index 6c06495..65d0f68 100644 --- a/ansible/.ansible/dwm/roles/pkg/tasks/fedora.yml +++ b/ansible/.ansible/dwm/roles/pkg/tasks/fedora.yml @@ -11,7 +11,7 @@ block: - name: Dnf install ansible.builtin.dnf: - name: '{{ base + base_deps + base_libs + build + utils }}' + name: '{{ pkg_base + pkg_base_deps + pkg_base_libs + pkg_build + pkg_utils }}' state: present update_cache: yes - name: Dnf remove diff --git a/ansible/.ansible/dwm/roles/pkg/vars/alpine.yml b/ansible/.ansible/dwm/roles/pkg/vars/alpine.yml index f04e891..c53c2eb 100644 --- a/ansible/.ansible/dwm/roles/pkg/vars/alpine.yml +++ b/ansible/.ansible/dwm/roles/pkg/vars/alpine.yml @@ -1,25 +1,31 @@ --- # vars/alpine.yml -base: +pkg_base: - alacritty - bash - bash-completion - bash-doc - bat + - btop + - delta + - exa - fd - fish - fzf - htop + - just - mandoc - neovim - pass - ranger + - ripgrep - rofi + - stow + - zoxide -base_deps: +pkg_base_deps: - curl - - delta - feh - ffmpeg - hunspell @@ -33,26 +39,25 @@ base_deps: - py3-wheel - python3-dev - restic - - ripgrep - screen - slop - sqlite - - stow - syncthing - tmux - - util-linux-misc # apk add mount umount if needed + - util-linux-misc # apk add mount umount if needed - xautolock - xclip - xdotool - xsel -audio_deps: +pkg_audio_deps: + - pavucontrol-qt - pipewire - pipewire-pulse - rtkit - wireplumber -input_deps: +pkg_input_deps: - android-tools - lm-sensors - rng-tools @@ -62,21 +67,21 @@ input_deps: - wpa_supplicant - xf86-input-libinput -net_deps: +pkg_net_deps: - awall - dhcpcd -uefi_bios_deps: +pkg_uefi_bios_deps: - fwupd - fwupd-plugin-all - intel-ucode -video_deps: +pkg_video_deps: - mesa-vulkan-intel - pciutils - xf86-video-intel -xorg_deps: +pkg_xorg_deps: - dbus - dbus-openrc - dbus-x11 @@ -99,7 +104,7 @@ xorg_deps: - xrandr - xset -build: +pkg_build: - autoconf - automake - build-base @@ -111,7 +116,7 @@ build: - npm - shellcheck -base_libs: +pkg_base_libs: #- libxcomposite - harfbuzz-dev - libx11-dev @@ -122,15 +127,17 @@ base_libs: - libxrandr-dev - pulseaudio-dev -utils: +pkg_utils: - encfs - socat -edge_community: +pkg_edge_community: + - helm + - kubectl -edge_testing: +pkg_edge_testing: - atool -edge_community_repo: https://dl-cdn.alpinelinux.org/alpine/edge/community +pkg_edge_community_repo: https://dl-cdn.alpinelinux.org/alpine/edge/community -edge_testing_repo: https://dl-cdn.alpinelinux.org/alpine/edge/testing +pkg_edge_testing_repo: https://dl-cdn.alpinelinux.org/alpine/edge/testing diff --git a/ansible/.ansible/dwm/roles/pkg/vars/fedora.yml b/ansible/.ansible/dwm/roles/pkg/vars/fedora.yml index 07a1f34..ad24b9f 100644 --- a/ansible/.ansible/dwm/roles/pkg/vars/fedora.yml +++ b/ansible/.ansible/dwm/roles/pkg/vars/fedora.yml @@ -1,20 +1,26 @@ --- # vars/fedora.yml -base: +pkg_base: - alacritty - bat - - git-delta + - btop + - exa - fd-find - fish - fzf + - git-delta - htop + - just - neovim - pass - ranger + - ripgrep - rofi + - stow + - zoxide -base_deps: +pkg_base_deps: - NetworkManager-tui - atool - brightnessctl @@ -24,14 +30,12 @@ base_deps: - lm_sensors - maim - mpv + - pavucontrol-qt - picom - pwgen - python3-wheel - restic - - ripgrep - slop - - sqlite - - stow - syncthing - xautolock - xclip @@ -40,7 +44,7 @@ base_deps: - xsel - xset -build: +pkg_build: - autoconf - automake - clang @@ -50,7 +54,7 @@ build: - npm - shellcheck -base_libs: +pkg_base_libs: - harfbuzz-devel - libX11-devel - libXft-devel @@ -58,11 +62,13 @@ base_libs: - libXrandr-devel - libxcb-devel -utils: +pkg_utils: - cloud-utils - coreos-installer - fuse-encfs - guestfs-tools + - helm + - kubernetes-client - libguestfs-rescue - openssl - socat diff --git a/ansible/.ansible/dwm/roles/pkg/vars/main.yml b/ansible/.ansible/dwm/roles/pkg/vars/main.yml index 43de83a..f8ecf31 100644 --- a/ansible/.ansible/dwm/roles/pkg/vars/main.yml +++ b/ansible/.ansible/dwm/roles/pkg/vars/main.yml @@ -1,12 +1,11 @@ --- # vars/main.yml -flathub: +pkg_flathub: - io.gitlab.librewolf-community - org.telegram.desktop -pypi: +pkg_pypi: - ipython - pre-commit - - pulsemixer - yt-dlp diff --git a/ansible/.ansible/dwm/roles/repo/tasks/common.yml b/ansible/.ansible/dwm/roles/repo/tasks/common.yml index ee3350f..ea8cd20 100644 --- a/ansible/.ansible/dwm/roles/repo/tasks/common.yml +++ b/ansible/.ansible/dwm/roles/repo/tasks/common.yml @@ -5,5 +5,5 @@ community.general.flatpak_remote: name: flathub state: present - flatpakrepo_url: '{{ flathub_repo }}' + flatpakrepo_url: '{{ repo_flathub }}' method: user diff --git a/ansible/.ansible/dwm/roles/repo/tasks/fedora.yml b/ansible/.ansible/dwm/roles/repo/tasks/fedora.yml index d2d9af2..1dc005d 100644 --- a/ansible/.ansible/dwm/roles/repo/tasks/fedora.yml +++ b/ansible/.ansible/dwm/roles/repo/tasks/fedora.yml @@ -3,10 +3,10 @@ - name: Import rpmfusion free key ansible.builtin.rpm_key: - key: '{{ rpmfusion_free_key }}' + key: '{{ repo_rpmfusion_free_key }}' state: present - name: Add rpmfusion_free repos ansible.builtin.dnf: - name: '{{ rpmfusion_repo }}' + name: '{{ repo_rpmfusion_repo }}' state: present diff --git a/ansible/.ansible/dwm/roles/repo/vars/fedora.yml b/ansible/.ansible/dwm/roles/repo/vars/fedora.yml index f792f21..60b1c98 100644 --- a/ansible/.ansible/dwm/roles/repo/vars/fedora.yml +++ b/ansible/.ansible/dwm/roles/repo/vars/fedora.yml @@ -1,6 +1,6 @@ --- # vars/fedora.yml -rpmfusion_free_key: "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-2020" +repo_rpmfusion_free_key: "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-2020" -rpmfusion_repo: "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_major_version }}.noarch.rpm" +repo_rpmfusion_repo: "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_major_version }}.noarch.rpm" diff --git a/ansible/.ansible/dwm/roles/repo/vars/main.yml b/ansible/.ansible/dwm/roles/repo/vars/main.yml index 1d96521..c7a2886 100644 --- a/ansible/.ansible/dwm/roles/repo/vars/main.yml +++ b/ansible/.ansible/dwm/roles/repo/vars/main.yml @@ -1,4 +1,4 @@ --- # vars/main.yml -flathub_repo: "https://dl.flathub.org/repo/flathub.flatpakrepo" +repo_flathub: "https://dl.flathub.org/repo/flathub.flatpakrepo" diff --git a/dircolors/.dir_colors b/dircolors/.dir_colors deleted file mode 100644 index 658e5b7..0000000 --- a/dircolors/.dir_colors +++ /dev/null @@ -1,256 +0,0 @@ -# Copyright (C) 2017-present Arctic Ice Studio -# Copyright (C) 2017-present Sven Greb - -# Project: Nord dircolors -# Version: 0.2.0 -# Repository: https://github.com/arcticicestudio/nord-dircolors -# License: MIT - -COLOR tty - -TERM alacritty -TERM alacritty-direct -TERM ansi -TERM *color* -TERM con[0-9]*x[0-9]* -TERM cons25 -TERM console -TERM cygwin -TERM dtterm -TERM dvtm -TERM dvtm-256color -TERM Eterm -TERM eterm-color -TERM fbterm -TERM gnome -TERM gnome-256color -TERM hurd -TERM jfbterm -TERM konsole -TERM konsole-256color -TERM kterm -TERM linux -TERM linux-c -TERM mlterm -TERM putty -TERM putty-256color -TERM rxvt* -TERM rxvt-unicode -TERM rxvt-256color -TERM rxvt-unicode256 -TERM screen* -TERM screen-256color -TERM st -TERM st-256color -TERM terminator -TERM tmux* -TERM tmux-256color -TERM vt100 -TERM xterm* -TERM xterm-color -TERM xterm-88color -TERM xterm-256color -TERM xterm-kitty - -#+-----------------+ -#+ Global Defaults + -#+-----------------+ -NORMAL 00 -RESET 0 - -FILE 00 -DIR 01;34 -LINK 36 -MULTIHARDLINK 04;36 - -FIFO 04;01;36 -SOCK 04;33 -DOOR 04;01;36 -BLK 01;33 -CHR 33 - -ORPHAN 31 -MISSING 01;37;41 - -EXEC 01;36 - -SETUID 01;04;37 -SETGID 01;04;37 -CAPABILITY 01;37 - -STICKY_OTHER_WRITABLE 01;37;44 -OTHER_WRITABLE 01;04;34 -STICKY 04;37;44 - -#+-------------------+ -#+ Extension Pattern + -#+-------------------+ -#+--- Archives ---+ -.7z 01;32 -.ace 01;32 -.alz 01;32 -.arc 01;32 -.arj 01;32 -.bz 01;32 -.bz2 01;32 -.cab 01;32 -.cpio 01;32 -.deb 01;32 -.dz 01;32 -.ear 01;32 -.gz 01;32 -.jar 01;32 -.lha 01;32 -.lrz 01;32 -.lz 01;32 -.lz4 01;32 -.lzh 01;32 -.lzma 01;32 -.lzo 01;32 -.rar 01;32 -.rpm 01;32 -.rz 01;32 -.sar 01;32 -.t7z 01;32 -.tar 01;32 -.taz 01;32 -.tbz 01;32 -.tbz2 01;32 -.tgz 01;32 -.tlz 01;32 -.txz 01;32 -.tz 01;32 -.tzo 01;32 -.tzst 01;32 -.war 01;32 -.xz 01;32 -.z 01;32 -.Z 01;32 -.zip 01;32 -.zoo 01;32 -.zst 01;32 - -#+--- Audio ---+ -.aac 32 -.au 32 -.flac 32 -.m4a 32 -.mid 32 -.midi 32 -.mka 32 -.mp3 32 -.mpa 32 -.mpeg 32 -.mpg 32 -.ogg 32 -.opus 32 -.ra 32 -.wav 32 - -#+--- Customs ---+ -.3des 01;35 -.aes 01;35 -.gpg 01;35 -.pgp 01;35 - -#+--- Documents ---+ -.doc 32 -.docx 32 -.dot 32 -.odg 32 -.odp 32 -.ods 32 -.odt 32 -.otg 32 -.otp 32 -.ots 32 -.ott 32 -.pdf 32 -.ppt 32 -.pptx 32 -.xls 32 -.xlsx 32 - -#+--- Executables ---+ -.app 01;36 -.bat 01;36 -.btm 01;36 -.cmd 01;36 -.com 01;36 -.exe 01;36 -.reg 01;36 - -#+--- Ignores ---+ -*~ 02;37 -.bak 02;37 -.BAK 02;37 -.log 02;37 -.log 02;37 -.old 02;37 -.OLD 02;37 -.orig 02;37 -.ORIG 02;37 -.swo 02;37 -.swp 02;37 - -#+--- Images ---+ -.bmp 32 -.cgm 32 -.dl 32 -.dvi 32 -.emf 32 -.eps 32 -.gif 32 -.jpeg 32 -.jpg 32 -.JPG 32 -.mng 32 -.pbm 32 -.pcx 32 -.pgm 32 -.png 32 -.PNG 32 -.ppm 32 -.pps 32 -.ppsx 32 -.ps 32 -.svg 32 -.svgz 32 -.tga 32 -.tif 32 -.tiff 32 -.xbm 32 -.xcf 32 -.xpm 32 -.xwd 32 -.xwd 32 -.yuv 32 - -#+--- Video ---+ -.anx 32 -.asf 32 -.avi 32 -.axv 32 -.flc 32 -.fli 32 -.flv 32 -.gl 32 -.m2v 32 -.m4v 32 -.mkv 32 -.mov 32 -.MOV 32 -.mp4 32 -.mpeg 32 -.mpg 32 -.nuv 32 -.ogm 32 -.ogv 32 -.ogx 32 -.qt 32 -.rm 32 -.rmvb 32 -.swf 32 -.vob 32 -.webm 32 -.wmv 32 diff --git a/dwmstatusbar/.local/bin/sb-cpu b/dwmstatusbar/.local/bin/sb-cpu index 1bb3290..b918add 100755 --- a/dwmstatusbar/.local/bin/sb-cpu +++ b/dwmstatusbar/.local/bin/sb-cpu @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) setsid -f alacritty -e htop ;; + 1) setsid -f alacritty -e btop ;; esac sensors | awk '/Core 0/ {print $3}' diff --git a/dwmstatusbar/.local/bin/sb-volume b/dwmstatusbar/.local/bin/sb-volume index d38cf38..9fe1af4 100755 --- a/dwmstatusbar/.local/bin/sb-volume +++ b/dwmstatusbar/.local/bin/sb-volume @@ -3,9 +3,9 @@ # Prints the current volume or M if muted. case $BLOCK_BUTTON in - 1) setsid -f alacritty -e pulsemixer ;; + 1) setsid -f pavucontrol-qt ;; esac printf '%s' "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" \ - | sed -E 's/Volume: 0.(.*)/\1%/' \ - | sed -E 's/(.*)[MUTED](.*)/M/' + | sed -E 's/Volume: 0.(.*)/\1%/' \ + | sed -E 's/(.*)[MUTED](.*)/M/' diff --git a/dwmstatusbar/.local/bin/sb-volume-mic b/dwmstatusbar/.local/bin/sb-volume-mic index 208160d..ec358c4 100755 --- a/dwmstatusbar/.local/bin/sb-volume-mic +++ b/dwmstatusbar/.local/bin/sb-volume-mic @@ -3,9 +3,9 @@ # Prints the current mic volume or M if muted. case $BLOCK_BUTTON in - 1) setsid -f alacritty -e pulsemixer ;; + 1) setsid -f pavucontrol-qt ;; esac printf '%s' "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" \ - | sed -E 's/Volume: 0.(.*)/\1%/' \ - | sed -E 's/(.*)[MUTED](.*)/M/' + | sed -E 's/Volume: 0.(.*)/\1%/' \ + | sed -E 's/(.*)[MUTED](.*)/M/' diff --git a/fish/.config/fish/conf.d/aliases.fish b/fish/.config/fish/conf.d/aliases.fish index 609ac4e..1646be1 100644 --- a/fish/.config/fish/conf.d/aliases.fish +++ b/fish/.config/fish/conf.d/aliases.fish @@ -3,72 +3,80 @@ # path # ---- -alias l 'll' -alias rm 'rm -i' -alias md 'mkdir -p' -alias p 'cd -' -alias .. 'cd ..' -alias ... 'cd ../..' -alias cdi 'cd /run/media/rox/' -alias cdv 'cd /run/user/1000/gvfs/' +alias ls exa +alias l 'exa -l --git' +alias la 'exa -a' +alias ll 'exa -al' +alias tre 'exa --tree' +alias tra 'exa --tree -a' +alias rm 'rm -i' +alias md 'mkdir -p' +alias p 'cd -' +alias .. 'cd ..' +alias ... 'cd ../..' +alias cdi 'cd /run/media/rox/' +alias cdv 'cd /run/user/1000/gvfs/' # bin # --- -alias gpg 'gpg2' -alias nv 'nvim' -alias less 'bat' -alias cat 'bat' -alias g 'git' -alias sha 'sha256sum -c --ignore-missing' -alias md5 'md5sum -c --ignore-missing' +alias gpg gpg2 +alias nv nvim +alias less bat +alias cat bat +alias g git +alias sha 'sha256sum -c --ignore-missing' +alias md5 'md5sum -c --ignore-missing' +alias xclip 'xclip -selection clipboard' +alias htop btop +alias k kubectl # func # ---- -alias gmm 'fish_mount' -alias gmu 'fish_umount' +alias gmm fish_mount +alias gmu fish_umount alias rgpg 'echo RELOADAGENT | gpg-connect-agent' # git # --- -alias gst 'git status' -alias gd 'git diff' -alias gdc 'git diff --cached' -alias gp 'git push' -alias gd 'git diff' -alias gf 'git fetch' -alias gpu 'git pull' -alias gm 'git merge' -alias gri 'git rebase -i' -alias grc 'git rebase --continue' +alias gst 'git status' +alias gd 'git diff' +alias gdc 'git diff --cached' +alias gp 'git push' +alias gd 'git diff' +alias gf 'git fetch' +alias gpu 'git pull' +alias gm 'git merge' +alias gri 'git rebase -i' +alias grc 'git rebase --continue' -alias ga 'git add' -alias gaa 'git add -A' -alias gc 'git commit -v' -alias gc! 'git commit -v --amend' -alias gca 'git commit -v -a' -alias gca! 'git commit -v -a --amend' -alias gcmsg 'git commit -m' +alias ga 'git add' +alias gaa 'git add -A' +alias gc 'git commit -v' +alias gc! 'git commit -v --amend' +alias gca 'git commit -v -a' +alias gca! 'git commit -v -a --amend' +alias gcmsg 'git commit -m' -alias grs 'git restore --staged' -alias grh 'git reset HEAD' -alias grhh 'git reset HEAD --hard' -alias grh1 'git reset HEAD~1' -alias grhh1 'git reset HEAD~1 --hard' +alias grs 'git restore --staged' +alias grh 'git reset HEAD' +alias grhh 'git reset HEAD --hard' +alias grh1 'git reset HEAD~1' +alias grhh1 'git reset HEAD~1 --hard' alias gclean 'git reset --hard; and git clean -dfx' -alias gco 'git checkout' -alias gcm 'git checkout master' -alias gb 'git branch' -alias gbv 'git branch -vv' -alias gba 'git branch -a' +alias gco 'git checkout' +alias gcm 'git checkout master' +alias gb 'git branch' +alias gbv 'git branch -vv' +alias gba 'git branch -a' -alias gcl 'git config --list' +alias gcl 'git config --list' alias gcount 'git shortlog -sn' -alias gl 'git log --stat --max-count 10' -alias gla 'git log --stat --all' -alias gl1 'git log --stat -n 1' -alias glg 'git log --graph --max-count 10' -alias glga 'git log --graph --decorate --all' -alias glo 'git log --oneline' -alias glog 'git log --oneline --graph --abbrev-commit --decorate' -alias gloga 'git log --oneline --graph --abbrev-commit --decorate --all' +alias gl 'git log --stat --max-count 10' +alias gla 'git log --stat --all' +alias gl1 'git log --stat -n 1' +alias glg 'git log --graph --max-count 10' +alias glga 'git log --graph --decorate --all' +alias glo 'git log --oneline' +alias glog 'git log --oneline --graph --abbrev-commit --decorate' +alias gloga 'git log --oneline --graph --abbrev-commit --decorate --all' diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 643a642..020fa51 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -2,47 +2,56 @@ # =========== if status is-login - # Set XDG_CONFIG_HOME - set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME ~/.config - # Set XDG_DATA_DIRS - set -q XDG_DATA_DIRS; or set -x XDG_DATA_DIRS \ - ~/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/ - # Change PATH - set -x PATH "$HOME/.local/bin" $PATH - # If RUST installed, modify PATH - if test -d ~/.cargo/bin - set -x PATH "$HOME/.cargo/bin" $PATH - end - # If FISHER not installed, install it with plugins - if not functions -q fisher - curl -sSL https://raw.githubusercontent.com/jorgebucaran/fisher/HEAD/functions/fisher.fish \ - | source && fisher install jorgebucaran/fisher - if test $status - fisher install jethrokuan/z - fisher install PatrickF1/fzf.fish@v8.1 - end - end - # Default EDITOR - set -x EDITOR nvim - # Default MANPAGER - set -x MANPAGER 'nvim +Man!' - # Nord theme BAT - set -x BAT_THEME 'Nord' - # Set my FISH color theme - set -q fish_my_color_theme; or fish_set_my_color_theme - # Startx for Alpine Linux (.xinitrc no gdm) - if test (awk -F '=' '/^ID=/ {print $2}' /etc/os-release) = 'alpine' - # Tweak PATH appending - set -ax PATH /usr/local/bin /usr/local/sbin /usr/sbin /sbin - if test -z "$DISPLAY" -a "$XDG_VTNR"=1 -a (tty) = "/dev/tty1" - # Startx - exec startx -- -keeptty - end - end + # Set XDG_CONFIG_HOME + set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME ~/.config + # Set XDG_DATA_DIRS + set -q XDG_DATA_DIRS; or set -x XDG_DATA_DIRS \ + ~/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/ + # Change PATH + set -x PATH "$HOME/.local/bin" $PATH + # If RUST installed, modify PATH + if test -d ~/.cargo/bin + set -x PATH "$HOME/.cargo/bin" $PATH + end + # If FISHER not installed, install it with plugins + if not functions -q fisher + set -l FISHER_SHA 2efd33ccd0777ece3f58895a093f32932bd377b6 # tag: 4.4.4 + set -l FZF_SHA f9e2e48a54199fe7c6c846556a12003e75ab798e # tag: v10.0 + curl -sSL https://raw.githubusercontent.com/jorgebucaran/fisher/$FISHER_SHA/functions/fisher.fish \ + | source && fisher install jorgebucaran/fisher@$FISHER_SHA + if test $status + fisher install PatrickF1/fzf.fish@$FZF_SHA + end + end + # If STARSHIP not installed, install it + if not functions -q starship + curl -sSL https://starship.rs/install.sh \ + | sh -s -- -y -b $HOME/.local/bin >/dev/null + end + # Default EDITOR + set -x EDITOR nvim + # Default MANPAGER + set -x MANPAGER 'nvim +Man!' + # Nord theme BAT + set -x BAT_THEME Nord + # Startx for Alpine Linux (.xinitrc no gdm) + if test (awk -F '=' '/^ID=/ {print $2}' /etc/os-release) = alpine + # Tweak PATH appending + set -ax PATH /usr/local/bin /usr/local/sbin /usr/sbin /sbin + if test -z "$DISPLAY" -a "$XDG_VTNR"=1 -a (tty) = /dev/tty1 + # Startx + exec startx -- -keeptty + end + end else - # Default FZF command - ## for fzf fisher plugin - set fzf_fd_opts --hidden --follow --exclude='{.cache,.git,.venv}' - ## for fzf nvim plugin - set -gx FZF_DEFAULT_COMMAND "fd $fzf_fd_opts 2>/dev/null" + # Default FZF command + ## for fzf fisher plugin + set fzf_fd_opts --hidden --follow --exclude='{.cache,.git,.venv}' + set fzf_diff_highlighter (which delta) + ## for fzf inside ranger + set -gx FZF_DEFAULT_COMMAND "fd $fzf_fd_opts 2>/dev/null" + # Starship fire on + starship init fish | source + # Zoxide fire on + zoxide init fish | source end diff --git a/fish/.config/fish/functions/.fish-git-prompt/gitstatus.py b/fish/.config/fish/functions/.fish-git-prompt/gitstatus.py deleted file mode 100644 index 36b97f4..0000000 --- a/fish/.config/fish/functions/.fish-git-prompt/gitstatus.py +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 -*- - -""" -This module defines a Print function to use with python 2.x or 3.x., -so we can use the prompt with older versions of Python too - -It's interface is that of python 3.0's print. See -http://docs.python.org/3.0/library/functions.html?highlight=print#print - -Shamelessly ripped from -http://www.daniweb.com/software-development/python/code/217214/a-print-function-for-different-versions-of-python -""" -# change those symbols to whatever you prefer - -import os -import re -import sys -from subprocess import PIPE, Popen - -symbols = {"ahead of": "⯅ ", "behind": "⯆ ", "prehash": ": "} - - -__all__ = ["Print"] - -try: - Print = eval("print") # python 3.0 case - python_version = 3 - to_str = str -except SyntaxError as e: - python_version = 2 - to_str = unicode - D = dict() - try: - exec("from __future__ import print_function\np=print", D) - Print = D["p"] # 2.6 case - except SyntaxError: - - def Print(*args, **kwd): # 2.4, 2.5, define our own Print function - fout = kwd.get("file", sys.stdout) - w = fout.write - if args: - w(str(args[0])) - sep = kwd.get("sep", " ") - for a in args[1:]: - w(sep) - w(str(a)) - w(kwd.get("end", "\n")) - - finally: - del D - - -def get_tag_or_hash(): - cmd = Popen(["git", "describe", "--exact-match"], stdout=PIPE, stderr=PIPE) - so, se = cmd.communicate() - tag = "%s" % so.decode("utf-8").strip() - - if tag: - return tag - else: - cmd = Popen(["git", "rev-parse", "--short", "HEAD"], stdout=PIPE, stderr=PIPE) - so, se = cmd.communicate() - hash_name = "%s" % so.decode("utf-8").strip() - return "".join([symbols["prehash"], hash_name]) - - -def get_stash(): - cmd = Popen(["git", "rev-parse", "--git-dir"], stdout=PIPE, stderr=PIPE) - so, se = cmd.communicate() - stash_file = "%s%s" % (so.decode("utf-8").rstrip(), "/logs/refs/stash") - - try: - with open(stash_file) as f: - return sum(1 for _ in f) - except IOError: - return 0 - - -# `git status --porcelain --branch` can collect all information -# branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind -# (check also in $XDG_CONFIG_HOME/ignore) -po = Popen( - ["git", "status", "--porcelain", "--branch"], - env={"LC_ALL": "C", "XDG_CONFIG_HOME": os.environ["XDG_CONFIG_HOME"]}, - stdout=PIPE, - stderr=PIPE, -) -stdout, stderr = po.communicate() -if po.returncode != 0: - sys.exit(0) # Not a git repository - -# collect git status information -untracked, staged, changed, conflicts = [], [], [], [] -num_ahead, num_behind = 0, 0 -ahead, behind = "", "" -branch = "" -remote = "" -status = [(line[0], line[1], line[2:]) for line in stdout.decode("utf-8").splitlines()] -for st in status: - if st[0] == "#" and st[1] == "#": - if re.search("Initial commit on", st[2]): - branch = st[2].split(" ")[-1] - elif re.search("No commits yet on", st[2]): - branch = st[2].split(" ")[-1] - elif re.search("no branch", st[2]): # detached status - branch = get_tag_or_hash() - elif len(st[2].strip().split("...")) == 1: - branch = st[2].strip() - else: - # current and remote branch info - branch, rest = st[2].strip().split("...") - if len(rest.split(" ")) == 1: - # remote_branch = rest.split(' ')[0] - pass - else: - # ahead or behind - divergence = " ".join(rest.split(" ")[1:]) - divergence = divergence.lstrip("[").rstrip("]") - for div in divergence.split(", "): - if "ahead" in div: - num_ahead = int(div[len("ahead ") :].strip()) - ahead = "%s%s" % (symbols["ahead of"], num_ahead) - elif "behind" in div: - num_behind = int(div[len("behind ") :].strip()) - behind = "%s%s" % (symbols["behind"], num_behind) - remote = "".join([behind, ahead]) - elif st[0] == "?" and st[1] == "?": - untracked.append(st) - else: - if st[1] == "M": - changed.append(st) - if st[0] == "U": - conflicts.append(st) - elif st[0] != " ": - staged.append(st) - -stashed = get_stash() -if not changed and not staged and not conflicts and not untracked and not stashed: - clean = 1 -else: - clean = 0 - -if remote == "": - remote = "." - -if python_version == 2: - remote = remote.decode("utf-8") - -out = "\n".join( - [ - branch, - remote, - to_str(len(staged)), - to_str(len(conflicts)), - to_str(len(changed)), - to_str(len(untracked)), - to_str(stashed), - to_str(clean), - to_str(python_version), - ] -) - - -if python_version == 2: - Print(out.encode("utf-8")) -else: - Print(out) diff --git a/fish/.config/fish/functions/fish_mode_prompt.fish b/fish/.config/fish/functions/fish_mode_prompt.fish deleted file mode 100644 index e525760..0000000 --- a/fish/.config/fish/functions/fish_mode_prompt.fish +++ /dev/null @@ -1,3 +0,0 @@ -# Change fish mode prompt for vi -function fish_mode_prompt -d "Mode prompt for vi" -end diff --git a/fish/.config/fish/functions/fish_mount.fish b/fish/.config/fish/functions/fish_mount.fish index 4259bc8..d74b61c 100644 --- a/fish/.config/fish/functions/fish_mount.fish +++ b/fish/.config/fish/functions/fish_mount.fish @@ -1,16 +1,16 @@ # Udisksctl mount devices function fish_mount -d "Udisksctl mount devs" - if [ -d "/dev/disk/by-label/" ] - set -l label (ls "/dev/disk/by-label/" | fzf +m) - if test -n "$label" - echo -n "Mounting $label ... " - udisksctl mount -b (realpath /dev/disk/by-label/$label) - end - else - set -l block (fd "(sd[a-i][1-9]|mmcblk0p[1-9])" /dev | fzf +m) - if test -n "$block" - echo -n "Mounting $block ... " - udisksctl mount -b "$block" - end - end + if [ -d /dev/disk/by-label/ ] + set -l label (fd . /dev/disk/by-label/ | fzf +m) + if test -n "$label" + echo -n "Mounting $label ... " + udisksctl mount -b (realpath $label) + end + else + set -l block (fd "(sd[a-i][1-9]|mmcblk0p[1-9])" /dev | fzf +m) + if test -n "$block" + echo -n "Mounting $block ... " + udisksctl mount -b "$block" + end + end end diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish deleted file mode 100644 index 1a8447e..0000000 --- a/fish/.config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1,189 +0,0 @@ -function fish_prompt - - # -------------------------------------------- - # Pythonic prompt, very clean and simple, - # selected with fish_config with custom colors - # and append git_prompt_status - # -------------------------------------------- - - # Line 1 - # - if not set -q VIRTUAL_ENV_DISABLE_PROMPT - set -g VIRTUAL_ENV_DISABLE_PROMPT true - end - - # std prompt - # - set_color yellow - printf '%s' (whoami) - set_color normal - printf ' at ' - - set_color magenta - printf '%s' (prompt_hostname) - set_color normal - printf ' in ' - - set_color $fish_color_cwd - printf '%s' (prompt_pwd) - set_color normal - - # git prompt - # - append_git_prompt - - # Line 2 - # - - # break line - # - echo - - # fish mode vi prompt - # - #fish_mode_vi_prompt - - # virtual env prompt - # - if test $VIRTUAL_ENV - printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal) - end - printf '$ ' - set_color normal -end - - -function fish_mode_vi_prompt -d "Outputs the mode indicator for use in vi-mode" - switch $fish_bind_mode - case default - set_color red - printf '[N] ' - case insert - set_color green - printf '[I] ' - case replace_one - set_color yellow - printf '[R] ' - case visual - set_color brmagenta - printf '[V] ' - case '*' - set_color red - printf '[?] ' - end - set_color normal -end - -function append_git_prompt -d "Append git prompt" - - # --------------------------------------------- - # https://github.com/magicmonty/bash-git-prompt - # --------------------------------------------- - - if not set -q __GIT_PROMPT_DIR - set __GIT_PROMPT_DIR ~/.config/fish/functions/.fish-git-prompt - end - - # Colors - # Reset - set ResetColor (set_color normal) # Text Reset - - # Regular Colors - set Red (set_color red) # Red - set Yellow (set_color yellow); # Yellow - set Blue (set_color blue) # Blue - set WHITE (set_color white) - - # Bold - set BGreen (set_color -o green) # Green - - # High Intensty - set IBlack (set_color -o black) # Black - - # Bold High Intensty - set BRed (set_color -o red) # Red - - # Default values for the appearance of the prompt. Configure at will. - set GIT_PROMPT_PREFIX "[" - set GIT_PROMPT_SUFFIX "]" - set GIT_PROMPT_SEPARATOR " |" - set GIT_PROMPT_BRANCH "$BRed" - set GIT_PROMPT_STAGED "$Yellow+" - set GIT_PROMPT_CONFLICTS "$Red✖" - set GIT_PROMPT_CHANGED "$Blue!" - set GIT_PROMPT_REMOTE " " - set GIT_PROMPT_UNTRACKED "?" - set GIT_PROMPT_STASHED "\$" - - set -e __CURRENT_GIT_STATUS - set gitstatus "$__GIT_PROMPT_DIR/gitstatus.py" - - set _GIT_STATUS (python3 $gitstatus) - set __CURRENT_GIT_STATUS $_GIT_STATUS - - set __CURRENT_GIT_STATUS_PARAM_COUNT (count $__CURRENT_GIT_STATUS) - - if not test "0" -eq $__CURRENT_GIT_STATUS_PARAM_COUNT - set GIT_BRANCH $__CURRENT_GIT_STATUS[1] - set GIT_REMOTE "$__CURRENT_GIT_STATUS[2]" - if contains "." "$GIT_REMOTE" - set -e GIT_REMOTE - end - set GIT_STAGED $__CURRENT_GIT_STATUS[3] - set GIT_CONFLICTS $__CURRENT_GIT_STATUS[4] - set GIT_CHANGED $__CURRENT_GIT_STATUS[5] - set GIT_UNTRACKED $__CURRENT_GIT_STATUS[6] - set GIT_STASHED $__CURRENT_GIT_STATUS[7] - set GIT_CLEAN $__CURRENT_GIT_STATUS[8] - end - - if test -n "$__CURRENT_GIT_STATUS" - - if [ "$GIT_CLEAN" = "1" ] - set GIT_PROMPT_BRANCH "$BGreen" - set GIT_PROMPT_SEPARATOR "" - end - - set STATUS " $GIT_PROMPT_PREFIX$GIT_PROMPT_BRANCH$GIT_BRANCH$ResetColor" - - if set -q GIT_REMOTE - set STATUS "$STATUS$GIT_PROMPT_REMOTE$GIT_REMOTE$ResetColor" - end - - set STATUS "$STATUS$GIT_PROMPT_SEPARATOR" - - if [ $GIT_STAGED != "0" ] - set STATUS "$STATUS $GIT_PROMPT_STAGED$GIT_STAGED$ResetColor" - end - - if [ $GIT_CONFLICTS != "0" ] - set STATUS "$STATUS $GIT_PROMPT_CONFLICTS$GIT_CONFLICTS$ResetColor" - end - - if [ $GIT_CHANGED != "0" ] - set STATUS "$STATUS $GIT_PROMPT_CHANGED$GIT_CHANGED$ResetColor" - end - - if [ "$GIT_UNTRACKED" != "0" ] - set STATUS "$STATUS $GIT_PROMPT_UNTRACKED$GIT_UNTRACKED$ResetColor" - end - - if [ "$GIT_STASHED" != "0" ] - set STATUS "$STATUS $GIT_PROMPT_STASHED$GIT_STASHED$ResetColor" - end - - #if [ "$GIT_CLEAN" = "1" ] - # set STATUS "$STATUS $GIT_PROMPT_CLEAN" - #end - - set STATUS " on$STATUS$ResetColor$GIT_PROMPT_SUFFIX" - - else - - set STATUS "" - - end - - printf $STATUS - -end diff --git a/fish/.config/fish/functions/fish_set_my_color_theme.fish b/fish/.config/fish/functions/fish_set_my_color_theme.fish deleted file mode 100644 index 76214c0..0000000 --- a/fish/.config/fish/functions/fish_set_my_color_theme.fish +++ /dev/null @@ -1,32 +0,0 @@ -# Set my color theme using universal variables -function fish_set_my_color_theme -d "Set my color theme" - set -U fish_color_autosuggestion 969896 - set -U fish_color_cancel \x2dr - set -U fish_color_command c397d8 - set -U fish_color_comment e7c547 - set -U fish_color_cwd green - set -U fish_color_cwd_root red - set -U fish_color_end c397d8 - set -U fish_color_error d54e53 - set -U fish_color_escape 00a6b2 - set -U fish_color_history_current \x2d\x2dbold - set -U fish_color_host normal - set -U fish_color_host_remote yellow - set -U fish_color_match \x2d\x2dbackground\x3dbrblue - set -U fish_color_normal normal - set -U fish_color_operator 00a6b2 - set -U fish_color_param 7aa6da - set -U fish_color_quote b9ca4a - set -U fish_color_redirection 70c0b1 - set -U fish_color_search_match bryellow\x1e\x2d\x2dbackground\x3dbrblack - set -U fish_color_selection white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack - set -U fish_color_status red - set -U fish_color_user brgreen - set -U fish_color_valid_path \x2d\x2dunderline - set -U fish_pager_color_completion normal - set -U fish_pager_color_description B3A06D\x1eyellow - set -U fish_pager_color_prefix white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline - set -U fish_pager_color_progress brwhite\x1e\x2d\x2dbackground\x3dcyan - # Ok all done, set it - set -U fish_my_color_theme set -end diff --git a/fish/.config/fish/functions/fish_umount.fish b/fish/.config/fish/functions/fish_umount.fish index 710c9de..5b4bd43 100644 --- a/fish/.config/fish/functions/fish_umount.fish +++ b/fish/.config/fish/functions/fish_umount.fish @@ -1,16 +1,16 @@ # Umount devices function fish_umount -d "Umount devs" - if [ -d "/dev/disk/by-label/" ] - set -l label (ls "/dev/disk/by-label/" | fzf +m) - if test -n "$label" - echo -n "Umounting $label ... " - udisksctl unmount -b (realpath /dev/disk/by-label/$label) - end - else - set -l block (fd "(sd[a-i][1-9]|mmcblk0p[1-9])" /dev | fzf +m) - if test -n "$block" - echo -n "Umounting $block ... " - udisksctl unmount -b "$block" - end - end + if [ -d /dev/disk/by-label/ ] + set -l label (fd . /dev/disk/by-label/ | fzf +m) + if test -n "$label" + echo -n "Umounting $label ... " + udisksctl unmount -b (realpath $label) + end + else + set -l block (fd "(sd[a-i][1-9]|mmcblk0p[1-9])" /dev | fzf +m) + if test -n "$block" + echo -n "Umounting $block ... " + udisksctl unmount -b "$block" + end + end end diff --git a/fish/.config/fish/functions/ls.fish b/fish/.config/fish/functions/ls.fish deleted file mode 100644 index c3f8480..0000000 --- a/fish/.config/fish/functions/ls.fish +++ /dev/null @@ -1,56 +0,0 @@ -function __fish_set_lscolors --description 'Set $LS_COLORS if possible, local dircolors only' - if ! set -qx LS_COLORS && set -l cmd (command -s {g,}dircolors)[1] - set -l colorfile - for file in ~/.dir_colors - if test -f $file - set colorfile $file - break - end - end - # Here we rely on the legacy behavior of `dircolors -c` producing output - # suitable for csh in order to extract just the data we're interested in. - set -gx LS_COLORS ($cmd -c $colorfile | string split ' ')[3] - # The value should always be quoted but be conservative and check first. - if string match -qr '^([\'"]).*\1$' -- $LS_COLORS - set LS_COLORS (string match -r '^.(.*).$' $LS_COLORS)[2] - end - end -end - -function ls --description "List contents of directory" - # Make ls use colors and show indicators if we are on a system that supports that feature and writing to stdout. - # - - # BSD, macOS and others support colors with ls -G. - # GNU ls and FreeBSD ls takes --color=auto. Order of this test is important because ls also takes -G but it has a different meaning. - # Solaris 11's ls command takes a --color flag. - # OpenBSD requires the separate colorls program for color support. - # Also test -F because we'll want to define this function even with an ls that can't do colors (like NetBSD). - if not set -q __fish_ls_color_opt - set -g __fish_ls_color_opt - set -g __fish_ls_command ls - # OpenBSD ships a command called "colorls" that takes "-G" and "-F", - # but there's also a ruby implementation that doesn't understand "-F". - # Since that one's quite different, don't use it. - if command -sq colorls - and command colorls -GF >/dev/null 2>/dev/null - set -g __fish_ls_color_opt -GF - set -g __fish_ls_command colorls - else - for opt in --color=auto -G --color -F - if command ls $opt / >/dev/null 2>/dev/null - set -g __fish_ls_color_opt $opt - break - end - end - end - end - - # Set the colors to the default via `dircolors` if none is given. - __fish_set_lscolors - - isatty stdout - and set -a opt -F - - command $__fish_ls_command $__fish_ls_color_opt $argv -end diff --git a/git/.config/git/config-dev b/git/.config/git/config-dev index eb8fb1c..bb1d20f 100644 --- a/git/.config/git/config-dev +++ b/git/.config/git/config-dev @@ -1,7 +1,7 @@ [core] pager = delta [user] - email = andrea.ros21@e.email + email = andrea.ros21@murena.io name = andros21 username = andros21 [interactive] diff --git a/ranger/.config/ranger/commands.py b/ranger/.config/ranger/commands.py index 206a69f..7836b6c 100644 --- a/ranger/.config/ranger/commands.py +++ b/ranger/.config/ranger/commands.py @@ -1,5 +1,4 @@ import os -import re import subprocess import sys @@ -43,34 +42,6 @@ def execute(self): self.fm.select_file(fzf_file) -class z(Command): - """:z - Uses .z file to set the current directory. - - See: https://github.com/ask1234560/ranger-zjumper - """ - - def execute(self): - - # location of .z file - z_loc = f"{os.getenv('HOME')}/.local/share/z/data" - with open(z_loc, "r") as fobj: - flists = fobj.readlines() - - # user given directory - req = re.compile(".*".join(self.args[1:]), re.IGNORECASE) - directories = [] - for i in flists: - if req.search(i): - directories.append(i.split("|")[0]) - - try: - # smallest(length) directory will be the directory required - self.fm.execute_console("cd " + min(directories, key=lambda x: len(x))) - except Exception as e: - raise print("Directory not found: ", e) - - class extract(Command): """:extract diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 5093997..53fcd38 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -5,6 +5,7 @@ map shell gio trash %s map TT cd ~/.local/share/Trash/files map gv cd /run/user/1000/gvfs map cz console z%space +map ci zi map fzf_select map ex extract map ec compress diff --git a/starship/.config/starship.toml b/starship/.config/starship.toml new file mode 100644 index 0000000..004322d --- /dev/null +++ b/starship/.config/starship.toml @@ -0,0 +1,16 @@ +# starship.toml +# ============= +# starship config +# see https://starship.rs/config + +[username] +show_always = true +style_user = 'bold purple' +format = '[$user]($style) on ' + +[hostname] +ssh_only = false +style = 'bold yellow' + +[cmd_duration] +style = 'bold green'