From 835acd40ab15f5c8f70cb3cb45cc45c1f2110681 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 12 Oct 2023 09:19:31 +0200 Subject: [PATCH 1/5] multimedia: Move access tokens to dotter templating Moved usernames and passwords into local variables in dotter to be able to commit the files nonetheless. Thus makes use of dotter templating for beets and mopidy. Empty example configuration can be found in local.toml in the dotter directory. --- .dotter/local.toml | 7 +++++++ multimedia/.config/beets/config.yaml | 2 ++ multimedia/.config/mopidy/mopidy.conf | 7 ++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.dotter/local.toml b/.dotter/local.toml index f649759..25a671e 100644 --- a/.dotter/local.toml +++ b/.dotter/local.toml @@ -4,3 +4,10 @@ packages = ["workstation"] [files] [variables] + +multimedia_beets_musicbrainz_user = "" +multimedia_beets_musicbrainz_pass = "" +multimedia_mopidy_subidy_url = "" +multimedia_mopidy_subidy_user = "" +multimedia_mopidy_subidy_pass = "" + diff --git a/multimedia/.config/beets/config.yaml b/multimedia/.config/beets/config.yaml index 03b417d..37324c9 100644 --- a/multimedia/.config/beets/config.yaml +++ b/multimedia/.config/beets/config.yaml @@ -48,6 +48,8 @@ item_fields: musicbrainz: extra_tags: [year, catalognum, country, media, label] + user: {{multimedia_beets_musicbrainz_user}} + pass: {{multimedia_beets_musicbrainz_pass}} auto: yes remove: yes diff --git a/multimedia/.config/mopidy/mopidy.conf b/multimedia/.config/mopidy/mopidy.conf index 29679c6..2f5173b 100644 --- a/multimedia/.config/mopidy/mopidy.conf +++ b/multimedia/.config/mopidy/mopidy.conf @@ -146,7 +146,7 @@ enabled = false #default_playlist_scheme = m3u [local] -#enabled = true +enabled = false #max_search_results = 100 media_dir = $XDG_MUSIC_DIR scan_timeout = 5000 @@ -182,6 +182,11 @@ scan_timeout = 5000 # *.jpeg # *.png +[subidy] +url={{multimedia_mopidy_subidy_url}} +username={{multimedia_mopidy_subidy_user}} +password={{multimedia_mopidy_subidy_pass}} + [mpris] #enabled = true #bus_type = session From e4b560cc7f5d9b117f66e0c6d8167198bb756e4f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 16 Oct 2023 11:26:31 +0200 Subject: [PATCH 2/5] flavours: Target new sioyek version Sioyek features an option to set the background color for normal operations (`background_color`) and for custom color mode (`custom_color_mode_empty_background_color`) separately since this commit: https://github.com/ahrm/sioyek/commit/0c2251b1bea4b22b0e3b5ad01170f7c7c6cd1309 Here, we change flavours to *only* target the custom color mode, leaving the normal background color as it is. This will not work yet for the current official sioyek 2.0 release which is still the release for archlinux as of 2023-10-16, but it will already work for its git release. Should work for everything as of the next official sioyek release. --- desktop/.config/flavours/templates/sioyek/default.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/.config/flavours/templates/sioyek/default.mustache b/desktop/.config/flavours/templates/sioyek/default.mustache index 40d0ef4..145f5c9 100644 --- a/desktop/.config/flavours/templates/sioyek/default.mustache +++ b/desktop/.config/flavours/templates/sioyek/default.mustache @@ -3,6 +3,7 @@ # {{scheme-name}} scheme by{{scheme-author}} custom_background_color #{{base00-hex}} +custom_color_mode_empty_background_color #{{base00-hex}} custom_text_color #{{base06-hex}} page_separator_color #{{base00-hex}} @@ -13,7 +14,6 @@ ui_text_color #{{base06-hex}} ui_selected_text_color #{{base06-hex}} ui_background_color #{{base01-hex}} ui_selected_background_color #{{base03-hex}} -background_color #{{base00-hex}} visual_mark_color {{base03-dec-r}} {{base03-dec-g}} {{base03-dec-b}} 0.2 text_highlight_color #{{base03-hex}} link_highlight_color #{{base0D-hex}} From 5e2239ac10dc817db34688865103936a6d4e0832 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 23 Oct 2023 10:29:20 +0200 Subject: [PATCH 3/5] repo: Remove leftover gitlab ci instructions --- .gitlab-ci.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4ecde1a..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# install moreutils to enable ifne (if not empty) -# will only run the respective analyzers when files to test -# are acutally found -image: fnichol/check-shell:latest - -analyze: - stage: test - before_script: - - apk add moreutils - - shellcheck --version - script: - - echo "--------- CHECKING POSIX SHELLSCRIPTS -------------" - - find . -type f -name '*.sh' | ifne xargs shellcheck -Calways - - echo "--------- CHECKING ZSH SHELLSCRIPTS -------------" - - find . -type f -name '*.zsh' | ifne xargs shellcheck -Calways -s bash -e SC2034 - -lint: - stage: test - before_script: - - apk add moreutils - - shfmt -version - script: - - echo "--------- CHECKING POSIX SHELLSCRIPTS -------------" - - find . -type f -name '*.sh' -not -path '*/pomo-app/*' | ifne xargs shfmt -d -i 4 - - echo "--------- CHECKING ZSH SHELLSCRIPTS -------------" - - find . -type f -name '*.zsh' -not -path '*/pomo-app/*' | ifne xargs shfmt -d -i 4 - -test: - stage: test - image: alpine - before_script: - - apk add git bash - - git clone https://github.com/bats-core/bats-core.git /bats - - /bats/bin/bats --version - script: - - /bats/bin/bats -r . From c3fe4cdc58e13bfe85f53daf959bca059a1e13a5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 15 Nov 2023 13:22:19 +0100 Subject: [PATCH 4/5] nvim: Add mapping to toggle buffer diagnostics If you want to hide buffer diagnostics for any reason, there is now a quick mapping reachable through the usual lsp submenu: `lo` (I suppose the mnemonic would be 'lsp off'). It toggles them enabled and disabled and only affects the current buffer. --- nvim/.config/nvim/lua/plugins/config/lsp.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/config/lsp.lua b/nvim/.config/nvim/lua/plugins/config/lsp.lua index b537c7f..cb75d7d 100644 --- a/nvim/.config/nvim/lua/plugins/config/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/config/lsp.lua @@ -109,6 +109,13 @@ local function on_attach(client, bufnr) "lua vim.lsp.buf.signature_help()", { buffer = bufnr, desc = "Signature help" } ) + map("n", "lo", function() + if vim.diagnostic.is_disabled(0) then + vim.diagnostic.enable(0) + else + vim.diagnostic.disable(0) + end + end, { buffer = bufnr, desc = "Disable buffer diagnostics" }) if vim.g.format_on_save then require("lsp-setup.utils").format_on_save(client) From b45296765a454e72ebec4f0637f65690d94285d4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 15 Nov 2023 13:28:35 +0100 Subject: [PATCH 5/5] nvim: Hide virtual-text diagnostics on insert When writing something we often want to ideally hide the long comments added to the end of any line in-progress as virtual text currently. This simply adds an auto-command to hide when entering and show again when exiting insert mode, simple but hopefully useful. --- nvim/.config/nvim/lua/plugins/config/lsp.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/config/lsp.lua b/nvim/.config/nvim/lua/plugins/config/lsp.lua index cb75d7d..0670395 100644 --- a/nvim/.config/nvim/lua/plugins/config/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/config/lsp.lua @@ -122,6 +122,11 @@ local function on_attach(client, bufnr) end end +-- Display diagnostics as virtual text only if not in insert mode +-- https://lr.artemislena.eu/r/neovim/comments/12inp4c/disable_diagnostics_virtual_text_when_in_insert/jqqifwk/ +vim.api.nvim_create_autocmd("InsertEnter", { callback = function() vim.diagnostic.config({ virtual_text = false, }) end }) +vim.api.nvim_create_autocmd("InsertLeave", { callback = function() vim.diagnostic.config({ virtual_text = true, }) end }) + lsp.setup({ default_mappings = false, servers = servers, @@ -203,3 +208,4 @@ require("mason-null-ls").setup({ end, }, }) +