switch to wireplumber, fix notifications, use playerctl for media
This commit is contained in:
parent
26a8e34a59
commit
a871d120f5
@ -94,11 +94,6 @@ in
|
||||
options.ezpcusr = {
|
||||
enable = mkEnableOption "Enable simple PC user config";
|
||||
|
||||
babybar = mkOption {
|
||||
default = false;
|
||||
description = ''Switch to using the "baby" swaybar rather than waybar'';
|
||||
};
|
||||
|
||||
uploadScript = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
@ -112,12 +107,6 @@ in
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
bitwardenSession = mkOption {
|
||||
description = "Session key for bitwarden";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
outputOptions = mkOption {
|
||||
description = "Additional output options";
|
||||
default = { };
|
||||
@ -222,8 +211,6 @@ in
|
||||
# ugly stupid way of doing things but im lazy
|
||||
bwRofi = pkgs.writeScript "bw-rofi" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
export BW_SESSION="${cfg.bitwardenSession}"
|
||||
|
||||
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
|
||||
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
|
||||
|
||||
@ -237,8 +224,6 @@ in
|
||||
# very ugly stupid way of doing things but im still lazy
|
||||
bwRofiOtp = pkgs.writeScript "bw-rofi-otp" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
export BW_SESSION="${cfg.bitwardenSession}"
|
||||
|
||||
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
|
||||
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
|
||||
|
||||
@ -263,9 +248,7 @@ in
|
||||
map
|
||||
(
|
||||
n: {
|
||||
name = "${modifier}${if move then "+Shift" else ""}+${builtins.elemAt alphabet ((n - 11) / 10)}+${
|
||||
toString (lib.mod n 10)
|
||||
}";
|
||||
name = "${modifier}${if move then "+Shift" else ""}+${builtins.elemAt alphabet ((n - 11) / 10)}+${toString (lib.mod n 10)}";
|
||||
value = "${if move then "move container to " else ""}workspace ${toString n}";
|
||||
}
|
||||
)
|
||||
@ -302,22 +285,22 @@ in
|
||||
|
||||
# Previous/next but change the shuffle/random state before action (and change back afterwards)
|
||||
"${modifier}+Shift+bracketright" =
|
||||
"exec ${pkgs.mpc_cli}/bin/mpc random && ${pkgs.mpc_cli}/bin/mpc next && ${pkgs.mpc_cli}/bin/mpc random";
|
||||
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
|
||||
"${modifier}+Shift+bracketleft" =
|
||||
"exec ${pkgs.mpc_cli}/bin/mpc random && ${pkgs.mpc_cli}/bin/mpc prev && ${pkgs.mpc_cli}/bin/mpc random";
|
||||
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl previous && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
|
||||
"Shift+XF86AudioNext" =
|
||||
"exec ${pkgs.mpc_cli}/bin/mpc random && ${pkgs.mpc_cli}/bin/mpc next && ${pkgs.mpc_cli}/bin/mpc random";
|
||||
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
|
||||
|
||||
# Previous/next
|
||||
"${modifier}+bracketright" = "exec ${pkgs.mpc_cli}/bin/mpc next";
|
||||
"${modifier}+bracketleft" = "exec ${pkgs.mpc_cli}/bin/mpc prev";
|
||||
"XF86AudioNext" = "exec ${pkgs.mpc_cli}/bin/mpc next";
|
||||
"XF86AudioPrev" = "exec ${pkgs.mpc_cli}/bin/mpc prev";
|
||||
"${modifier}+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
||||
"${modifier}+bracketleft" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
||||
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
||||
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl prev";
|
||||
|
||||
# Toggle play/pause
|
||||
"XF86AudioPlay" = "exec ${pkgs.mpc_cli}/bin/mpc toggle";
|
||||
"XF86AudioPause" = "exec ${pkgs.mpc_cli}/bin/mpc toggle";
|
||||
"${modifier}+backslash" = "exec ${pkgs.mpc_cli}/bin/mpc toggle";
|
||||
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"${modifier}+backslash" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
|
||||
"${modifier}+m" = "exec ${musicRofi}";
|
||||
|
||||
@ -336,11 +319,6 @@ in
|
||||
|
||||
menu = "${pkgs.rofi}/bin/rofi -show drun -show-icons -run-command '${pkgs.sway}/bin/swaymsg exec -- {cmd}'";
|
||||
|
||||
bars = lib.optional cfg.babybar {
|
||||
position = "top";
|
||||
colors = config.colors.i3BarColors;
|
||||
};
|
||||
|
||||
gaps = {
|
||||
smartGaps = lib.mkDefault true;
|
||||
smartBorders = lib.mkDefault "on";
|
||||
@ -360,7 +338,7 @@ in
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = lib.mkDefault (cfg.babybar != true);
|
||||
enable = lib.mkDefault true;
|
||||
systemd.enable = lib.mkDefault true;
|
||||
|
||||
settings = [
|
||||
@ -369,7 +347,7 @@ in
|
||||
height = null;
|
||||
|
||||
modules-left = [ "sway/workspaces" "custom/spacer" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind" ];
|
||||
modules-center = [ "clock#1" "clock#2" "custom/spacer" "mpd" "custom/spacer" "clock#3" "custom/spacer" "clock#4" ];
|
||||
modules-center = [ "clock#1" "clock#2" "custom/spacer" "custom/media" "custom/spacer" "clock#3" "custom/spacer" "clock#4" ];
|
||||
modules-right = [ "pulseaudio" "custom/spacer" "memory" "custom/spacer" "cpu" ] ++ lib.optionals cfg.battery [ "custom/spacer" "battery" ] ++ [ "custom/spacer" "tray" ];
|
||||
|
||||
modules = {
|
||||
@ -398,15 +376,10 @@ in
|
||||
interval = 900;
|
||||
};
|
||||
|
||||
mpd = {
|
||||
"custom/media" = {
|
||||
rotate = 90;
|
||||
max-length = 60;
|
||||
format = "{stateIcon} {artist} - {title}";
|
||||
format-stopped = "⏹ STOPPED";
|
||||
state-icons = {
|
||||
paused = "";
|
||||
playing = "";
|
||||
};
|
||||
exec = "${pkgs.playerctl}/bin/playerctl metadata --format '{{ emoji(status) }} {{ artist }} - {{ title }}' --follow";
|
||||
};
|
||||
|
||||
"sway/workspaces" = {
|
||||
@ -501,7 +474,7 @@ in
|
||||
#custom-weather-temp,
|
||||
#custom-weather-precip,
|
||||
#custom-weather-wind,
|
||||
#mpd {
|
||||
#custom-media {
|
||||
background: #${config.colors.base16.base00};
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
@ -516,7 +489,7 @@ in
|
||||
#custom-weather-precip { padding: 5px 0; }
|
||||
#custom-weather-wind { padding: 0 0 5px 0; }
|
||||
|
||||
#mpd.playing {
|
||||
#custom-media.playing {
|
||||
color: #${config.colors.base16.base0A};
|
||||
}
|
||||
|
||||
@ -550,6 +523,15 @@ in
|
||||
};
|
||||
|
||||
programs.mako.enable = lib.mkDefault true;
|
||||
systemd.user.services.mako = {
|
||||
Service = {
|
||||
ExecStart = "${pkgs.mako}/bin/mako";
|
||||
};
|
||||
Install = {
|
||||
After = [ "sway-session.target" ];
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = lib.mkDefault true;
|
||||
@ -566,8 +548,6 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
services.clipmenu.enable = lib.mkDefault true;
|
||||
|
||||
colors.enable = lib.mkDefault true;
|
||||
fonts.enable = lib.mkDefault true;
|
||||
|
||||
@ -580,16 +560,12 @@ in
|
||||
});
|
||||
};
|
||||
|
||||
services.lorri.enable = lib.mkDefault true;
|
||||
|
||||
services.blueman-applet = {
|
||||
enable = lib.mkDefault cfg.bluetooth;
|
||||
};
|
||||
services.blueman-applet.enable = lib.mkDefault cfg.bluetooth;
|
||||
|
||||
services.mpris-proxy.enable = true;
|
||||
|
||||
home.sessionVariables = { BW_SESSION = cfg.bitwardenSession; };
|
||||
|
||||
services.mpdris2.enable = true;
|
||||
services.playerctld.enable = true;
|
||||
services.mpd = {
|
||||
enable = lib.mkDefault true;
|
||||
musicDirectory = lib.mkDefault "${config.home.homeDirectory}/Music";
|
||||
|
@ -21,32 +21,9 @@ in
|
||||
alsa.support32Bit = lib.mkDefault true;
|
||||
pulse.enable = lib.mkDefault true;
|
||||
|
||||
config.pipewire-pulse = {
|
||||
"context.modules" = [
|
||||
{
|
||||
"args" = { };
|
||||
"flags" = [ "ifexists" "nofail" ];
|
||||
"name" = "libpipewire-module-rtkit";
|
||||
}
|
||||
{ "name" = "libpipewire-module-protocol-native"; }
|
||||
{ "name" = "libpipewire-module-client-node"; }
|
||||
{ "name" = "libpipewire-module-adapter"; }
|
||||
{ "name" = "libpipewire-module-metadata"; }
|
||||
{
|
||||
"args" = {
|
||||
"server.address" = [ "unix:native" "tcp:4713" ];
|
||||
"vm.overrides" = { "pulse.min.quantum" = "1024/48000"; };
|
||||
};
|
||||
"name" = "libpipewire-module-protocol-pulse";
|
||||
}
|
||||
];
|
||||
"context.properties" = { };
|
||||
"context.spa-libs" = {
|
||||
"audio.convert.*" = "audioconvert/libspa-audioconvert";
|
||||
"support.*" = "support/libspa-support";
|
||||
};
|
||||
"stream.properties" = { };
|
||||
};
|
||||
media-session.enable = lib.mkDefault false;
|
||||
wireplumber.enable = lib.mkDefault true;
|
||||
|
||||
media-session.config.bluez-monitor = {
|
||||
properties = {
|
||||
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
|
||||
|
@ -196,6 +196,7 @@ in
|
||||
|
||||
# Shit breaks without this lol
|
||||
programs.dconf.enable = lib.mkDefault true;
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
|
||||
# better default swap
|
||||
boot.kernel.sysctl = { "vm.swappiness" = lib.mkDefault 45; };
|
||||
|
Loading…
Reference in New Issue
Block a user