From: Skullheadx Date: Sun, 26 Apr 2026 05:56:25 +0000 (-0400) Subject: mpd and rmpc X-Git-Url: http://git.skullheadx.com/sitemap.xml?a=commitdiff_plain;h=5ab67052741984a5002a21bd11a7b55be9421189;p=nixos.git mpd and rmpc --- diff --git a/.gitignore b/.gitignore index 1377554..3819313 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +*.swo diff --git a/audio.nix b/audio.nix index 15adf9c..c164680 100644 --- a/audio.nix +++ b/audio.nix @@ -15,18 +15,28 @@ }; }; - # services.mpd = { - # enable = true; - # musicDirectory = "${config.home.homeDirectory}/Music"; - # playlistDirectory = "${config.home.homeDirectory}/.playlists"; - # # mixer_type "none" # maybe mess around with this some time, it will turn off volume in rmpc, but apparently it will make the sound more quality for music - # extraConfig = '' - # auto_update "yes" - # audio_output { - # type "pulse" - # name "PipeWire Output" - # } - # ''; - # }; + hjem.users.andrew = { + files = { + ".config/mpd/mpd.conf".text = builtins.readFile ./dotfiles/mpd/mpd.conf; + + ".config/rmpc/config.ron".text = builtins.readFile ./dotfiles/rmpc/config.ron; + ".config/rmpc/themes/theme.ron".text = builtins.readFile ./dotfiles/rmpc/themes/theme.ron; + + }; + packages = with pkgs; [ + mpc + rmpc + ]; + }; + + +systemd.user.services.mpd = { + description = "Music Player Daemon"; + wantedBy = [ "default.target" ]; + serviceConfig = { + ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon /home/andrew/.config/mpd/mpd.conf"; + Restart = "on-failure"; + }; +}; } diff --git a/dotfiles/mpd/mpd.conf b/dotfiles/mpd/mpd.conf new file mode 100644 index 0000000..c226a77 --- /dev/null +++ b/dotfiles/mpd/mpd.conf @@ -0,0 +1,9 @@ +music_directory "~/Music" +playlist_directory "~/Music/.playlists" +db_file "~/.config/mpd/database" +log_file "syslog" + +audio_output { + type "pipewire" + name "PipeWire Output" +} diff --git a/dotfiles/rmpc/config.ron b/dotfiles/rmpc/config.ron new file mode 100644 index 0000000..a43dfa0 --- /dev/null +++ b/dotfiles/rmpc/config.ron @@ -0,0 +1,158 @@ +#![enable(implicit_some)] +#![enable(unwrap_newtypes)] +#![enable(unwrap_variant_newtypes)] +( + address: "127.0.0.1:6600", + password: None, + theme: None, + cache_dir: None, + on_song_change: None, + volume_step: 5, + max_fps: 30, + scrolloff: 0, + wrap_navigation: false, + enable_mouse: true, + enable_config_hot_reload: true, + status_update_interval_ms: 1000, + rewind_to_start_sec: None, + reflect_changes_to_playlist: false, + select_current_song_on_change: true, + browser_song_sort: [Disc, Track, Artist, Title], + directories_sort: SortFormat(group_by_type: true, reverse: false), + album_art: ( +method: Auto, +max_size_px: (width: 1200, height: 1200), +disabled_protocols: ["http://", "https://"], +vertical_align: Center, +horizontal_align: Center, + ), + keybinds: ( +global: { + ":": CommandMode, + ",": VolumeDown, + "s": Stop, + ".": VolumeUp, + "": NextTab, + "": PreviousTab, + "1": SwitchToTab("Queue"), + "2": SwitchToTab("Directories"), + "3": SwitchToTab("Artists"), + "4": SwitchToTab("Album Artists"), + "5": SwitchToTab("Albums"), + "6": SwitchToTab("Playlists"), + "7": SwitchToTab("Search"), + "q": Quit, + ">": NextTrack, + "p": TogglePause, + "<": PreviousTrack, + "f": SeekForward, + "z": ToggleRepeat, + "x": ToggleRandom, + "c": ToggleConsume, + "v": ToggleSingle, + "b": SeekBack, + "~": ShowHelp, + "u": Update, + "U": Rescan, + "I": ShowCurrentSongInfo, + "O": ShowOutputs, + "P": ShowDecoders, + "R": AddRandom, +}, +navigation: { + "k": Up, + "j": Down, + "h": Left, + "l": Right, + "": Up, + "": Down, + "": Left, + "": Right, + "": PaneUp, + "": PaneDown, + "": PaneLeft, + "": PaneRight, + "": UpHalf, + "N": PreviousResult, + "a": Add, + "A": AddAll, + "r": Rename, + "n": NextResult, + "g": Top, + "": Select, + "": InvertSelection, + "G": Bottom, + "": Confirm, + "i": FocusInput, + "J": MoveDown, + "": DownHalf, + "/": EnterSearch, + "": Close, + "": Close, + "K": MoveUp, + "D": Delete, + "B": ShowInfo, +}, +queue: { + "D": DeleteAll, + "": Play, + "": Save, + "a": AddToPlaylist, + "d": Delete, + "C": JumpToCurrent, + "X": Shuffle, +}, + ), + search: ( +case_sensitive: false, +ignore_diacritics: false, +mode: Contains, +tags: [ + (value: "any", label: "Any Tag"), + (value: "artist", label: "Artist"), + (value: "album", label: "Album"), + (value: "albumartist", label: "Album Artist"), + (value: "title", label: "Title"), + (value: "filename", label: "Filename"), + (value: "genre", label: "Genre"), +], + ), + artists: ( +album_display_mode: SplitByDate, +album_sort_by: Date, +album_date_tags: [Date], + ), + tabs: [ + ( +name: "Queue", +pane: Split( + direction: Horizontal, + panes: [(size: "60%", pane: Pane(Queue)), (size: "40%", pane: Pane(AlbumArt))], +), + ), + ( +name: "Directories", +pane: Pane(Directories), + ), + ( +name: "Artists", +pane: Pane(Artists), + ), + ( +name: "Album Artists", +pane: Pane(AlbumArtists), + ), + ( +name: "Albums", +pane: Pane(Albums), + ), + ( +name: "Playlists", +pane: Pane(Playlists), + ), + ( +name: "Search", +pane: Pane(Search), + ), +], +) diff --git a/dotfiles/rmpc/themes/theme.ron b/dotfiles/rmpc/themes/theme.ron new file mode 100644 index 0000000..7e20f31 --- /dev/null +++ b/dotfiles/rmpc/themes/theme.ron @@ -0,0 +1,90 @@ +#![enable(implicit_some)] +#![enable(unwrap_newtypes)] +#![enable(unwrap_variant_newtypes)] +( + default_album_art_path: None, + draw_borders: false, + show_song_table_header: false, + symbols: (song: "🎵", dir: "📁", playlist: "🎼", marker: "\u{e0b0}"), + layout: Split( + direction: Vertical, + panes: [ + ( + pane: Pane(Header), + size: "1", + ), + ( + pane: Pane(TabContent), + size: "100%", + ), + ( + pane: Pane(ProgressBar), + size: "1", + ), + ], + ), + progress_bar: ( + symbols: ["", "", "⭘", " ", " "], + track_style: (bg: "#1e2030"), + elapsed_style: (fg: "#c6a0f6", bg: "#1e2030"), + thumb_style: (fg: "#c6a0f6", bg: "#1e2030"), + ), + scrollbar: ( + symbols: ["│", "█", "▲", "▼"], + track_style: (), + ends_style: (), + thumb_style: (fg: "#b7bdf8"), + ), + browser_column_widths: [20, 38, 42], + text_color: "#cad3f5", + background_color: "#24273a", + header_background_color: "#1e2030", + modal_background_color: None, + modal_backdrop: false, + tab_bar: (active_style: (fg: "black", bg: "#c6a0f6", modifiers: "Bold"), inactive_style: ()), + borders_style: (fg: "#6e738d"), + highlighted_item_style: (fg: "#c6a0f6", modifiers: "Bold"), + current_item_style: (fg: "black", bg: "#b7bdf8", modifiers: "Bold"), + highlight_border_style: (fg: "#b7bdf8"), + song_table_format: [ + ( + prop: (kind: Property(Artist), style: (fg: "#b7bdf8"), default: (kind: Text("Unknown"))), + width: "50%", + alignment: Right, + ), + ( + prop: (kind: Text("-"), style: (fg: "#b7bdf8"), default: (kind: Text("Unknown"))), + width: "1", + alignment: Center, + ), + ( + prop: (kind: Property(Title), style: (fg: "#7dc4e4"), default: (kind: Text("Unknown"))), + width: "50%", + ), + ], + header: ( + rows: [ + ( + left: [ + (kind: Text("["), style: (fg: "#b7bdf8", modifiers: "Bold")), + (kind: Property(Status(State)), style: (fg: "#b7bdf8", modifiers: "Bold")), + (kind: Text("]"), style: (fg: "#b7bdf8", modifiers: "Bold")) + ], + center: [ + (kind: Property(Song(Artist)), style: (fg: "#eed49f", modifiers: "Bold"), + default: (kind: Text("Unknown"), style: (fg: "#eed49f", modifiers: "Bold")) + ), + (kind: Text(" - ")), + (kind: Property(Song(Title)), style: (fg: "#7dc4e4", modifiers: "Bold"), + default: (kind: Text("No Song"), style: (fg: "#7dc4e4", modifiers: "Bold")) + ) + ], + right: [ + (kind: Text("Vol: "), style: (fg: "#b7bdf8", modifiers: "Bold")), + (kind: Property(Status(Volume)), style: (fg: "#b7bdf8", modifiers: "Bold")), + (kind: Text("% "), style: (fg: "#b7bdf8", modifiers: "Bold")) + ] + ) + ], + ), +)