From c9944e92bc1e2bff9071300b25b11642d218f424 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 28 May 2026 13:10:42 +0200 Subject: treewide: Format --- pkgs/by-name/fu/fupdate/flake.nix | 2 +- pkgs/by-name/fu/fupdate/src/cli.rs | 2 +- pkgs/by-name/fu/fupdate/src/main.rs | 2 +- pkgs/by-name/lf/lf-make-map/flake.nix | 2 +- pkgs/by-name/mp/mpdpopm/Cargo.toml | 15 +- pkgs/by-name/mp/mpdpopm/README.md | 191 ++++++++++----------- pkgs/by-name/mp/mpdpopm/package.nix | 2 +- pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs | 3 +- pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh | 1 - pkgs/by-name/ri/river-mk-keymap/Cargo.toml | 10 +- .../ri/river-mk-keymap/src/key_map/commands.rs | 2 +- pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs | 8 +- .../ri/river-mk-keymap/src/wayland/dispatches.rs | 5 +- pkgs/by-name/ri/river-mk-keymap/src/wayland/mod.rs | 2 +- .../river-mk-keymap/src/wayland/render/layout.rs | 2 +- .../ri/river-mk-keymap/src/wayland/render/mod.rs | 8 +- .../river-mk-keymap/src/wayland/river/protocols.rs | 2 +- .../ri/river-mk-keymap/src/wayland/shm/multi.rs | 4 +- .../ri/river-mk-keymap/src/wayland/shm/raw.rs | 2 +- .../ri/river-mk-keymap/src/wayland/shm/slot.rs | 11 +- pkgs/by-name/ts/tskm/Cargo.toml | 15 +- pkgs/by-name/ts/tskm/src/cli.rs | 4 +- pkgs/by-name/ts/tskm/src/interface/input/handle.rs | 2 +- pkgs/by-name/ts/tskm/src/interface/input/mod.rs | 2 +- pkgs/by-name/ts/tskm/src/interface/neorg/handle.rs | 4 +- pkgs/by-name/ts/tskm/src/interface/open/handle.rs | 10 +- pkgs/by-name/ts/tskm/src/interface/open/mod.rs | 2 +- pkgs/by-name/ts/tskm/src/task/mod.rs | 4 +- 28 files changed, 167 insertions(+), 152 deletions(-) (limited to 'pkgs') 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) @@ -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). - # 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. - # Licsense [mpdpopm](https://github.com/sp1ff/mpdpopm) is GPL v3 software. - # 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. - # Installing As mentioned above, you can install [mpdpopm](https://github.com/sp1ff/mpdpopm) in a few different ways. In increasing order of complexity: - ## 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 x8664 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 x8664 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. - ## 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. - ## Use the Debian package If you're running on a Debian-based Linux distribution, and you're on an x8664 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. - ## 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.) - ## 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. - ## 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. - # 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). - ## 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. ## Getting Set-up - ### 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. - ### 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. - ### 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. - # 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 do 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 do 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 . - # 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 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; -- cgit 1.4.1