From 9207419322db99e4d565d1409028175e1403be14 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 11 Aug 2024 13:43:40 +0200 Subject: fix(pkgs/mpc-rm): Rename to `mpc-beetrm` This avoids shadowing the original `mpc rm` command --- modules/home/pkgs/default.nix | 2 +- pkgs/by-name/mp/mpc-beetrm/mpc-beetrm.sh | 11 +++++++++++ pkgs/by-name/mp/mpc-beetrm/package.nix | 16 ++++++++++++++++ pkgs/by-name/mp/mpc-rm/mpc-rm.sh | 11 ----------- pkgs/by-name/mp/mpc-rm/package.nix | 16 ---------------- pkgs/by-name/mp/mpc/mpc.sh | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) create mode 100755 pkgs/by-name/mp/mpc-beetrm/mpc-beetrm.sh create mode 100644 pkgs/by-name/mp/mpc-beetrm/package.nix delete mode 100755 pkgs/by-name/mp/mpc-rm/mpc-rm.sh delete mode 100644 pkgs/by-name/mp/mpc-rm/package.nix diff --git a/modules/home/pkgs/default.nix b/modules/home/pkgs/default.nix index dc7c4fe2..4e77275d 100644 --- a/modules/home/pkgs/default.nix +++ b/modules/home/pkgs/default.nix @@ -135,7 +135,7 @@ with pkgs; let ncmpc # mpd player client mpc-cli-man # a cli mpd client (added via a wrapper script) mpc # Wrapper around `mpc` that allows the usage of `mpc-{rm,lyrics,searchadd}` without the `-` - mpc-rm # Removes the currently playing song from the disk and storage + mpc-beetrm # Removes the currently playing song from the disk and storage mpc-searchadd # Works like normal `mpc searchadd` but uses the `beets` query syntax # Displays the lyrics of the currently playing song (mpc-lyrics.override { diff --git a/pkgs/by-name/mp/mpc-beetrm/mpc-beetrm.sh b/pkgs/by-name/mp/mpc-beetrm/mpc-beetrm.sh new file mode 100755 index 00000000..3209503c --- /dev/null +++ b/pkgs/by-name/mp/mpc-beetrm/mpc-beetrm.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH + +beet remove --delete \ + title:"$(mpc --format '%title%' current)" \ + album:"$(mpc --format '%album%' current)" +mpc del 0 + +# vim: ft=sh diff --git a/pkgs/by-name/mp/mpc-beetrm/package.nix b/pkgs/by-name/mp/mpc-beetrm/package.nix new file mode 100644 index 00000000..837c93e2 --- /dev/null +++ b/pkgs/by-name/mp/mpc-beetrm/package.nix @@ -0,0 +1,16 @@ +{ + sysLib, + mpc-cli, + beets, +}: +sysLib.writeShellScript { + name = "mpc-beetrm"; + src = ./mpc-beetrm.sh; + generateCompletions = false; + keepPath = false; + + dependencies = [ + mpc-cli + beets + ]; +} diff --git a/pkgs/by-name/mp/mpc-rm/mpc-rm.sh b/pkgs/by-name/mp/mpc-rm/mpc-rm.sh deleted file mode 100755 index 3209503c..00000000 --- a/pkgs/by-name/mp/mpc-rm/mpc-rm.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -beet remove --delete \ - title:"$(mpc --format '%title%' current)" \ - album:"$(mpc --format '%album%' current)" -mpc del 0 - -# vim: ft=sh diff --git a/pkgs/by-name/mp/mpc-rm/package.nix b/pkgs/by-name/mp/mpc-rm/package.nix deleted file mode 100644 index 8af84279..00000000 --- a/pkgs/by-name/mp/mpc-rm/package.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - sysLib, - mpc-cli, - beets, -}: -sysLib.writeShellScript { - name = "mpc-rm"; - src = ./mpc-rm.sh; - generateCompletions = false; - keepPath = false; - - dependencies = [ - mpc-cli - beets - ]; -} diff --git a/pkgs/by-name/mp/mpc/mpc.sh b/pkgs/by-name/mp/mpc/mpc.sh index f613cf0a..0d636ac5 100755 --- a/pkgs/by-name/mp/mpc/mpc.sh +++ b/pkgs/by-name/mp/mpc/mpc.sh @@ -12,9 +12,9 @@ case "$1" in shift 1 mpc-lyrics "$@" ;; -"rm") +"beetrm") shift 1 - mpc-rm "$@" + mpc-beetrm "$@" ;; *) mpc "$@" -- cgit 1.4.1