Set up mpd
This commit is contained in:
parent
62f68eb9dc
commit
a8b8d866af
|
@ -34,6 +34,7 @@
|
|||
programs.my-sway.enable = true;
|
||||
programs.my-sway.fontSize = 15.0;
|
||||
programs.my-sway.enableLaptopBars = false;
|
||||
programs.my-sway.enableMpd = true;
|
||||
# Keyboard options
|
||||
wayland.windowManager.sway.config.input."type:keyboard".xkb_layout = "jp";
|
||||
# 144hz adaptive refresh ON!
|
||||
|
@ -62,6 +63,14 @@
|
|||
# OwnCloud
|
||||
services.owncloud-client.enable = true;
|
||||
|
||||
# mpd stuff
|
||||
services.mpd-discord-rpc.enable = true;
|
||||
services.mpd-discord-rpc.package = pkgs.unstable.mpd-discord-rpc;
|
||||
services.mpdris2.enable = true;
|
||||
# ncmpcpp
|
||||
programs.ncmpcpp.enable = true;
|
||||
|
||||
services.mpris-proxy.enable = true;
|
||||
|
||||
# linux.graphical.x11.hidpi = true;
|
||||
# linux.graphical.x11.enablei3 = true;
|
||||
|
|
|
@ -67,6 +67,11 @@ in
|
|||
description = "Whether to enable laptop-specific bars (battery)";
|
||||
default = true;
|
||||
};
|
||||
enableMpd = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether to enable mpd on waybar";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config.wayland.windowManager.sway = mkIf cfg.enable {
|
||||
|
@ -238,21 +243,23 @@ in
|
|||
modules-center = [
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
"backlight"
|
||||
] ++ (
|
||||
if cfg.enableLaptopBars
|
||||
then [ "battery" "battery#bat2" ]
|
||||
else [ ]
|
||||
) ++ [
|
||||
"clock"
|
||||
];
|
||||
modules-right =
|
||||
(if cfg.enableMpd then [ "mpd" ] else [ ])
|
||||
++ [
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
"backlight"
|
||||
] ++ (
|
||||
if cfg.enableLaptopBars
|
||||
then [ "battery" "battery#bat2" ]
|
||||
else [ ]
|
||||
) ++ [
|
||||
"clock"
|
||||
];
|
||||
|
||||
modules = {
|
||||
"sway/mode" = {
|
||||
|
@ -322,6 +329,31 @@ in
|
|||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
"mpd" = {
|
||||
"format" = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 🎧";
|
||||
"format-disconnected" = "Disconnected 🎧";
|
||||
"format-stopped" = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped 🎧";
|
||||
"interval" = 2;
|
||||
"consume-icons" = {
|
||||
"on" = " "; # Icon shows only when "consume" is on
|
||||
};
|
||||
"random-icons" = {
|
||||
"off" = "<span color=\"#f53c3c\"></span> "; # Icon grayed out when "random" is off;
|
||||
"on" = " ";
|
||||
};
|
||||
"repeat-icons" = {
|
||||
"on" = " ";
|
||||
};
|
||||
"single-icons" = {
|
||||
"on" = "1 ";
|
||||
};
|
||||
"state-icons" = {
|
||||
"paused" = "";
|
||||
"playing" = "";
|
||||
};
|
||||
"tooltip-format" = "MPD (connected)";
|
||||
"tooltip-format-disconnected" = "MPD (disconnected)";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
@ -365,7 +397,7 @@ in
|
|||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor {
|
||||
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor, #mpd {
|
||||
padding: 0 10px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
@ -465,9 +497,13 @@ in
|
|||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
|
||||
#mpd {
|
||||
background-color: teal;
|
||||
color: white;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
config.home.packages = mkIf cfg.enable (with pkgs; [
|
||||
# Needed for QT_QPA_PLATFORM
|
||||
qt5.qtwayland
|
||||
|
|
|
@ -263,5 +263,37 @@
|
|||
MusicFolder = "/mnt/Stuff/Music";
|
||||
};
|
||||
systemd.services.navidrome.serviceConfig.BindReadOnlyPaths = lib.mkAfter [ "/etc" ];
|
||||
|
||||
|
||||
# mpd
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
user = "nki";
|
||||
startWhenNeeded = true;
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pipewire"
|
||||
name "pipewire local"
|
||||
dsd "yes"
|
||||
}
|
||||
'';
|
||||
};
|
||||
systemd.services.mpd.environment = {
|
||||
# https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
|
||||
XDG_RUNTIME_DIR = "/run/user/1000"; # User-id 1000 must match above user. MPD will look inside this directory for the PipeWire socket.
|
||||
};
|
||||
sops.secrets."scrobble/lastfm" = { };
|
||||
sops.secrets."scrobble/listenbrainz" = { };
|
||||
services.mpdscribble = {
|
||||
enable = true;
|
||||
endpoints."last.fm" = {
|
||||
username = "natsukagami";
|
||||
passwordFile = config.sops.secrets."scrobble/lastfm".path;
|
||||
};
|
||||
endpoints."listenbrainz" = {
|
||||
username = "natsukagami";
|
||||
passwordFile = config.sops.secrets."scrobble/listenbrainz".path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@ hosts: ENC[AES256_GCM,data:JIDOL+j8cGa4ymHnAx8FYQr+e5aa2a/iTOQY3w==,iv:GGjoNIFcC
|
|||
windscribe:
|
||||
privateKey: ENC[AES256_GCM,data:lELNIGkr6i9LbeOdHsWmRf0Qjb7O2oQUxngEGUDEmoK2fN+kb/ZnLVaarpY=,iv:7evXoxVI0MHB2NHCOK9WS2dAueXIQA6ymTMGkRwj5yw=,tag:PQ9hMZ74C0eIbj/nIGf5lg==,type:str]
|
||||
presharedKey: ENC[AES256_GCM,data:eZraFKYGNeu0YkIFQ4EnlZU7MkjBkWU5YWmZfDT0x1IvkUwueV7algeC5eo=,iv:TAUzLVnLAI8op3+OKCA2g02Px5i5fySgUV5iuIUGka8=,tag:Bsntn4O6h7+TEvQVLgQc6w==,type:str]
|
||||
scrobble:
|
||||
lastfm: ENC[AES256_GCM,data:+3G9zwmAu/B9omG0KUT0b5G+lJ4=,iv:ubrE4A35si9f6+m2sAino4SfOf9F4g2UjtF2Yy9n2e4=,tag:A/e6GECfIZuX2bVGPo9qyA==,type:str]
|
||||
listenbrainz: ENC[AES256_GCM,data:FNSJnYEQd+LgInmdyqcaAQG6imiJS/OPBEe2fBKQGKBjpCLy,iv:qhloVpcwcGwRDn6vOujgmvelbPl2korhELfyf5BvdjM=,tag:WnLaMUtHsxBaXNTAKwchkQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
|
@ -20,8 +23,8 @@ sops:
|
|||
aGpXT1JkSTZ5dWZLMUZVNlR4NVUvMjQKRAM+Lsj5gH6WLYX5NPW8Mh6iLq6wIl7E
|
||||
0i1ql90F2EGFDii2g1rJLFrsarM3yYWfsaQGcF3BMiJzHwnh5zuEfA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2021-10-29T03:34:42Z"
|
||||
mac: ENC[AES256_GCM,data:D1wOdPwPaSOXuzz1H/L+zt5tl5tELcq2N/Axr1OfHmp7MZcYc0bwiNURHYovO+19bxcdaqSdReFQ8aWwrRB7nvH9MJEDbryAzhcioeDN2ekTmcmcrBW4ehDjwAT4pr/jYzUQWvyoP1g94wuIcJZiGpDVNelONy6Iy924BJsbw5w=,iv:ISNUShAk8xt70uU1fPQx7cT2V0GQtpUmuvaQEgRJBUA=,tag:UL9o6MJ908bF8VGtvtaYPw==,type:str]
|
||||
lastmodified: "2022-09-16T10:37:15Z"
|
||||
mac: ENC[AES256_GCM,data:+YW1Jbs2En9QEbSm994LeKGDQ411mpBz4ZjM0FM/W1S8IQMeMuUZL3Ku8JCjB3u2a6nX4TdqOUGrWSpq5QScgu1avXIdGNPyais2YVTRu0vUoya/X4hOqXykVVgio8LOMcS73oQZQazUmTDYGW5ytbfdtrZo9+gKffzJ2nziOoE=,iv:SCnEb95tCVkCqbccOPCrMrF2Gaz6+esPTRNPD7Zb+M8=,tag:LGDtm+MepZZRFFsJKvFlfw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.1
|
||||
version: 3.7.3
|
||||
|
|
Loading…
Reference in a new issue