aboutsummaryrefslogtreecommitdiff
path: root/home/mun
diff options
context:
space:
mode:
Diffstat (limited to 'home/mun')
-rw-r--r--home/mun/default.nix1
-rw-r--r--home/mun/programs/rmpc.nix25
-rw-r--r--home/mun/programs/rmpc/config.ron320
3 files changed, 346 insertions, 0 deletions
diff --git a/home/mun/default.nix b/home/mun/default.nix
index 0a52238..4a16acd 100644
--- a/home/mun/default.nix
+++ b/home/mun/default.nix
@@ -6,6 +6,7 @@
./programs/nvim.nix
./programs/nixcord.nix
./programs/browser.nix
+ ./programs/rmpc.nix
];
home = {
diff --git a/home/mun/programs/rmpc.nix b/home/mun/programs/rmpc.nix
new file mode 100644
index 0000000..12414a6
--- /dev/null
+++ b/home/mun/programs/rmpc.nix
@@ -0,0 +1,25 @@
+{pkgs, ...}: {
+ # Setup MPD as the backend of RMPC
+ services.mpd = {
+ enable = true;
+ user = "mun";
+ musicDirectory = "/home/mun//Music";
+ extraConfig = ''
+ audio_output {
+ type "pipewire"
+ name "PipeWire"
+ }
+ '';
+ };
+ # Install rmpc from unstable nix
+ home.packages = with pkgs.unstable;
+ [
+ rmpc
+ ] # Add cava and libnotify as a stable package for config dependencies
+ ++ (with pkgs; [
+ cava
+ libnotify
+ ]);
+ # Write the rmpc config
+ xdg.configFile."rmpc/config.ron".source = ./rmpc/config.ron;
+}
diff --git a/home/mun/programs/rmpc/config.ron b/home/mun/programs/rmpc/config.ron
new file mode 100644
index 0000000..74a8d79
--- /dev/null
+++ b/home/mun/programs/rmpc/config.ron
@@ -0,0 +1,320 @@
+#![enable(implicit_some)]
+#![enable(unwrap_newtypes)]
+#![enable(unwrap_variant_newtypes)]
+(
+ address: "127.0.0.1:6600",
+ password: None,
+ theme: None,
+ cache_dir: None,
+
+ // Notify on song change
+ on_song_change: Some(["sh", "-c", "notify-send -a rmpc '${TITLE:-Unknown}' '${ARTIST:-Unknown Artist} — ${ALBUM:-Unknown Album}'"]),
+ exec_on_song_change_at_start: false,
+
+ on_exit: None,
+
+ // Lyrics
+ lyrics_dir: Some("~/Music/lyrics"),
+ lyrics_offset_ms: 0,
+ enable_lyrics_index: true,
+ enable_lyrics_hot_reload: true,
+
+ // Playback
+ volume_step: 5,
+ rewind_to_start_sec: Some(3),
+ keep_state_on_song_change: true,
+ reflect_changes_to_playlist: false,
+
+ // UI
+ max_fps: 60,
+ scrolloff: 5,
+ wrap_navigation: false,
+ enable_mouse: true,
+ scroll_amount: 3,
+ status_update_interval_ms: 500,
+ select_current_song_on_change: true,
+ center_current_song_on_change: true,
+ enable_config_hot_reload: true,
+ quit_closes_modal: true,
+ auto_open_downloads: true,
+ ignore_leading_the: 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,
+ ),
+
+ cava: (
+ enabled: true,
+ bars: 32,
+ framerate: 60,
+ autosens: true,
+ sensitivity: 100,
+ lower_cutoff_freq: 50,
+ higher_cutoff_freq: 10000,
+ smoothing: MonsterCat(
+ monstercat: 1.5,
+ ),
+ ),
+
+ // Keybinds — default rmpc binds are already vim-style (hjkl, gg/G, C-u/C-d, etc.)
+ // keeping defaults and just adding a couple of extras
+ keybinds: (
+ clear: false,
+ global: {
+ "q": Quit,
+ "?": ShowHelp,
+ ":": CommandMode,
+ "oI": ShowCurrentSongInfo,
+ "oo": ShowOutputs,
+ "op": ShowDecoders,
+ "od": ShowDownloads,
+ "oP": Partition(),
+ "z": ToggleRepeat,
+ "x": ToggleRandom,
+ "c": ToggleConsume,
+ "v": ToggleSingle,
+ "p": TogglePause,
+ "s": Stop,
+ ">": NextTrack,
+ "<": PreviousTrack,
+ "f": SeekForward,
+ "b": SeekBack,
+ ".": VolumeUp,
+ ",": VolumeDown,
+ "<Tab>": NextTab,
+ "gt": NextTab,
+ "<S-Tab>": PreviousTab,
+ "gT": PreviousTab,
+ "1": SwitchToTab("Queue"),
+ "2": SwitchToTab("Directories"),
+ "3": SwitchToTab("Artists"),
+ "4": SwitchToTab("Album Artists"),
+ "5": SwitchToTab("Albums"),
+ "6": SwitchToTab("Playlists"),
+ "7": SwitchToTab("Search"),
+ "u": Update,
+ "U": Rescan,
+ "R": AddRandom,
+ },
+ navigation: {
+ "<C-c>": Close,
+ "<Esc>": Close,
+ "<CR>": Confirm,
+ "k": Up,
+ "<Up>": Up,
+ "j": Down,
+ "<Down>": Down,
+ "h": Left,
+ "<Left>": Left,
+ "l": Right,
+ "<Right>": Right,
+ "<C-w>k": PaneUp,
+ "<C-Up>": PaneUp,
+ "<C-w>j": PaneDown,
+ "<C-Down>": PaneDown,
+ "<C-w>h": PaneLeft,
+ "<C-Left>": PaneLeft,
+ "<C-w>l": PaneRight,
+ "<C-Right>": PaneRight,
+ "K": MoveUp,
+ "J": MoveDown,
+ "<C-u>": UpHalf,
+ "<C-d>": DownHalf,
+ "<C-b>": PageUp,
+ "<PageUp>": PageUp,
+ "<C-f>": PageDown,
+ "<PageDown>": PageDown,
+ "gg": Top,
+ "G": Bottom,
+ "<Space>": Select,
+ "<C-Space>": InvertSelection,
+ "/": EnterSearch,
+ "n": NextResult,
+ "N": PreviousResult,
+ "a": Add,
+ "A": AddAll,
+ "D": Delete,
+ "<C-r>": Rename,
+ "i": FocusInput,
+ "oi": ShowInfo,
+ "<C-x>": ContextMenu(),
+ "<C-s>s": Save(kind: Modal(all: false, duplicates_strategy: Ask)),
+ "<C-s>a": Save(kind: Modal(all: true, duplicates_strategy: Ask)),
+ "r": Rate(),
+ "Y": CopyToClipboard(kind: Modal([
+ ("Displayed value", (content: DisplayedValue, all: false)),
+ ("Artist - Title", (content: Metadata([(kind: Property(Artist)), (kind: Text(" - ")), (kind: Property(Title))]), all: false)),
+ ])),
+ "y": CopyToClipboard(kind: Content(content: DisplayedValue, all: false)),
+ },
+ queue: {
+ "d": Delete,
+ "D": DeleteAll,
+ "<CR>": Play,
+ "C": JumpToCurrent,
+ "L": SelectAlbum(),
+ "X": Shuffle,
+ },
+ ),
+
+ search: (
+ case_sensitive: false,
+ ignore_diacritics: true,
+ search_button: 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],
+ ),
+
+ // Layout: Queue tab has album art + lyrics on left, queue on right
+ // Other tabs are simple single-pane
+ tabs: [
+ (
+ name: "Queue",
+ pane: Split(
+ direction: Horizontal,
+ panes: [
+ (
+ size: "35%",
+ pane: Split(
+ direction: Vertical,
+ panes: [
+ (
+ size: "100%",
+ borders: "LEFT | RIGHT | TOP",
+ border_symbols: Rounded,
+ pane: Pane(AlbumArt)
+ ),
+ (
+ size: "6",
+ borders: "LEFT | RIGHT",
+ border_symbols: Rounded,
+ pane: Pane(Cava)
+ ),
+ (
+ size: "7",
+ borders: "ALL",
+ border_symbols: Inherited(parent: Rounded, top_left: "├", top_right: "┤",),
+ border_title: [(kind: Text(" Lyrics "))],
+ border_title_alignment: Right,
+ pane: Pane(Lyrics)
+ ),
+ ],
+ ),
+ ),
+ (
+ size: "65%",
+ pane: Split(
+ direction: Vertical,
+ panes: [
+ (
+ size: "3",
+ borders: "ALL",
+ border_symbols: Inherited(parent: Rounded, bottom_left: "├", bottom_right: "┤",),
+ pane: Split(
+ direction: Horizontal,
+ panes: [
+ (size: "1", pane: Pane(Empty())),
+ (size: "100%", pane: Pane(QueueHeader())),
+ ]
+ )
+ ),
+ (
+ size: "100%",
+ borders: "LEFT | RIGHT | BOTTOM",
+ border_symbols: Rounded,
+ pane: Split(
+ direction: Horizontal,
+ panes: [
+ (size: "1", pane: Pane(Empty())),
+ (size: "100%", pane: Pane(Queue)),
+ ]
+ )
+ ),
+ ],
+ )
+ ),
+ ],
+ ),
+ ),
+ (
+ name: "Directories",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(Directories), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ (
+ name: "Artists",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(Artists), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ (
+ name: "Album Artists",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(AlbumArtists), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ (
+ name: "Albums",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(Albums), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ (
+ name: "Playlists",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(Playlists), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ (
+ name: "Search",
+ borders: "ALL",
+ border_symbols: Rounded,
+ pane: Split(
+ size: "100%",
+ direction: Vertical,
+ panes: [(pane: Pane(Search), size: "100%", borders: "ALL", border_symbols: Rounded)],
+ )
+ ),
+ ],
+)