diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-28 13:10:42 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-28 13:10:42 +0200 |
| commit | c9944e92bc1e2bff9071300b25b11642d218f424 (patch) | |
| tree | 6d6f4d6ffb17381b3cabb5e52ee2b9f594c14513 | |
| parent | pkgs/mpp-searchadd: Make resistent to `beets` auto-migrations on startup (diff) | |
| download | nixos-config-c9944e92bc1e2bff9071300b25b11642d218f424.zip | |
treewide: Format
Diffstat (limited to '')
36 files changed, 330 insertions, 337 deletions
diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix index 78ad570f..43943363 100644 --- a/modules/by-name/im/impermanence/module.nix +++ b/modules/by-name/im/impermanence/module.nix @@ -59,22 +59,24 @@ in { inherit (cfg) directories; users.soispha = { - directories = [ - # TODO: These should all be moved to their respective modules <2024-12-08> - ".local/share" + directories = + [ + # TODO: These should all be moved to their respective modules <2024-12-08> + ".local/share" - ".local/state/nvim" - ".local/state/mpv" - ".local/state/wireplumber" + ".local/state/nvim" + ".local/state/mpv" + ".local/state/wireplumber" - ".config/Signal" + ".config/Signal" - ".cache" + ".cache" - "media" - "repos" - "documents" - ] ++ cfg.userDirectories; + "media" + "repos" + "documents" + ] + ++ cfg.userDirectories; }; files = [ diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh index 0c2f391a..e0b6216c 100755 --- a/modules/by-name/lf/lf/commands/base.sh +++ b/modules/by-name/lf/lf/commands/base.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # nixos-config - My current NixOS configuration # @@ -41,7 +41,7 @@ prompt() { # set -- "$@" "$file" # done < "$(echo "$fx" | tmp)" tmp() { - __base_tmp_temporary_file="$(mktemp -t --tmpdir="$__base_tmp_temporary_directory" lf_commands_tmp_fun_XXXXXXXX )" + __base_tmp_temporary_file="$(mktemp -t --tmpdir="$__base_tmp_temporary_directory" lf_commands_tmp_fun_XXXXXXXX)" cat >"$__base_tmp_temporary_file" echo "$__base_tmp_temporary_file" } @@ -60,6 +60,9 @@ trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT lf_cmd() { arguments="" for arg in "$@"; do + # We _can_ use the fancy bash syntax, but it's really hard to correctly quote the + # single quote in bash, and I don't really feel like it's worth it. + # shellcheck disable=SC2001 arg="$(echo "$arg" | sed "s/'/\\\'/g")" if [ -z "$arguments" ]; then diff --git a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua index 50a6cb23..4dc9ce97 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua +++ b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua @@ -8,7 +8,6 @@ -- You should have received a copy of the License along with this program. -- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. - local clip_val = require("femaco.utils").clip_val require("femaco").setup({ @@ -19,7 +18,7 @@ require("femaco").setup({ prepare_buffer = function(opts) local buf = vim.api.nvim_create_buf(false, false) return vim.api.nvim_open_win(buf, true, opts) - end; + end, -- should return options passed to nvim_open_win -- @param code_block: data about the code-block with the keys @@ -28,42 +27,34 @@ require("femaco").setup({ -- * lang float_opts = function(code_block) return { - relative = "cursor"; - width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10); -- TODO how to offset sign column etc? - height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6); - anchor = "NW"; - row = 0; - col = 0; - style = "minimal"; - border = "rounded"; - zindex = 1; + relative = "cursor", + width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10), -- TODO how to offset sign column etc? + height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6), + anchor = "NW", + row = 0, + col = 0, + style = "minimal", + border = "rounded", + zindex = 1, } - end; + end, -- return filetype to use for a given lang -- lang can be nil - ft_from_lang = function(lang) - return lang - end; + ft_from_lang = function(lang) return lang end, -- what to do after opening the float - post_open_float = function(winnr) - vim.wo.signcolumn = "no" - end; + post_open_float = function(winnr) vim.wo.signcolumn = "no" end, -- create the path to a temporary file - create_tmp_filepath = function(filetype) - return os.tmpname() - end; + create_tmp_filepath = function(filetype) return os.tmpname() end, -- if a newline should always be used, useful for multiline injections -- which separators needs to be on separate lines such as markdown, neorg etc -- @param base_filetype: The filetype which FeMaco is called from, not the -- filetype of the injected language (this is the current buffer so you can -- get it from vim.bo.filetyp). - ensure_newline = function(base_filetype) - return base_filetype == "nix" - end; + ensure_newline = function(base_filetype) return base_filetype == "nix" end, -- Return true if the indentation should be normalized. Useful when the -- injected language inherits indentation from the construction scope (e.g. an @@ -73,7 +64,5 @@ require("femaco").setup({ -- @param base_filetype: The filetype which FeMaco is called from, not the -- filetype of the injected language (this is the current buffer, so you can -- get it from vim.bo.filetype). - normalize_indent = function(base_filetype) - return base_filetype == "nix" - end; + normalize_indent = function(base_filetype) return base_filetype == "nix" end, }) diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua index 371f5539..8c30063e 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua @@ -20,21 +20,20 @@ local get_comment_string = function(comment_type) local utils = require("Comment.utils") -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) - local cstring = - calculate_comment_string({ ctype = comment_type; range = utils.get_region(); }) + local cstring = calculate_comment_string({ ctype = comment_type, range = utils.get_region() }) if cstring == nil then -- TODO: Use `vim.bo.commentstring` <2025-05-02> -- Use some useful default values. - return { ["begin"] = "#"; ["end"] = ""; } + return { ["begin"] = "#", ["end"] = "" } end -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side local left, right = utils.unwrap_cstr(cstring) -- create a `{left, right}` table for it - return { ["begin"] = left; ["end"] = right; } + return { ["begin"] = left, ["end"] = right } end --- Wraps a table of snippet nodes in two comment function nodes. @@ -45,18 +44,13 @@ end local wrap_snippet_in_comments = function(comment_type, nodes) local output = {} - table.insert(output, ls.function_node(function() - return get_comment_string(comment_type)["begin"] - end)) - + table.insert(output, ls.function_node(function() return get_comment_string(comment_type)["begin"] end)) for _, v in ipairs(nodes) do table.insert(output, v) end - table.insert(output, ls.function_node(function() - return get_comment_string(comment_type)["end"] - end)) + table.insert(output, ls.function_node(function() return get_comment_string(comment_type)["end"] end)) return output end @@ -91,42 +85,36 @@ local function pair(pair_begin, pair_end, file_types, condition_function) -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> -- file_types = file_types or {}; - return ls.snippet( - { - trig = pair_begin; - wordTrig = false; - snippetType = "autosnippet"; - }, - { - ls.text_node({ pair_begin; }); - ls.dynamic_node(1, get_visual); - ls.text_node({ pair_end; }); - }, - { - condition = function() - local filetype_check = true - - if file_types ~= nil then - filetype_check = file_types[vim.bo.filetype] or false - end - - return (not condition_function(pair_begin, pair_end)) and filetype_check - end; - } - ) + return ls.snippet({ + trig = pair_begin, + wordTrig = false, + snippetType = "autosnippet", + }, { + ls.text_node({ pair_begin }), + ls.dynamic_node(1, get_visual), + ls.text_node({ pair_end }), + }, { + condition = function() + local filetype_check = true + + if file_types ~= nil then filetype_check = file_types[vim.bo.filetype] or false end + + return (not condition_function(pair_begin, pair_end)) and filetype_check + end, + }) end local auto_pairs = { - pair("(", ")", nil, char_count_same); - pair("{", "}", nil, char_count_same); - pair("[", "]", nil, char_count_same); - pair("<", ">", { ["rust"] = true; ["tex"] = true; }, char_count_same); - pair("'", "'", nil, even_count); - pair("\"", "\"", nil, even_count); - pair("`", "`", nil, even_count); + pair("(", ")", nil, char_count_same), + pair("{", "}", nil, char_count_same), + pair("[", "]", nil, char_count_same), + pair("<", ">", { ["rust"] = true, ["tex"] = true }, char_count_same), + pair("'", "'", nil, even_count), + pair("\"", "\"", nil, even_count), + pair("`", "`", nil, even_count), } -ls.add_snippets("all", auto_pairs, { type = "snippets"; key = "auto_pairs"; }) +ls.add_snippets("all", auto_pairs, { type = "snippets", key = "auto_pairs" }) -- }}} -- todo_comments {{{ @@ -134,9 +122,7 @@ local read_git_config = function(config_value) local command = string.format("git config \"%s\"", config_value) local handle = io.popen(command) - if handle == nil then - return error(string.format("Failed to call `%s`.", command)) - end + if handle == nil then return error(string.format("Failed to call `%s`.", command)) end local result = handle:read("*a") handle:close() @@ -199,14 +185,17 @@ local todo_snippet = function(trig, name, comment_type, mark_function) local date_node, signature_node = mark_function() - local nodes = fmt("{} {}{}: {} {} {}", wrap_snippet_in_comments(comment_type, { - ls.text_node(name); - signature_node; - ls.insert_node(1, "content"); - date_node; - })) + local nodes = fmt( + "{} {}{}: {} {} {}", + wrap_snippet_in_comments(comment_type, { + ls.text_node(name), + signature_node, + ls.insert_node(1, "content"), + date_node, + }) + ) - return ls.snippet(context, nodes, { ctype = comment_type; }) + return ls.snippet(context, nodes, { ctype = comment_type }) end ---@param trigger string: The luasnip trigger @@ -214,26 +203,18 @@ end ---@param name string: All aliases for a name ---@return table: All possible snippets build from the marks local process_marks = function(trigger, name, comment_type) - local username = function() - return handle_from_name(read_git_config("user.name")) - end + local username = function() return handle_from_name(read_git_config("user.name")) end local marks = { - signature = function() - return ls.text_node("(" .. username() .. ")"), ls.text_node("") - end; + signature = function() return ls.text_node("(" .. username() .. ")"), ls.text_node("") end, date_signature = function() return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("(" .. username() .. ")") - end; + end, - date = function() - return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("") - end; + date = function() return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("") end, - empty = function() - return ls.text_node(""), ls.text_node("") - end; + empty = function() return ls.text_node(""), ls.text_node("") end, } local output = {} @@ -247,20 +228,20 @@ local process_marks = function(trigger, name, comment_type) end local todo_snippet_specs = { - { { trig = "todo"; }; { "TODO"; }; { ctype = 1; }; }; - { { trig = "fix"; }; { "FIXME"; "ISSUE"; }; { ctype = 1; }; }; - { { trig = "hack"; }; { "HACK"; }; { ctype = 1; }; }; - { { trig = "warn"; }; { "WARNING"; }; { ctype = 1; }; }; - { { trig = "perf"; }; { "PERFORMANCE"; "OPTIMIZE"; }; { ctype = 1; }; }; - { { trig = "note"; }; { "NOTE"; "INFO"; }; { ctype = 1; }; }; + { { trig = "todo" }, { "TODO" }, { ctype = 1 } }, + { { trig = "fix" }, { "FIXME", "ISSUE" }, { ctype = 1 } }, + { { trig = "hack" }, { "HACK" }, { ctype = 1 } }, + { { trig = "warn" }, { "WARNING" }, { ctype = 1 } }, + { { trig = "perf" }, { "PERFORMANCE", "OPTIMIZE" }, { ctype = 1 } }, + { { trig = "note" }, { "NOTE", "INFO" }, { ctype = 1 } }, -- NOTE: Block commented todo-comments - { { trig = "todob"; }; { "TODO"; }; { ctype = 2; }; }; - { { trig = "fixb"; }; { "FIXME"; "ISSUE"; }; { ctype = 2; }; }; - { { trig = "hackb"; }; { "HACK"; }; { ctype = 2; }; }; - { { trig = "warnb"; }; { "WARNING"; }; { ctype = 2; }; }; - { { trig = "perfb"; }; { "PERF"; "PERFORMANCE"; "OPTIM"; "OPTIMIZE"; }; { ctype = 2; }; }; - { { trig = "noteb"; }; { "NOTE"; "INFO"; }; { ctype = 2; }; }; + { { trig = "todob" }, { "TODO" }, { ctype = 2 } }, + { { trig = "fixb" }, { "FIXME", "ISSUE" }, { ctype = 2 } }, + { { trig = "hackb" }, { "HACK" }, { ctype = 2 } }, + { { trig = "warnb" }, { "WARNING" }, { ctype = 2 } }, + { { trig = "perfb" }, { "PERF", "PERFORMANCE", "OPTIM", "OPTIMIZE" }, { ctype = 2 } }, + { { trig = "noteb" }, { "NOTE", "INFO" }, { ctype = 2 } }, } local todo_comment_snippets = {} @@ -271,7 +252,7 @@ for _, v in ipairs(todo_snippet_specs) do end end -ls.add_snippets("all", todo_comment_snippets, { type = "snippets"; key = "todo_comments"; }) +ls.add_snippets("all", todo_comment_snippets, { type = "snippets", key = "todo_comments" }) -- }}} -- spdx snippets {{{ @@ -283,27 +264,30 @@ local generate_spdx_snippet = function(comment_type, spdx_license_expr, trigger) context.name = trigger .. " spdx snippet expr" context.trig = trigger - local nodes = { - fmt("{} SPDX-SnippetBegin {}", wrap_snippet_in_comments(comment_type, {})); + fmt("{} SPDX-SnippetBegin {}", wrap_snippet_in_comments(comment_type, {})), - fmt("{} SPDX-SnippetCopyrightText: {} {} <{}> {}", - wrap_snippet_in_comments(comment_type, { - ls.insert_node(1, "year"); - ls.insert_node(2, "author"); - ls.insert_node(3, "email"); - }) - ); + fmt( + "{} SPDX-SnippetCopyrightText: {} {} <{}> {}", + wrap_snippet_in_comments(comment_type, { + ls.insert_node(1, "year"), + ls.insert_node(2, "author"), + ls.insert_node(3, "email"), + }) + ), - fmt("{} SPDX-License-Identifier: {} {}", wrap_snippet_in_comments(comment_type, { - ls.text_node(spdx_license_expr); - })); + fmt( + "{} SPDX-License-Identifier: {} {}", + wrap_snippet_in_comments(comment_type, { + ls.text_node(spdx_license_expr), + }) + ), - { ls.insert_node(4, "content"); }; + { ls.insert_node(4, "content") }, - fmt("{} SPDX-SnippetEnd {}", wrap_snippet_in_comments(comment_type, {})); + fmt("{} SPDX-SnippetEnd {}", wrap_snippet_in_comments(comment_type, {})), - { ls.insert_node(0); }; + { ls.insert_node(0) }, } local newline_nodes = {} @@ -313,16 +297,16 @@ local generate_spdx_snippet = function(comment_type, spdx_license_expr, trigger) end -- luasnip requires newlines to be encoded like this: - table.insert(newline_nodes, ls.text_node({ ""; ""; })) + table.insert(newline_nodes, ls.text_node({ "", "" })) end - return ls.snippet(context, newline_nodes, { ctype = comment_type; }) + return ls.snippet(context, newline_nodes, { ctype = comment_type }) end local spdx = { - { trigger = "spdx-AGPL3+"; license = "AGPL-3.0-or-later"; }; - { trigger = "spdx-GPL3+"; license = "GPL-3.0-or-later"; }; - { trigger = "spdx-MIT"; license = "MIT"; }; + { trigger = "spdx-AGPL3+", license = "AGPL-3.0-or-later" }, + { trigger = "spdx-GPL3+", license = "GPL-3.0-or-later" }, + { trigger = "spdx-MIT", license = "MIT" }, } local spdx_snippets = {} @@ -334,5 +318,5 @@ for _, value in ipairs(spdx) do table.insert(spdx_snippets, snippet) end -ls.add_snippets("all", spdx_snippets, { type = "snippets"; key = "spdx_snippets"; }) +ls.add_snippets("all", spdx_snippets, { type = "snippets", key = "spdx_snippets" }) -- }}} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua index bcd128f7..02d285b7 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua @@ -19,23 +19,23 @@ local get_visual = function(_, parent) end end -local translation_table = { ["("] = ")"; ["{"] = "}"; ["["] = "]"; } +local translation_table = { ["("] = ")", ["{"] = "}", ["["] = "]" } -- Return snippet tables return { -- LEFT/RIGHT ALL BRACES ls.snippet( { - trig = "([^%a])l([%(%[%{])"; - regTrig = true; - wordTrig = false; - snippetType = "autosnippet"; + trig = "([^%a])l([%(%[%{])", + regTrig = true, + wordTrig = false, + snippetType = "autosnippet", }, fmt("{}\\left{}{}\\right{}", { - ls.function_node(function(_, snip) return snip.captures[1] end); - ls.function_node(function(_, snip) return snip.captures[2] end); - ls.dynamic_node(1, get_visual); - ls.function_node(function(_, snip) return translation_table[snip.captures[2]] end); + ls.function_node(function(_, snip) return snip.captures[1] end), + ls.function_node(function(_, snip) return snip.captures[2] end), + ls.dynamic_node(1, get_visual), + ls.function_node(function(_, snip) return translation_table[snip.captures[2]] end), }) - ); + ), } diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua index 21aa7414..a98f6e8c 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua @@ -12,38 +12,38 @@ local ls = require("luasnip") -- Return snippet tables return { - ls.snippet({ trig = ";a"; snippetType = "autosnippet"; }, { ls.text_node("\\alpha"); }); - ls.snippet({ trig = ";b"; snippetType = "autosnippet"; }, { ls.text_node("\\beta"); }); - ls.snippet({ trig = ";g"; snippetType = "autosnippet"; }, { ls.text_node("\\gamma"); }); - ls.snippet({ trig = ";G"; snippetType = "autosnippet"; }, { ls.text_node("\\Gamma"); }); - ls.snippet({ trig = ";d"; snippetType = "autosnippet"; }, { ls.text_node("\\delta"); }); - ls.snippet({ trig = ";D"; snippetType = "autosnippet"; }, { ls.text_node("\\Delta"); }); - ls.snippet({ trig = ";e"; snippetType = "autosnippet"; }, { ls.text_node("\\epsilon"); }); - ls.snippet({ trig = ";ve"; snippetType = "autosnippet"; }, { ls.text_node("\\varepsilon"); }); - ls.snippet({ trig = ";z"; snippetType = "autosnippet"; }, { ls.text_node("\\zeta"); }); - ls.snippet({ trig = ";h"; snippetType = "autosnippet"; }, { ls.text_node("\\eta"); }); - ls.snippet({ trig = ";o"; snippetType = "autosnippet"; }, { ls.text_node("\\theta"); }); - ls.snippet({ trig = ";vo"; snippetType = "autosnippet"; }, { ls.text_node("\\vartheta"); }); - ls.snippet({ trig = ";O"; snippetType = "autosnippet"; }, { ls.text_node("\\Theta"); }); - ls.snippet({ trig = ";k"; snippetType = "autosnippet"; }, { ls.text_node("\\kappa"); }); - ls.snippet({ trig = ";l"; snippetType = "autosnippet"; }, { ls.text_node("\\lambda"); }); - ls.snippet({ trig = ";L"; snippetType = "autosnippet"; }, { ls.text_node("\\Lambda"); }); - ls.snippet({ trig = ";m"; snippetType = "autosnippet"; }, { ls.text_node("\\mu"); }); - ls.snippet({ trig = ";n"; snippetType = "autosnippet"; }, { ls.text_node("\\nu"); }); - ls.snippet({ trig = ";x"; snippetType = "autosnippet"; }, { ls.text_node("\\xi"); }); - ls.snippet({ trig = ";X"; snippetType = "autosnippet"; }, { ls.text_node("\\Xi"); }); - ls.snippet({ trig = ";i"; snippetType = "autosnippet"; }, { ls.text_node("\\pi"); }); - ls.snippet({ trig = ";I"; snippetType = "autosnippet"; }, { ls.text_node("\\Pi"); }); - ls.snippet({ trig = ";r"; snippetType = "autosnippet"; }, { ls.text_node("\\rho"); }); - ls.snippet({ trig = ";s"; snippetType = "autosnippet"; }, { ls.text_node("\\sigma"); }); - ls.snippet({ trig = ";S"; snippetType = "autosnippet"; }, { ls.text_node("\\Sigma"); }); - ls.snippet({ trig = ";t"; snippetType = "autosnippet"; }, { ls.text_node("\\tau"); }); - ls.snippet({ trig = ";f"; snippetType = "autosnippet"; }, { ls.text_node("\\phi"); }); - ls.snippet({ trig = ";vf"; snippetType = "autosnippet"; }, { ls.text_node("\\varphi"); }); - ls.snippet({ trig = ";F"; snippetType = "autosnippet"; }, { ls.text_node("\\Phi"); }); - ls.snippet({ trig = ";c"; snippetType = "autosnippet"; }, { ls.text_node("\\chi"); }); - ls.snippet({ trig = ";p"; snippetType = "autosnippet"; }, { ls.text_node("\\psi"); }); - ls.snippet({ trig = ";P"; snippetType = "autosnippet"; }, { ls.text_node("\\Psi"); }); - ls.snippet({ trig = ";w"; snippetType = "autosnippet"; }, { ls.text_node("\\omega"); }); - ls.snippet({ trig = ";W"; snippetType = "autosnippet"; }, { ls.text_node("\\Omega"); }); + ls.snippet({ trig = ";a", snippetType = "autosnippet" }, { ls.text_node("\\alpha") }), + ls.snippet({ trig = ";b", snippetType = "autosnippet" }, { ls.text_node("\\beta") }), + ls.snippet({ trig = ";g", snippetType = "autosnippet" }, { ls.text_node("\\gamma") }), + ls.snippet({ trig = ";G", snippetType = "autosnippet" }, { ls.text_node("\\Gamma") }), + ls.snippet({ trig = ";d", snippetType = "autosnippet" }, { ls.text_node("\\delta") }), + ls.snippet({ trig = ";D", snippetType = "autosnippet" }, { ls.text_node("\\Delta") }), + ls.snippet({ trig = ";e", snippetType = "autosnippet" }, { ls.text_node("\\epsilon") }), + ls.snippet({ trig = ";ve", snippetType = "autosnippet" }, { ls.text_node("\\varepsilon") }), + ls.snippet({ trig = ";z", snippetType = "autosnippet" }, { ls.text_node("\\zeta") }), + ls.snippet({ trig = ";h", snippetType = "autosnippet" }, { ls.text_node("\\eta") }), + ls.snippet({ trig = ";o", snippetType = "autosnippet" }, { ls.text_node("\\theta") }), + ls.snippet({ trig = ";vo", snippetType = "autosnippet" }, { ls.text_node("\\vartheta") }), + ls.snippet({ trig = ";O", snippetType = "autosnippet" }, { ls.text_node("\\Theta") }), + ls.snippet({ trig = ";k", snippetType = "autosnippet" }, { ls.text_node("\\kappa") }), + ls.snippet({ trig = ";l", snippetType = "autosnippet" }, { ls.text_node("\\lambda") }), + ls.snippet({ trig = ";L", snippetType = "autosnippet" }, { ls.text_node("\\Lambda") }), + ls.snippet({ trig = ";m", snippetType = "autosnippet" }, { ls.text_node("\\mu") }), + ls.snippet({ trig = ";n", snippetType = "autosnippet" }, { ls.text_node("\\nu") }), + ls.snippet({ trig = ";x", snippetType = "autosnippet" }, { ls.text_node("\\xi") }), + ls.snippet({ trig = ";X", snippetType = "autosnippet" }, { ls.text_node("\\Xi") }), + ls.snippet({ trig = ";i", snippetType = "autosnippet" }, { ls.text_node("\\pi") }), + ls.snippet({ trig = ";I", snippetType = "autosnippet" }, { ls.text_node("\\Pi") }), + ls.snippet({ trig = ";r", snippetType = "autosnippet" }, { ls.text_node("\\rho") }), + ls.snippet({ trig = ";s", snippetType = "autosnippet" }, { ls.text_node("\\sigma") }), + ls.snippet({ trig = ";S", snippetType = "autosnippet" }, { ls.text_node("\\Sigma") }), + ls.snippet({ trig = ";t", snippetType = "autosnippet" }, { ls.text_node("\\tau") }), + ls.snippet({ trig = ";f", snippetType = "autosnippet" }, { ls.text_node("\\phi") }), + ls.snippet({ trig = ";vf", snippetType = "autosnippet" }, { ls.text_node("\\varphi") }), + ls.snippet({ trig = ";F", snippetType = "autosnippet" }, { ls.text_node("\\Phi") }), + ls.snippet({ trig = ";c", snippetType = "autosnippet" }, { ls.text_node("\\chi") }), + ls.snippet({ trig = ";p", snippetType = "autosnippet" }, { ls.text_node("\\psi") }), + ls.snippet({ trig = ";P", snippetType = "autosnippet" }, { ls.text_node("\\Psi") }), + ls.snippet({ trig = ";w", snippetType = "autosnippet" }, { ls.text_node("\\omega") }), + ls.snippet({ trig = ";W", snippetType = "autosnippet" }, { ls.text_node("\\Omega") }), } diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix index 5ed87f0e..b69f5a58 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/default.nix +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -55,7 +55,7 @@ in { __empty = null; }; "core.dirman".config = { - workspaces = { }; + workspaces = {}; }; "core.export".config = { __empty = null; diff --git a/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix b/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix deleted file mode 100644 index e69de29b..00000000 --- a/modules/home.legacy/conf/beets/plugins/mbsubmit/default.nix +++ /dev/null diff --git a/pkgs/by-name/fu/fupdate/flake.nix b/pkgs/by-name/fu/fupdate/flake.nix index 63d696e1..cac507c8 100644 --- a/pkgs/by-name/fu/fupdate/flake.nix +++ b/pkgs/by-name/fu/fupdate/flake.nix @@ -10,7 +10,7 @@ { description = "This is a Nix flake update manager."; - inputs = { }; + inputs = {}; outputs = {...}: let system = "x86_64-linux"; diff --git a/pkgs/by-name/fu/fupdate/src/cli.rs b/pkgs/by-name/fu/fupdate/src/cli.rs index 6ebd1bc4..a7168413 100644 --- a/pkgs/by-name/fu/fupdate/src/cli.rs +++ b/pkgs/by-name/fu/fupdate/src/cli.rs @@ -11,7 +11,7 @@ use std::{env, ffi::OsStr, fs::read_dir}; use clap::Parser; -use clap_complete::{engine::ArgValueCompleter, CompletionCandidate}; +use clap_complete::{CompletionCandidate, engine::ArgValueCompleter}; /// This is a Nix flake update manager. #[derive(Parser, Debug)] diff --git a/pkgs/by-name/fu/fupdate/src/main.rs b/pkgs/by-name/fu/fupdate/src/main.rs index b4af6cd6..2200ce83 100644 --- a/pkgs/by-name/fu/fupdate/src/main.rs +++ b/pkgs/by-name/fu/fupdate/src/main.rs @@ -10,7 +10,7 @@ use std::process::Command; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use clap::{CommandFactory, Parser}; pub mod cli; diff --git a/pkgs/by-name/lf/lf-make-map/flake.nix b/pkgs/by-name/lf/lf-make-map/flake.nix index 9cd88c70..5e191e7b 100644 --- a/pkgs/by-name/lf/lf-make-map/flake.nix +++ b/pkgs/by-name/lf/lf-make-map/flake.nix @@ -10,7 +10,7 @@ { description = "An automatic lf cd mapping generator"; - inputs = { }; + inputs = {}; outputs = {...}: let system = "x86_64-linux"; diff --git a/pkgs/by-name/mp/mpdpopm/Cargo.toml b/pkgs/by-name/mp/mpdpopm/Cargo.toml index 51931865..9c085d09 100644 --- a/pkgs/by-name/mp/mpdpopm/Cargo.toml +++ b/pkgs/by-name/mp/mpdpopm/Cargo.toml @@ -27,7 +27,7 @@ lalrpop = { version = "0.22", features = ["lexer"] } async-trait = "0.1" boolinator = "2.4" chrono = "0.4" -clap = {version = "4.6", features = ["derive"]} +clap = { version = "4.6", features = ["derive"] } errno = "0.3" futures = "0.3" lalrpop-util = { version = "0.22", features = ["lexer"] } @@ -38,9 +38,18 @@ regex = "1.12" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.149" toml = "0.9" -tokio = { version = "1.52", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal", "sync", "time"] } +tokio = { version = "1.52", features = [ + "io-util", + "macros", + "net", + "process", + "rt-multi-thread", + "signal", + "sync", + "time", +] } tracing = "0.1.44" -tracing-subscriber = { version = "0.3.23", features = ["env-filter"]} +tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } anyhow = "1.0.102" shlex = "1.3.0" rand = "0.9.4" diff --git a/pkgs/by-name/mp/mpdpopm/README.md b/pkgs/by-name/mp/mpdpopm/README.md index 3c2d961b..b4d0db7d 100644 --- a/pkgs/by-name/mp/mpdpopm/README.md +++ b/pkgs/by-name/mp/mpdpopm/README.md @@ -1,26 +1,23 @@ - # Table of Contents -1. [Introduction](#orgb2618c9) -2. [What Can You Do With It?](#orgf1adf2c) -3. [Licsense](#org3f75b89) -4. [Prerequisites](#org67de102) -5. [Installing](#installing) - 1. [Use the pre-built binaries](#orgb2e3434) - 2. [Crates.io](#org971a8b3) - 3. [Use the Debian package](#org55e51f8) - 4. [Use the Arch package](#org49ada47) - 5. [Autotools source distributions](#org9c94559) - 6. [Building from source](#org64bc5dd) -6. [Getting Started](#getting_started) - 1. [Program Structure](#org4a22fae) - 2. [Getting Set-up](#orgfbd2d7d) - 1. [MPD](#orgb37b483) - 2. [mppopmd](#org38f4b69) - 3. [mppopm](#orgfa9dacf) -7. [Status & Roadmap](#orgd90c7da) - - +1. [Introduction](#orgb2618c9) +1. [What Can You Do With It?](#orgf1adf2c) +1. [Licsense](#org3f75b89) +1. [Prerequisites](#org67de102) +1. [Installing](#installing) + 1. [Use the pre-built binaries](#orgb2e3434) + 1. [Crates.io](#org971a8b3) + 1. [Use the Debian package](#org55e51f8) + 1. [Use the Arch package](#org49ada47) + 1. [Autotools source distributions](#org9c94559) + 1. [Building from source](#org64bc5dd) +1. [Getting Started](#getting_started) + 1. [Program Structure](#org4a22fae) + 1. [Getting Set-up](#orgfbd2d7d) + 1. [MPD](#orgb37b483) + 1. [mppopmd](#org38f4b69) + 1. [mppopm](#orgfa9dacf) +1. [Status & Roadmap](#orgd90c7da) <a id="orgb2618c9"></a> @@ -30,7 +27,6 @@ This README focuses on obtaining & installing [mpdpopm](https://github.com/sp1ff/mpdpopm); the user manual is distributed with the package in [Texinfo](https://www.gnu.org/software/texinfo/) format. The HTML version of the user manual is hosted on my personal [site](https://www.unwoundstack.com/doc/mpdpopm/curr). - <a id="orgf1adf2c"></a> # What Can You Do With It? @@ -39,179 +35,181 @@ Once you've [installed](#installing) & [started](#getting_started) [mpdpopm](htt If you'd like to make use of this information in your song selection, you can ask `mppopmd` to queue-up songs on this basis by saying things like: - mppopm findadd "(rating > 128)" +``` +mppopm findadd "(rating > 128)" +``` to add all songs with a rating greater than 128 to the play queue, or - mppopm findadd "(lastplayed <= \"2022-12-28\")" +``` +mppopm findadd "(lastplayed <= \"2022-12-28\")" +``` to add all songs that haven't been played in the last year. - <a id="org3f75b89"></a> # Licsense [mpdpopm](https://github.com/sp1ff/mpdpopm) is GPL v3 software. - <a id="org67de102"></a> # Prerequisites [Music Player Daemon](https://www.musicpd.org/): "Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol." If you're reading this, I assume you're already running MPD, so this document won't have much to say on installing & configuring it other than that you **do** need to setup the sticker database by setting `sticker_file` in your configuration. -If you choose to use the pre-built binaries or the Debian or Arch packages (available under [releases](https://github.com/sp1ff/mpdpopm/releases)), that's all you'll need– you can jump ahead to the section entitled [Installing](#getting_started), below. +If you choose to use the pre-built binaries or the Debian or Arch packages (available under [releases](https://github.com/sp1ff/mpdpopm/releases)), that's all you'll need– you can jump ahead to the section entitled [Installing](#getting_started), below. If you would prefer to download [mpdpopm](https://github.com/sp1ff/mpdpopm) from [crates.io](https://crates.io/crates/mpdpopm), you'll need need the [Rust](https://www.rust-lang.org/tools/install) toolchain ("Rust is a memory- & thread-safe language with no runtime or garbage collector"). Installing the toolchain is easy: - curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh +``` +curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh +``` [mpdpopm](https://github.com/sp1ff/mpdpopm) is also available as an Autotools source distribution (also under [releases](https://github.com/sp1ff/mpdpopm/releases)), and of course you can just clone the repo & build the project from source. In either of those two cases you'll need the Gnu [Autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) installed in addition to Rust. In the former case, grab the tarball in the format of your choice & perform the usual "./configure && make && make install" incantation. In the latter, you'll need to invoke "./bootstrap" after you clone the repo. Again, if you're considering that route, I assume you're familiar with the Autotools & won't say much about them here. - <a id="installing"></a> # Installing As mentioned above, you can install [mpdpopm](https://github.com/sp1ff/mpdpopm) in a few different ways. In increasing order of complexity: - <a id="orgb2e3434"></a> ## Use the pre-built binaries -Thanks to a suggestion by [m040601](https://github.com/m040601), you can download pre-built binaries for each [release](https://github.com/sp1ff/mpdpopm/releases). At the time of this writing, only Linux & MacOS are supported, and only on x86<sub>64</sub> at that. If that works for you, you can do something like: - - cd /tmp - curl -L --output mpdpopm-0.3.5.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm-0.3.5-x86_64-unknown-linux.tar.gz - tar xf mpdpopm-0.3.5.tar.gz - tree mpdpopm-0.3.5-x86_64-unknown-linux/ - mpdpopm-0.3.5-x86_64-unknown-linux/ - ├── bin - │ ├── mppopm - │ └── mppopmd - └── doc - ├── AUTHORS - ├── ChangeLog - ├── COPYING - ├── NEWS - ├── README.org - ├── THANKS - ├── mppopmd.conf - ├── mppopmd.info - └── mppopmd.service - - 2 directories, 10 files +Thanks to a suggestion by [m040601](https://github.com/m040601), you can download pre-built binaries for each [release](https://github.com/sp1ff/mpdpopm/releases). At the time of this writing, only Linux & MacOS are supported, and only on x86<sub>64</sub> at that. If that works for you, you can do something like: + +``` +cd /tmp +curl -L --output mpdpopm-0.3.5.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm-0.3.5-x86_64-unknown-linux.tar.gz +tar xf mpdpopm-0.3.5.tar.gz +tree mpdpopm-0.3.5-x86_64-unknown-linux/ +mpdpopm-0.3.5-x86_64-unknown-linux/ +├── bin +│ ├── mppopm +│ └── mppopmd +└── doc + ├── AUTHORS + ├── ChangeLog + ├── COPYING + ├── NEWS + ├── README.org + ├── THANKS + ├── mppopmd.conf + ├── mppopmd.info + └── mppopmd.service + +2 directories, 10 files +``` Copy the binaries `mppopmd` (the daemon) and `mppopm` (the CLI) to a convenient place (e.g. `/usr/local/bin` or `$HOME/.local/bin`) and proceed to [Getting Started](#getting_started), below. - <a id="org971a8b3"></a> ## Crates.io If you've got the Rust toolchain installed, just say `cargo install mpdpopm`. The binaries will now be in `$HOME/.cargo/bin`, and you can proceed to [Getting Started](#getting_started), below. - <a id="org55e51f8"></a> ## Use the Debian package If you're running on a Debian-based Linux distribution, and you're on an x86<sub>64</sub> processor, I've begun providing a Debian binary package, courtesy of the very cool [cargo-deb](https://github.com/mmstick/cargo-deb) Cargo helper command. Just do: - cd /tmp - curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm_0.3.5_amd64.deb - sudo dpkg -i mpdpopm_0.3.5_amd64.deb +``` +cd /tmp +curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm_0.3.5_amd64.deb +sudo dpkg -i mpdpopm_0.3.5_amd64.deb +``` The binaries will be placed in `/usr/local/bin`, and you can proceed to [Getting Started](#getting_started), below. - <a id="org49ada47"></a> ## Use the Arch package If you're running on an Arch-based Linux distribution, I maintain a few packages in the [AUR](https://aur.archlinux.org/): -- [mpdpopm](https://aur.archlinux.org/packages/mpdpopm): which will grab the latest release & build it locally -- [mpdpopm-git](https://aur.archlinux.org/packages/mpdpopm-git): grab `HEAD` from `master` & build it locally -- [mpdpopm-bin](https://aur.archlinux.org/packages/mpdpopm-bin): grab the pre-built binaries from the latest release & install 'em +- [mpdpopm](https://aur.archlinux.org/packages/mpdpopm): which will grab the latest release & build it locally +- [mpdpopm-git](https://aur.archlinux.org/packages/mpdpopm-git): grab `HEAD` from `master` & build it locally +- [mpdpopm-bin](https://aur.archlinux.org/packages/mpdpopm-bin): grab the pre-built binaries from the latest release & install 'em You can clone the git repo for whichever package you'd like to use (remotes at link), do `makepkg` & then use pacman to install the package you just built, or use an AUR package manager (I use `yay`, e.g.) - <a id="org9c94559"></a> ## Autotools source distributions If you've got the Rust toolchain as well as Autotools installed, you can build from source via Autotools: - cd /tmp - curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm-0.3.5.tar.xz - tar xf mpdpopm-0.3.5.tar.xz - cd mpdpopm-0.3.5 - ./configure - make - make check - sudo make install +``` +cd /tmp +curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.5/mpdpopm-0.3.5.tar.xz +tar xf mpdpopm-0.3.5.tar.xz +cd mpdpopm-0.3.5 +./configure +make +make check +sudo make install +``` All the usual `configure` options apply (`--prefix`, e.g.) In particular, you can say `--enable-debug` to produce debug builds. - <a id="org64bc5dd"></a> ## Building from source Finally, and again if you have the build toolchain (Rust & Autotools) installed, you can build from source: - git clone git@github.com:sp1ff/mpdpopm.git - cd mpdpopm - ./bootstrap - ./configure - make - make check - sudo make install +``` +git clone git@github.com:sp1ff/mpdpopm.git +cd mpdpopm +./bootstrap +./configure +make +make check +sudo make install +``` Notice the call to `./bootstrap`, in this case. - <a id="getting_started"></a> # Getting Started This README provides a "quick-start" guide to getting mpdpopm up & running. For detailed user docs, refer to the [manual](https://www.unwoundstack.com/doc/mpdpopm/curr). - <a id="org4a22fae"></a> ## Program Structure [mpdpopm](https://github.com/sp1ff/mpdpopm) provides two programs: -1. `mppopmd` is the companion daemon process -2. `mppopm` is the associated command-line interface to the daemon +1. `mppopmd` is the companion daemon process +1. `mppopm` is the associated command-line interface to the daemon `mppopmd` will monitor `mpd` for song playback & note when songs complete; this is how it knows to increment the playcount & update the last played timestamp for each song to which you listen. `mppopmd` records this information (i.e. play counts, last played and ratings) using `mpd` [stickers](https://www.musicpd.org/doc/html/protocol.html#stickers). A sticker is a little bit of textual information which clients can attach to songs in the form of a name-value pair. [mpdpopm](https://github.com/sp1ff/mpdpopm) defines a new sticker name for each of these items & udpates the values for each song when & as requested. -Of course, other `mpd` clients will not, in general, be aware of `mppopmd` or the stickers it sets: you the user will have to bridge that gap. You could of course just fire-up `netcat` & start sending commands over the MPD protocol using `sendmessage`, but that's not particularly convenient– that's where `mppopm` comes in. `mppopm` is the client interface; one can through it instruct `mppopmd` to set ratings, get & set the various stickers mpdpopm knows about, and even search for songs in terms of mpdpopm attributes & add them to the play queue. - +Of course, other `mpd` clients will not, in general, be aware of `mppopmd` or the stickers it sets: you the user will have to bridge that gap. You could of course just fire-up `netcat` & start sending commands over the MPD protocol using `sendmessage`, but that's not particularly convenient– that's where `mppopm` comes in. `mppopm` is the client interface; one can through it instruct `mppopmd` to set ratings, get & set the various stickers mpdpopm knows about, and even search for songs in terms of mpdpopm attributes & add them to the play queue. <a id="orgfbd2d7d"></a> ## Getting Set-up - <a id="orgb37b483"></a> ### MPD If you're reading this, I assume you already have MPD up & running, so this section will be brief. One note, prompted by user [m040601](https://github.com/m040601), however: as mentioned above, [mpdpopm](https://github.com/sp1ff/mpdpopm) leverages the MPD sticker database. I was chagrined to find that if you do not configure MPD to maintain a sticker database, all sticker commands will simply be disabled. Therefore, before setting up [mpdpopm](https://github.com/sp1ff/mpdpopm), find your `mpd` configuration file and check to be sure you have a `sticker_file` entry; something like this: - sticker_file "/home/sp1ff/lib/mpd/sticker.sql" +``` +sticker_file "/home/sp1ff/lib/mpd/sticker.sql" +``` Check also that the you have write access to the named file & its parent directory. - <a id="org38f4b69"></a> ### mppopmd @@ -224,37 +222,38 @@ Once you've got the daemon running to your satisfaction, if you're on a systemd- [tanshoku](https://github.com/tanshoku) was kind enough to contribute a systemd unit for this purpose. At present, the build does not install it, but provides it as an example and leaves it to the user to install should they desire (and after they have edited it to suit their configuration). You can find it in `${prefix}/share/mpdpopm/examples` for the Autotools distribution, `/usr/local/share/mpdpopm/examples` for the Debian package, and in the `doc` folder for the pre-built binaries. - <a id="orgfa9dacf"></a> ### mppopm At this point, [mpdpopm](https://github.com/sp1ff/mpdpopm) will happily monitor your playback history & keep play counts & last played timestamps for you. If you would like to rate tracks, however, you will need to somehow induce your favorite mpd client to send a "rating" message to the [mpdpopm](https://github.com/sp1ff/mpdpopm) commands channel ("unwoundstack.com:commands" by default). Since this is unlikely to be convenient, I wrote an mpd client for the purpose: a little CLI called `mppopm`. You can simply execute - mppopm set-rating '*****' +``` +mppopm set-rating '*****' +``` -to set the current track's rating to five "stars" (say `mppopm --help` for an explanation of the rating system; in brief– it's Winamp's). NB. the set rating command by default produces no output; if you want confirmation that something's happening, use the `-v` flag. +to set the current track's rating to five "stars" (say `mppopm --help` for an explanation of the rating system; in brief– it's Winamp's). NB. the set rating command by default produces no output; if you want confirmation that something's happening, use the `-v` flag. The CLI offers "get" & "set" commands for play counts, last played timestamps & the rating. It also provides commands for searching your songs on the basis of play count, rating & last played times in addition to the usual artist, title &c. Say `mppopm --help` for a full list of options, including how to tell it where the mpd server can be found on your network. - <a id="orgd90c7da"></a> # Status & Roadmap I am currently using [mpdpopm](https://github.com/sp1ff/mpdpopm) day in & day out with my music collection, but it's early days; I have chosen the version number (0.n) in the hopes of indicating that. Right now, mpdpopm is the bare-bones of an app: it's plumbing, not the sink. -Heretofore, you could use the `mppopm` CLI to, say, rate the current song, but in order to actually <span class="underline">do</span> anything with that rating in the future, you'd have had to write some kind of mpd client for yourself. With the 0.2 release, I've added support for extended MPD filter syntax that allows queries that include the stickers that [mpdpopm](https://github.com/sp1ff/mpdpopm) manages– so you can now, for instance, say: +Heretofore, you could use the `mppopm` CLI to, say, rate the current song, but in order to actually <span class="underline">do</span> anything with that rating in the future, you'd have had to write some kind of mpd client for yourself. With the 0.2 release, I've added support for extended MPD filter syntax that allows queries that include the stickers that [mpdpopm](https://github.com/sp1ff/mpdpopm) manages– so you can now, for instance, say: - mppopm findadd "(artist =~ \"foo\") and (rating > 175)" +``` +mppopm findadd "(artist =~ \"foo\") and (rating > 175)" +``` MPD will handle the "artist =~" clause & [mpdpopm](https://github.com/sp1ff/mpdpopm) the "rating >" clause, as well as combining the results. This will hopefully be a start to making [mpdpopm](https://github.com/sp1ff/mpdpopm) into a more of a user-facing application than a developer-facing utlity. -Windows support may be some time coming; the daemon depends on Unix signal handling, the MPD Unix socket, and the Unix daemon logic, especially `fork` & `exec`… if you'd like to run it on Windows, let me know– if there's enough interest, and I can get some kind of Windows VM setup, I'll look at a port. +Windows support may be some time coming; the daemon depends on Unix signal handling, the MPD Unix socket, and the Unix daemon logic, especially `fork` & `exec`… if you'd like to run it on Windows, let me know– if there's enough interest, and I can get some kind of Windows VM setup, I'll look at a port. -Longer-term, I see [mpdpopm](https://github.com/sp1ff/mpdpopm) as a "dual" to mpd– mpd commits to never altering your files. mpdpopm will take on that task in terms of tags, at least. To address the "plumbing, not the sink" problem, I'd like to author a client that will handle player control (of course), but also visualization & tag editing– a complete music library solution. +Longer-term, I see [mpdpopm](https://github.com/sp1ff/mpdpopm) as a "dual" to mpd– mpd commits to never altering your files. mpdpopm will take on that task in terms of tags, at least. To address the "plumbing, not the sink" problem, I'd like to author a client that will handle player control (of course), but also visualization & tag editing– a complete music library solution. Suggestions, bug reports & PRs welcome! - diff --git a/pkgs/by-name/mp/mpdpopm/package.nix b/pkgs/by-name/mp/mpdpopm/package.nix index 907bb1cf..7048f41e 100644 --- a/pkgs/by-name/mp/mpdpopm/package.nix +++ b/pkgs/by-name/mp/mpdpopm/package.nix @@ -16,7 +16,7 @@ rustPlatform.buildRustPackage (finalAttrs: { version = "0.1.0"; buildInputs = []; - nativeBuildInputs = [ ]; + nativeBuildInputs = []; src = ./.; cargoLock = { diff --git a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs index c20bf3fa..7ec89441 100644 --- a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs +++ b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs @@ -228,6 +228,5 @@ pub(crate) enum SubCommand { /// Show general stats about your music collection. /// /// This includes favorite artist, songs and also the negative ones. - Stats { - } + Stats {}, } diff --git a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh index 020d18d0..89909ed9 100755 --- a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh +++ b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh @@ -10,7 +10,6 @@ # You should have received a copy of the License along with this program. # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. - # Run `beets` once, to trigger eventual beets migrations. # Otherwise, these might screw with our file adding (because `beets` prints them on stdout, # for some reason !?) diff --git a/pkgs/by-name/ri/river-mk-keymap/Cargo.toml b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml index 34a5b1e5..593c360d 100644 --- a/pkgs/by-name/ri/river-mk-keymap/Cargo.toml +++ b/pkgs/by-name/ri/river-mk-keymap/Cargo.toml @@ -20,7 +20,11 @@ ab_glyph = "0.2.32" anyhow = "1.0.102" clap = { version = "4.6.1", features = ["derive"] } font-kit = "0.14.3" -keymaps = { version = "1.2.0", features = ["serde", "mouse-keys", "modifier-keys"] } +keymaps = { version = "1.2.0", features = [ + "serde", + "mouse-keys", + "modifier-keys", +] } memmap2 = "0.9.10" rustix = { version = "1.1.4", features = ["fs", "shm"] } serde = { version = "1.0.228", features = ["derive"] } @@ -28,9 +32,9 @@ serde_json = "1.0.149" shlex = "1.3.0" thiserror = "2.0.18" vte = "0.15.0" -wayland-client = {version = "0.31.14", default-features = false} +wayland-client = { version = "0.31.14", default-features = false } wayland-protocols-wlr = { version = "0.3.12", features = ["client"] } -wayland-scanner = {version = "0.31.10", default-features = false} +wayland-scanner = { version = "0.31.10", default-features = false } [profile.release] lto = true diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs index 8372b61d..ebae7939 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/commands.rs @@ -10,7 +10,7 @@ use std::{env::current_exe, path::Path, process::Command}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use keymaps::key_repr::{Key, KeyValue, Keys, MediaKeyCode, ModifierKeyCode, MouseKeyValue}; use rustix::path::Arg; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs index 16dc02f4..106ae9bd 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs @@ -10,7 +10,7 @@ use std::{fmt::Display, ops::Deref, str::FromStr}; -use anyhow::{anyhow, bail, Context, Result}; +use anyhow::{Context, Result, anyhow, bail}; use keymaps::{ key_repr::{Key, Keys}, map_tree::MapTrie, @@ -98,8 +98,10 @@ impl FromStr for KeyMap { for (key, value) in raw { decode_value( &mut out, - vec![Key::from_str(&key) - .with_context(|| format!("Failed to parse key ('{key}')"))?], + vec![ + Key::from_str(&key) + .with_context(|| format!("Failed to parse key ('{key}')"))?, + ], &value, )?; } diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs index c6e04fdf..5bdf9d3d 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/dispatches.rs @@ -2,12 +2,12 @@ use std::num::NonZero; use keymaps::key_repr::Key; use wayland_client::{ + Connection, Dispatch, QueueHandle, globals::GlobalListContents, protocol::{ wl_buffer::WlBuffer, wl_compositor::WlCompositor, wl_registry, wl_seat::WlSeat, wl_shm::WlShm, wl_shm_pool::WlShmPool, wl_surface::WlSurface, }, - Connection, Dispatch, QueueHandle, }; use wayland_protocols_wlr::layer_shell::v1::client::{ @@ -16,12 +16,11 @@ use wayland_protocols_wlr::layer_shell::v1::client::{ }; use crate::wayland::{ - ansi, render, + AppData, ansi, render, river::protocols::river_protocols::{ zriver_seat_status_v1::{self, ZriverSeatStatusV1}, zriver_status_manager_v1::ZriverStatusManagerV1, }, - AppData, }; impl Dispatch<ZriverSeatStatusV1, ()> for AppData { diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs index 44c010d5..2b37e9b5 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs @@ -7,6 +7,7 @@ use anyhow::Result; use wayland_client::{ + Connection, globals::registry_queue_init, protocol::{ wl_compositor::WlCompositor, @@ -14,7 +15,6 @@ use wayland_client::{ wl_shm::{self, WlShm}, wl_surface::WlSurface, }, - Connection, }; use wayland_protocols_wlr::layer_shell::v1::client::{ zwlr_layer_shell_v1::{self, ZwlrLayerShellV1}, diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs index 7f0aaec9..032e98a4 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/layout.rs @@ -1,4 +1,4 @@ -use ab_glyph::{point, Font, Glyph, Point, ScaleFont}; +use ab_glyph::{Font, Glyph, Point, ScaleFont, point}; use crate::wayland::ansi::{StyledChar, StyledString}; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs index e92def3c..fa44f602 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/render/mod.rs @@ -1,6 +1,6 @@ use std::{fs::File, io::Read}; -use ab_glyph::{point, Font, FontVec, PxScale, ScaleFont}; +use ab_glyph::{Font, FontVec, PxScale, ScaleFont, point}; use anyhow::{Context, Result}; use font_kit::{ family_name::FamilyName, handle::Handle, properties::Properties, source::SystemSource, @@ -76,11 +76,7 @@ pub(super) fn text(input: &StyledString) -> Result<(ColorVec, (u32, u32))> { scaled_font.h_advance(g.id) }; - if next > acc { - next - } else { - acc - } + if next > acc { next } else { acc } }) .ceil() as usize; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs index e54b65e1..29f5aabe 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/river/protocols.rs @@ -12,7 +12,7 @@ pub(crate) mod river_protocols { pub(crate) mod __status { use wayland_client::backend as wayland_backend; use wayland_client::protocol::__interfaces::{ - wl_output_interface, wl_seat_interface, WL_OUTPUT_INTERFACE, WL_SEAT_INTERFACE, + WL_OUTPUT_INTERFACE, WL_SEAT_INTERFACE, wl_output_interface, wl_seat_interface, }; wayland_scanner::generate_interfaces!("./resources/river-status-unstable-v1.xml"); } diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs index 0b1fdc1b..db0e06c1 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/multi.rs @@ -68,14 +68,14 @@ use std::io; use std::os::unix::io::OwnedFd; use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; use wayland_client::backend::protocol::Message; use wayland_client::backend::{Backend, ObjectData, ObjectId}; use wayland_client::{ - protocol::{wl_buffer, wl_shm}, Proxy, + protocol::{wl_buffer, wl_shm}, }; use crate::wayland::shm::CreatePoolError; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs index a12afaa0..3f4416de 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/raw.rs @@ -18,9 +18,9 @@ use std::{ use memmap2::MmapMut; use wayland_client::{ + Dispatch, Proxy, QueueHandle, WEnum, backend::ObjectData, protocol::{wl_buffer, wl_shm, wl_shm_pool}, - Dispatch, Proxy, QueueHandle, WEnum, }; use super::CreatePoolError; diff --git a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs index ab52c5f6..1f70c0e9 100644 --- a/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs +++ b/pkgs/by-name/ri/river-mk-keymap/src/wayland/shm/slot.rs @@ -4,20 +4,20 @@ use std::io; use std::{ os::unix::io::{AsRawFd, OwnedFd}, sync::{ - atomic::{AtomicU8, AtomicUsize, Ordering}, Arc, Mutex, Weak, + atomic::{AtomicU8, AtomicUsize, Ordering}, }, }; use wayland_client::backend::protocol::Message; use wayland_client::backend::{ObjectData, ObjectId}; use wayland_client::{ - protocol::{wl_buffer, wl_shm, wl_surface}, Proxy, + protocol::{wl_buffer, wl_shm, wl_surface}, }; -use crate::wayland::shm::raw::RawPool; use crate::wayland::shm::CreatePoolError; +use crate::wayland::shm::raw::RawPool; #[derive(Debug, thiserror::Error)] pub(crate) enum CreateBufferError { @@ -420,7 +420,10 @@ impl Buffer { /// Note: if you need to ensure that [`canvas()`](Buffer::canvas) calls never return data that /// could be attached to a surface in a multi-threaded client, make this call while you have /// exclusive access to the corresponding [`SlotPool`]. - pub(crate) fn attach_to(&self, surface: &wl_surface::WlSurface) -> Result<(), ActivateSlotError> { + pub(crate) fn attach_to( + &self, + surface: &wl_surface::WlSurface, + ) -> Result<(), ActivateSlotError> { self.activate()?; surface.attach(Some(&self.inner), 0, 0); Ok(()) diff --git a/pkgs/by-name/ts/tskm/Cargo.toml b/pkgs/by-name/ts/tskm/Cargo.toml index 2770cda7..5953919e 100644 --- a/pkgs/by-name/ts/tskm/Cargo.toml +++ b/pkgs/by-name/ts/tskm/Cargo.toml @@ -17,7 +17,15 @@ edition = "2021" [dependencies] anyhow = { version = "1.0.102", default-features = false } -clap = { version = "4.6.1", features = [ "derive", "std", "color", "help", "usage", "error-context", "suggestions", ], default-features = false } +clap = { version = "4.6.1", features = [ + "derive", + "std", + "color", + "help", + "usage", + "error-context", + "suggestions", +], default-features = false } clap_complete = { version = "4.6.3", features = ["unstable-dynamic"] } dirs = { version = "6.0.0", default-features = false } log = { version = "0.4.29", default-features = false } @@ -25,7 +33,10 @@ serde = { version = "1.0.228", features = ["derive"], default-features = false } serde_json = { version = "1.0.149", default-features = false } stderrlog = { version = "0.6.0", default-features = false } taskchampion = { version = "2.0.3", default-features = false } -url = { version = "2.5.8", features = ["serde", "std"], default-features = false } +url = { version = "2.5.8", features = [ + "serde", + "std", +], default-features = false } walkdir = { version = "2.5.0", default-features = false } md5 = { version = "0.8.0", default-features = false } yaml-rust2 = "0.10.4" diff --git a/pkgs/by-name/ts/tskm/src/cli.rs b/pkgs/by-name/ts/tskm/src/cli.rs index 359c1050..a347f5ce 100644 --- a/pkgs/by-name/ts/tskm/src/cli.rs +++ b/pkgs/by-name/ts/tskm/src/cli.rs @@ -10,8 +10,8 @@ use std::{ffi::OsStr, path::PathBuf}; -use anyhow::{bail, Result}; -use clap::{builder::StyledStr, ArgAction, Parser, Subcommand, ValueEnum}; +use anyhow::{Result, bail}; +use clap::{ArgAction, Parser, Subcommand, ValueEnum, builder::StyledStr}; use clap_complete::{ArgValueCompleter, CompletionCandidate}; use crate::{ diff --git a/pkgs/by-name/ts/tskm/src/interface/input/handle.rs b/pkgs/by-name/ts/tskm/src/interface/input/handle.rs index f9772f34..d9904657 100644 --- a/pkgs/by-name/ts/tskm/src/interface/input/handle.rs +++ b/pkgs/by-name/ts/tskm/src/interface/input/handle.rs @@ -82,7 +82,7 @@ pub fn handle(command: InputCommand, state: &mut State) -> Result<()> { )?; { - use std::io::{stdin, stdout, Write}; + use std::io::{Write, stdin, stdout}; let mut s = String::new(); eprint!("Continue? (y/N) "); diff --git a/pkgs/by-name/ts/tskm/src/interface/input/mod.rs b/pkgs/by-name/ts/tskm/src/interface/input/mod.rs index 1d1d67f4..b6176a96 100644 --- a/pkgs/by-name/ts/tskm/src/interface/input/mod.rs +++ b/pkgs/by-name/ts/tskm/src/interface/input/mod.rs @@ -18,7 +18,7 @@ use std::{ str::FromStr, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use url::Url; use walkdir::WalkDir; diff --git a/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs b/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs index ea3a89ae..4e433143 100644 --- a/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs +++ b/pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs @@ -10,12 +10,12 @@ use std::{ env, - fs::{self, read_to_string, File, OpenOptions}, + fs::{self, File, OpenOptions, read_to_string}, io::Write, process::Command, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use crate::{cli::NeorgCommand, state::State}; diff --git a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs index 3897a63b..15f749c5 100644 --- a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs +++ b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs @@ -10,7 +10,7 @@ use std::str::FromStr; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use log::{error, info}; use url::Url; @@ -152,13 +152,7 @@ pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { }; for (active, url) in tabs { - let is_selected = { - if active { - "🔻 " - } else { - " " - } - }; + let is_selected = { if active { "🔻 " } else { " " } }; println!("{is_selected}{url}"); } } diff --git a/pkgs/by-name/ts/tskm/src/interface/open/mod.rs b/pkgs/by-name/ts/tskm/src/interface/open/mod.rs index e403b4a8..407536d2 100644 --- a/pkgs/by-name/ts/tskm/src/interface/open/mod.rs +++ b/pkgs/by-name/ts/tskm/src/interface/open/mod.rs @@ -14,7 +14,7 @@ use std::{ str::FromStr, }; -use anyhow::{anyhow, Context, Result}; +use anyhow::{Context, Result, anyhow}; use taskchampion::chrono::NaiveDateTime; use url::Url; use yaml_rust2::Yaml; diff --git a/pkgs/by-name/ts/tskm/src/task/mod.rs b/pkgs/by-name/ts/tskm/src/task/mod.rs index 9c671273..5e223e33 100644 --- a/pkgs/by-name/ts/tskm/src/task/mod.rs +++ b/pkgs/by-name/ts/tskm/src/task/mod.rs @@ -10,14 +10,14 @@ use std::{ fmt::Display, - fs::{self, read_to_string, File}, + fs::{self, File, read_to_string}, path::PathBuf, process::Command, str::FromStr, sync::OnceLock, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use log::{debug, info, trace}; use taskchampion::Tag; |
