From f170d8f29f75a7c9e3e57991cfb16dd6ac5d2bc8 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 20 Apr 2023 00:00:00 +0700 Subject: [PATCH] gallery-dl: add nitter config + tweak download path for mastodon Also: - vifm: use cyan instead of purple for window bar (more comfy) - fish: add ghq_cd function - mopidy: add some config I might be interested in --- TODO.md | 3 ++- roles/config/files/fish/ghq_cd.fish | 10 ++++++++++ roles/config/files/vifm/colors/custom.vifm | 4 ++-- roles/config/tasks/fish.yml | 12 +++++++----- roles/config/templates/gallery-dl/config.j2 | 9 ++++++++- roles/config/templates/git/config.j2 | 2 ++ roles/config/templates/mopidy/mopidy.j2 | 6 ++++++ roles/packages/defaults/main.yml | 6 +++++- roles/packages/tasks/rust-packages.yml | 6 ++++++ 9 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 roles/config/files/fish/ghq_cd.fish diff --git a/TODO.md b/TODO.md index 94ad8a2..019f1ef 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,8 @@ Plans for the future of this dotfiles. - [ ] Wayland compositors: [japokwm](https://github.com/werererer/japokwm), [dwl](https://github.com/djpohly/dwl), [labwc](https://github.com/labwc/labwc), [vivarium](https://github.com/inclement/vivarium), [qtile](https://github.com/qtile/qtile) (also revaluate [hikari](https://hub.darcs.net/raichoo/hikari) and [wayfire](https://wayfire.org)) - [x] ~~[tremc](https://github.com/tremc/tremc) / [rtorrent](https://github.com/rakshasa/rtorrent/)~~ ==> I use [qbt](https://github.com/ludviglundgren/qbittorrent-cli) with qbittorrent-nox daemon now - [ ] Other terminals (contour, wezterm) -- [ ] CopyQ +- [ ] CopyQ (config, themes + superd service + clipboard menu script) +- [ ] mangal ## Cosmetic diff --git a/roles/config/files/fish/ghq_cd.fish b/roles/config/files/fish/ghq_cd.fish new file mode 100644 index 0000000..2364000 --- /dev/null +++ b/roles/config/files/fish/ghq_cd.fish @@ -0,0 +1,10 @@ +function ghq_cd + set -l proj (ghq list --full-path | fzf \ + --no-multi \ + --prompt "Project: " \ + --preview 'lsd -1FAL --group-dirs first --icon always --color always {}' \ + ) + if test -n "$proj" + cd -- "$proj" + end +end diff --git a/roles/config/files/vifm/colors/custom.vifm b/roles/config/files/vifm/colors/custom.vifm index a644d73..5b2b356 100644 --- a/roles/config/files/vifm/colors/custom.vifm +++ b/roles/config/files/vifm/colors/custom.vifm @@ -13,8 +13,8 @@ highlight /^.*\.(~|$$$|bak|tmp)$/ cterm=none ctermfg=008 ctermbg=default " General highlight highlight Border cterm=none ctermfg=002 ctermbg=default -highlight TopLine cterm=none ctermfg=005 ctermbg=default -highlight TopLineSel cterm=bold ctermfg=005 ctermbg=000 +highlight TopLine cterm=none ctermfg=006 ctermbg=default +highlight TopLineSel cterm=bold,inverse ctermfg=006 ctermbg=default highlight TabLine cterm=none ctermfg=004 ctermbg=default highlight TabLineSel cterm=bold,inverse ctermfg=004 ctermbg=default diff --git a/roles/config/tasks/fish.yml b/roles/config/tasks/fish.yml index 6203a58..696373b 100644 --- a/roles/config/tasks/fish.yml +++ b/roles/config/tasks/fish.yml @@ -3,7 +3,7 @@ file: path: '~/.config/fish/{{ item }}' state: directory - mode: 0755 + mode: '755' loop: - completions - conf.d @@ -14,19 +14,21 @@ copy: src: 'fish/{{ item.src }}' dest: '~/.config/fish/{{ item.dest }}' - mode: 0644 + mode: '644' loop: - src: fish_greeting.fish dest: functions/ - src: fish_user_key_bindings.fish dest: functions/ + - src: ghq_cd.fish + dest: functions/ - name: fish | Copy config templates template: src: 'fish/{{ item.src }}.j2' dest: '~/.config/fish/{{ item.dest }}.fish' force: true - mode: 0644 + mode: '644' loop: - src: aliases dest: conf.d/aliases @@ -40,7 +42,7 @@ src: 'fish/{{ item }}' dest: '~/.config/fish/themes/{{ item }}' force: true - mode: 0644 + mode: '644' loop: - Onedark.theme - Nord.theme @@ -58,7 +60,7 @@ get_url: url: https://github.com/junegunn/fzf/raw/master/shell/key-bindings.fish dest: ~/.config/fish/functions/fzf_key_bindings.fish - mode: 0644 + mode: '644' - name: fish | Install fisher shell: /usr/bin/curl -sSL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher diff --git a/roles/config/templates/gallery-dl/config.j2 b/roles/config/templates/gallery-dl/config.j2 index b5155fd..48ad30b 100644 --- a/roles/config/templates/gallery-dl/config.j2 +++ b/roles/config/templates/gallery-dl/config.j2 @@ -20,7 +20,7 @@ "mastodon": { "filename": "{id}_{media[id]}.{extension}", - "directory": ["mastodon", "{instance}", "{account[username]!l}"], + "directory": ["mastodon", "{account[acct]!l}"], "reblogs": true, "replies": true, "text-posts": false, @@ -28,6 +28,13 @@ "root": "https://fosstodon.org" } }, + "nitter": { + "filename": "{tweet_id}_{num}.{extension}", + "directory": ["twitter", "{user[name]}"], + "nitter.absturztau.be": { + "root": "https://nitter.absturztau.be" + } + }, "pixiv": { "filename": "{id}_p{num}.{extension}", "directory": ["Pixiv", "{user[name]}-{user[id]}"], diff --git a/roles/config/templates/git/config.j2 b/roles/config/templates/git/config.j2 index 4f23b19..47fa365 100644 --- a/roles/config/templates/git/config.j2 +++ b/roles/config/templates/git/config.j2 @@ -74,3 +74,5 @@ [privacy] ignoreTimezone = true pattern = hms +[ghq] + root = ~/Code diff --git a/roles/config/templates/mopidy/mopidy.j2 b/roles/config/templates/mopidy/mopidy.j2 index b436da7..a61817e 100644 --- a/roles/config/templates/mopidy/mopidy.j2 +++ b/roles/config/templates/mopidy/mopidy.j2 @@ -55,6 +55,7 @@ album_art_files = enabled = true hostname = 127.0.0.1 port = 6680 +csrf_protection = true [m3u] enabled = true @@ -65,6 +66,9 @@ default_extension = .m3u8 [softwaremixer] enabled = true +[stream] +enabled = false + [mpd] enabled = true hostname = unix:{{ ansible_env.XDG_RUNTIME_DIR }}/mpd.sock @@ -77,4 +81,6 @@ command_blacklist = [youtube] enabled = true +musicapi_enabled = false +allow_cache = false youtube_dl_package = yt_dlp diff --git a/roles/packages/defaults/main.yml b/roles/packages/defaults/main.yml index 5cb0d46..bac7ba5 100644 --- a/roles/packages/defaults/main.yml +++ b/roles/packages/defaults/main.yml @@ -127,18 +127,21 @@ system_apk_packages: - fzf - gallery-dl - gdb + - ghq - ginkgo - git-branchless + - git-cliff - git-email - git-extras - git-lfs + - git-scalar + - git-sizer - github-cli - gitoxide - glab - gnupg-doc - go - go-jsonnet - - go-s - go-task - gobang - gocryptfs @@ -236,6 +239,7 @@ system_apk_packages: - peep - perf - pgcli + - pijul - pinentry-qt - pipe-viewer - pipewire diff --git a/roles/packages/tasks/rust-packages.yml b/roles/packages/tasks/rust-packages.yml index b044619..0483d35 100644 --- a/roles/packages/tasks/rust-packages.yml +++ b/roles/packages/tasks/rust-packages.yml @@ -107,3 +107,9 @@ community.general.cargo: name: alass-cli state: latest + +- name: packages | Install faerber + tags: faerber + command: + cmd: /usr/bin/cargo install --locked --force --git https://github.com/nekowinston/faerber.git fearber + removes: /usr/bin/cargo