From e501f2dac238009475bd5cb05238c86a32a4da10 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Sat, 30 Apr 2022 13:13:16 +0700 Subject: [PATCH] Some temporary changes - river: update new mapping option -layout and -hide-cursor river option - aerc: use abook command from aerc's wiki (https://man.sr.ht/~rjarry/aerc/integrations/index.md) - packages: add zdict - palette: add catppuccin (haven't tested) - nvim: adjust highlights for markdown-preview.nvim (to support all 3 palettes) - scripts/launch_xdg_portal: xdg-desktop-portal-kde is now in the same directory as the other on Alpine - env: add DOTNET_SKIP_FIRST_TIME_EXPERIENCE, XDG_STATE_HOME and adjust NPM_GLOBAL_PREFIX - cava: update config to version 0.8.2 --- README.md | 15 +++---- palette/catppuccin.yml | 40 +++++++++++++++++++ palette/nord.yml | 3 -- palette/onedark.yml | 6 +-- playbooks/packages.yml | 13 +++++- playbooks/tasks/zdict.yml | 17 ++++++++ requirements/collections.yml | 3 ++ roles/aerc/files/aerc.conf | 4 +- roles/cava/templates/config.j2 | 20 ++-------- roles/nvim/templates/markdown-highlight.j2 | 10 ++--- roles/river/templates/init.j2 | 27 ++++++++----- roles/scripts/files/bin/abook-aerc | 18 --------- .../files/libexec/wayland/launch_xdg_portal | 2 - roles/shells/templates/env.j2 | 8 ++-- tasks/check_variables.yml | 4 +- 15 files changed, 114 insertions(+), 76 deletions(-) create mode 100644 palette/catppuccin.yml create mode 100644 playbooks/tasks/zdict.yml create mode 100644 requirements/collections.yml delete mode 100755 roles/scripts/files/bin/abook-aerc diff --git a/README.md b/README.md index e308198..c867c09 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # dotfiles v2 -This is the continuation of [my old dotfiles](https://git.disroot.org/FollieHiyuki/dotfiles) without all the Xorg stuff I don't use. +This is the continuation of [my old dotfiles](/FollieHiyuki/dotfiles) without all the Xorg stuff I don't use. ## 🧰 Setup ```bash # Install `community.general` for 'apk' and 'doas' module if you only installed ansible-core -ansible-galaxy collection install community.general +ansible-galaxy collection install -r requirements/collections.yml # Run the playbook ansible-playbook -i hosts dotfiles.yml ``` @@ -28,20 +28,15 @@ ansible-playbook -v -i hosts dotfiles.yml --tags 'never,all' ## 🖊️ TODO - [ ] ~~[wayout](https://git.sr.ht/~proycon/wayout)~~ -- [x] [fuzzel](https://codeberg.org/dnkl/fuzzel) / [rofi-wayland](https://github.com/lbonn/rofi) - [ ] GTK/Icons/Cursor theme, Sarasa font bootstraping -- [x] Use Wireplumber lua API for 'volumncontrol' script instead of [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer) - [ ] Neovim: - [ ] vim.api.nvim{_buf}_set_keymap -> vim.keymap.set - - [ ] lua autocmd - - [ ] global statusline - - [ ] lua filetype autocmd - [ ] OneDark theme -- [x] Bootstrap Vagrant with 'bundler' module + - [ ] Catpuccin theme + - [ ] nvim_set_hl - [ ] Use [bubblewrap](https://github.com/containers/bubblewrap) / rootless [podman](https://podman.io/) for some applications -- [x] Replace [libsixel](https://github.com/libsixel/libsixel) with [chafa](https://github.com/hpjansson/chafa/) - [ ] Separated Waybar config files for Sway and River -- [x] Rewrite River's init file in lua +- [ ] [catppuccin](https://github.com/catppuccin/catppuccin) theme - [ ] [eww](https://github.com/elkowar/eww) - [ ] [swhkd](https://github.com/waycrate/swhkd) (maybe?) - [ ] [senpai](https://git.sr.ht/~taiite/senpai) diff --git a/palette/catppuccin.yml b/palette/catppuccin.yml new file mode 100644 index 0000000..a677099 --- /dev/null +++ b/palette/catppuccin.yml @@ -0,0 +1,40 @@ +--- +# Colors for theming +foreground: '#d9e0ee' +background: '#1e1d2f' +grey1: '#302d41' +grey2: '#575268' +grey3: '#6e6c7e' +grey_bright: '#988ba2' +white1: '#d9e0ee' +white2: '#d9e0ee' +teal: '#b5e8e0' +cyan: '#89dceb' +blue: '#96cdfb' +red: '#f28fad' +dark_red: '#e8a2af' +pink: '#f5c2e7' +orange: '#f8bd96' +yellow: '#fae3b0' +green: '#abe9b3' +purple: '#ddb6f2' +violet: '#c9cbff' +highlight: '#c3bac6' + +# Terminal 16 colors +color0: '#6e6c7e' +color1: '#f28fad' +color2: '#abe9b3' +color3: '#fae3b0' +color4: '#96cdfb' +color5: '#f5c2e7' +color6: '#89dceb' +color7: '#d9e0ee' +color8: '#988ba2' +color9: '#f28fad' +color10: '#abe9b3' +color11: '#fae3b0' +color12: '#96cdfb' +color13: '#f5c2e7' +color14: '#89dceb' +color15: '#d9e0ee' diff --git a/palette/nord.yml b/palette/nord.yml index 30bbb4e..218888b 100644 --- a/palette/nord.yml +++ b/palette/nord.yml @@ -36,6 +36,3 @@ color12: '#81a1c1' color13: '#b48ead' color14: '#8fbcbb' color15: '#eceff4' - -# Additional colors that look nice -violet: '#8c9cff' diff --git a/palette/onedark.yml b/palette/onedark.yml index afe4beb..8985419 100644 --- a/palette/onedark.yml +++ b/palette/onedark.yml @@ -20,6 +20,9 @@ green: '#98c379' purple: '#c678dd' highlight: '#9ca0a4' +# Not in OneDark palette but look nice +violet: '#8c9cff' # https://github.com/TheCactusBlue/dotfiles/blob/master/dotfiles/config/polybar/config.ini + # Terminal 16 colors color0: '#3e4452' color1: '#be5046' @@ -37,6 +40,3 @@ color12: '#61afef' color13: '#c678dd' color14: '#56b6c2' color15: '#bbc2cf' - -# Additional colors that look nice -violet: '#8c9cff' diff --git a/playbooks/packages.yml b/playbooks/packages.yml index 20e22dd..214e75a 100644 --- a/playbooks/packages.yml +++ b/playbooks/packages.yml @@ -30,6 +30,11 @@ command: cmd: go install github.com/irevenko/what-anime-cli@latest + - name: Install wiki + tags: wiki + command: + cmd: go install github.com/betapictoris/wiki@latest + - name: Install lux tags: lux command: @@ -101,7 +106,7 @@ - '@antora/cli' - '@antora/site-generator' environment: - NPM_CONFIG_PREFIX: ~/.local/share/npm-global + NPM_CONFIG_PREFIX: ~/.local/share/npm tags: [ yarn, npm ] - name: Install pyenv @@ -128,4 +133,10 @@ vars: - tt_dir: ~/Code/tt import_tasks: tasks/tt.yml + + - name: Install zdict + tags: zdict + vars: + zdict_venv_dir: ~/.config/zdict + import_tasks: tasks/zdict.yml tags: custom diff --git a/playbooks/tasks/zdict.yml b/playbooks/tasks/zdict.yml new file mode 100644 index 0000000..7f5503e --- /dev/null +++ b/playbooks/tasks/zdict.yml @@ -0,0 +1,17 @@ +--- +- name: Create venv directory + file: + path: '{{ zdict_venv_dir }}' + state: directory + mode: 0755 + +- name: Install zdict with pip + pip: + name: zdict + virtualenv: '{{ zdict_venv_dir }}' + +- name: Symlink zdict executable + file: + src: '{{ zdict_venv_dir }}/bin/zdict' + dest: ~/.local/bin/zdict + state: link diff --git a/requirements/collections.yml b/requirements/collections.yml new file mode 100644 index 0000000..afc836d --- /dev/null +++ b/requirements/collections.yml @@ -0,0 +1,3 @@ +--- +collections: + - name: community.general diff --git a/roles/aerc/files/aerc.conf b/roles/aerc/files/aerc.conf index 85a5bb4..b14a1b4 100644 --- a/roles/aerc/files/aerc.conf +++ b/roles/aerc/files/aerc.conf @@ -202,7 +202,7 @@ header-layout=To|From,Subject # the first field. Only the email address field is required. The second field, # if present, will be treated as the contact name. Additional fields are # ignored. -address-book-cmd=abook-aerc %s +address-book-cmd=sh -c 'abook --mutt-query "%s" | tail -n +2' # # Allow to address yourself when replying @@ -224,7 +224,7 @@ reply-to-self=true #subject,~^\[PATCH=colordiff text/plain=sed 's/^>\+.*/\x1b[36m&\x1b[0m/' text/html=pandoc -f html -t plain -image/*=chafa --animate off - +image/*=chafa --animate off --format symbols - [triggers] # diff --git a/roles/cava/templates/config.j2 b/roles/cava/templates/config.j2 index 067ae9c..65da3ef 100644 --- a/roles/cava/templates/config.j2 +++ b/roles/cava/templates/config.j2 @@ -3,17 +3,12 @@ [general] -# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 -; mode = normal - # Accepts only non-negative values. ; framerate = 60 # 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off # new as of 0.6.0 autosens of low values (dynamic range) -# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 ; autosens = 1 -; overshoot = 20 # Manual sensitivity in %. If autosens is enabled, this will only be the initial value. # 200 means double height. Accepts only non-negative values. @@ -162,21 +157,14 @@ gradient_color_8 = '{{ dark_red }}' [smoothing] -# Percentage value for integral smoothing. Takes values from 0 - 100. -# Higher values means smoother, but less precise. 0 to disable. -; integral = 77 - # Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. ; monstercat = 0 ; waves = 0 -# Set gravity percentage for "drop off". Higher values means bars will drop faster. -# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". -; gravity = 100 - - -# In bar height, bars that would have been lower that this will not be drawn. -; ignore = 0 +# Noise reduction, float 0 - 1. default 0.77 +# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth +# 1 will be very slow and smooth, 0 will be fast but noisy. +; noise_reduction = 0.77 [eq] diff --git a/roles/nvim/templates/markdown-highlight.j2 b/roles/nvim/templates/markdown-highlight.j2 index d03cf7a..4fa70db 100644 --- a/roles/nvim/templates/markdown-highlight.j2 +++ b/roles/nvim/templates/markdown-highlight.j2 @@ -16,7 +16,7 @@ --color-markdown-code-bg: {{ grey1 }}; --foreground-color: {{ foreground }}; - --background-color: {{ background }};; + --background-color: {{ background }}; --border-color: {{ grey_bright }}; } @@ -51,13 +51,13 @@ .hljs-string, .hljs-doctag { - color: {{ purple }}; + color: {{ red }}; } .hljs-title, .hljs-section, .hljs-selector-id { - color: {{ orange }}; + color: {{ red }}; font-weight: bold; } @@ -74,7 +74,7 @@ .hljs-tag, .hljs-name, .hljs-attribute { - color: {{ dark_blue }}; + color: {{ orange }}; font-weight: normal; } @@ -85,7 +85,7 @@ .hljs-symbol, .hljs-bullet { - color: {{ red }}; + color: {{ purple }}; } .hljs-built_in, diff --git a/roles/river/templates/init.j2 b/roles/river/templates/init.j2 index 0e2575a..17cce2c 100644 --- a/roles/river/templates/init.j2 +++ b/roles/river/templates/init.j2 @@ -77,6 +77,7 @@ local river_options = { -- Other options ['set-repeat'] = { 50, 300 }, ['focus-follows-cursor'] = 'normal', + ['hide-cursor'] = { 'when-typing', 'enabled' }, ['set-cursor-warp'] = 'on-output-change', ['attach-mode'] = 'bottom', ['default-layout'] = 'rivertile', @@ -128,7 +129,7 @@ local modes = { -- mod: string|list (modifiers, concanated by '+') -- key: string -- command: string|list (the command passed to riverctl) --- opt: string ('release' or 'repeat') +-- opts: tables ('release', 'repeat' or 'layout') local mappings = { -- Key bindings map = { @@ -457,13 +458,13 @@ local mappings = { mod = 'None', key = 'XF86AudioRaiseVolume', command = { 'spawn', string.format([['%s/volumecontrol --increase']], wl_script_dir) }, - opt = 'repeat', + opts = { repeat = true }, }, { mod = 'None', key = 'XF86AudioLowerVolume', command = { 'spawn', string.format([['%s/volumecontrol --decrease']], wl_script_dir) }, - opt = 'repeat', + opts = { repeat = true }, }, { mod = 'None', @@ -501,13 +502,13 @@ local mappings = { mod = 'None', key = 'XF86MonBrightnessUp', command = { 'spawn', string.format([['%s/brightness up']], wl_script_dir) }, - opt = 'repeat', + opts = { repeat = true }, }, { mod = 'None', key = 'XF86MonBrightnessDown', command = { 'spawn', string.format([['%s/brightness down']], wl_script_dir) }, - opt = 'repeat', + opts = { repeat = true }, }, }, }, @@ -623,12 +624,16 @@ for map_type, tbl in pairs(mappings) do local cmd = concat(binding.command, ' ') local key = binding.key - -- Options -release and -repeat for 'map' and 'unmap' commands - local opt = binding.opt - if opt ~= 'release' and opt ~= 'repeat' then - opt = '' - else - opt = '-' .. opt + -- Options -release, -repeat or -layout for 'map' and 'unmap' commands + -- -release and -repeat should not be used together + local opt = '' + if binding.opts.release then + opt = '-release' + elseif binding.opts.repeat then + opt = '-repeat' + end + if type(binding.opts.layout) == 'number' then + opt = opt .. ' -layout ' .. binding.opts.layout end os.execute(string.format('riverctl %s %s %s %s %s %s', map_type, opt, mode, modifiers, key, cmd)) diff --git a/roles/scripts/files/bin/abook-aerc b/roles/scripts/files/bin/abook-aerc deleted file mode 100755 index 2d86ca4..0000000 --- a/roles/scripts/files/bin/abook-aerc +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -: "${ADDRESS_BOOK=$HOME/.abook/addressbook}" - -# $* concanates arguments with the 1st character of $IFS -# -# NOTE: in aerc's compose tab -# Tab is used to move to the next header field / completion item -# Enter does nothing other than selecting the completion item -# -# hence forcing $IFS to be a Space here -oldIFS="$IFS" -IFS=" " - -abook --convert --infile "${ADDRESS_BOOK}" --outformat muttq | tail -n +2 | fzf --filter="$*" - -# Reset $IFS back to the default -IFS="$oldIFS" diff --git a/roles/scripts/files/libexec/wayland/launch_xdg_portal b/roles/scripts/files/libexec/wayland/launch_xdg_portal index 451cbb8..acc651e 100755 --- a/roles/scripts/files/libexec/wayland/launch_xdg_portal +++ b/roles/scripts/files/libexec/wayland/launch_xdg_portal @@ -6,9 +6,7 @@ if [ $# -lt 1 ]; then exit fi -# xdg-desktop-portal-kde is located in /usr/lib/libexec portal_binary="/usr/libexec/xdg-desktop-portal-${1}" -[ ! -f "${portal_binary}" ] && portal_binary="/usr/lib/libexec/xdg-desktop-portal-${1}" [ ! -f "${portal_binary}" ] && echo "${portal_binary} file is invalid." && exit 1 if [ -n "$(pgrep -x "${portal_binary}")" ]; then diff --git a/roles/shells/templates/env.j2 b/roles/shells/templates/env.j2 index cd57150..b7e6a93 100644 --- a/roles/shells/templates/env.j2 +++ b/roles/shells/templates/env.j2 @@ -10,6 +10,7 @@ set -gx XDG_BIN_HOME $HOME/.local/bin set -gx XDG_CONFIG_HOME $HOME/.config set -gx XDG_CACHE_HOME $HOME/.cache set -gx XDG_DATA_HOME $HOME/.local/share +set -gx XDG_STATE_HOME $HOME/.local/state # Respect defined XDG specs set -gx XCURSOR_PATH $HOME/.local/share/icons @@ -22,7 +23,7 @@ set -gx GRADLE_USER_HOME $XDG_DATA_HOME/gradle set -gx _JAVA_OPTIONS -Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java set -gx NODE_REPL_HISTORY $XDG_CACHE_HOME/node_repl_history set -gx NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/npmrc -set -gx NPM_CONFIG_PREFIX $XDG_DATA_HOME/npm-global +set -gx NPM_CONFIG_PREFIX $XDG_DATA_HOME/npm set -gx CARGO_HOME $XDG_DATA_HOME/cargo set -gx RUSTUP_HOME $XDG_DATA_HOME/rustup set -gx BUNDLE_USER_CONFIG $XDG_CONFIG_HOME/bundle @@ -58,14 +59,15 @@ set -gx OPENSSL_NO_VENDOR 1 set -gx GOPROXY direct # Microsoft is cancer -set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1 +set -gx DOTNET_CLI_TELEMETRY_OPTOUT true +set -gx DOTNET_SKIP_FIRST_TIME_EXPERIENCE true # we build Vagrant ourselves set -gx VAGRANT_I_KNOW_WHAT_IM_DOING_PLEASE_BE_QUIET true # puppeteer (for mermaid-cli) set -gx PUPPETEER_EXECUTABLE_PATH '/usr/bin/chromium-browser' -set -gx PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 'true' +set -gx PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # qt5ct set -gx QT_QPA_PLATFORMTHEME qt5ct diff --git a/tasks/check_variables.yml b/tasks/check_variables.yml index 0434ea1..098f873 100644 --- a/tasks/check_variables.yml +++ b/tasks/check_variables.yml @@ -1,8 +1,8 @@ --- - name: Check theme name fail: - msg: Variable 'theme' needs to be 'nord' or 'onedark' - when: not theme in [ 'nord', 'onedark' ] + msg: Variable 'theme' needs to be 'nord', 'onedark' or 'catppuccin' + when: not theme in [ 'nord', 'onedark', 'catppuccin' ] - name: Check clipboard manager name fail: