feat(audio): move to pipewire
This commit is contained in:
24
modules/audio.nix
Normal file
24
modules/audio.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
lib.my.makeSwitch {
|
||||
inherit config;
|
||||
default = true;
|
||||
optionName = "default audio settings";
|
||||
optionPath = [ "audio" ];
|
||||
config' = {
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
audio.enable = true;
|
||||
};
|
||||
users.extraUsers.${username}.extraGroups = [ "audio" ];
|
||||
my.persist.homeDirs = [ ".local/state/wireplumber" ];
|
||||
};
|
||||
}
|
||||
20
modules/bluetooth.nix
Normal file
20
modules/bluetooth.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, ... }:
|
||||
lib.my.makeSwitch {
|
||||
inherit config;
|
||||
default = true;
|
||||
optionName = "default bluetooth settings";
|
||||
optionPath = [ "bluetooth" ];
|
||||
config' = {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
Disable = "HeadSet";
|
||||
MultiProfile = "multiple";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -23,8 +23,3 @@ audio_output {
|
||||
type "pipewire"
|
||||
name "pipewire"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "pulseaudio"
|
||||
}
|
||||
|
||||
@@ -151,17 +151,19 @@
|
||||
"XF86AudioRaiseVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"pamixer"
|
||||
"-i"
|
||||
"2"
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"@DEFAULT_SINK@"
|
||||
"2%+"
|
||||
];
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"pamixer"
|
||||
"-d"
|
||||
"2"
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"@DEFAULT_SINK@"
|
||||
"2%-"
|
||||
];
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
|
||||
@@ -19,8 +19,8 @@ _: {
|
||||
modules-right = [
|
||||
"custom/notification"
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
"pulseaudio#microphone"
|
||||
"wireplumber"
|
||||
"wireplumber#source"
|
||||
];
|
||||
|
||||
"niri/workspaces" = {
|
||||
@@ -73,7 +73,6 @@ _: {
|
||||
stopped = "";
|
||||
};
|
||||
tooltip = false;
|
||||
toottip-format = "{status_icon} Musicfox {artist} - {album} - {title}";
|
||||
on-scroll-up = "playerctl -p musicfox volume 0.05+";
|
||||
on-scroll-down = "playerctl -p musicfox volume 0.05-";
|
||||
};
|
||||
@@ -81,14 +80,12 @@ _: {
|
||||
format = " {:%H:%M %m.%d}";
|
||||
tooltip = false;
|
||||
};
|
||||
pulseaudio = {
|
||||
wireplumber = {
|
||||
format = "{icon} {volume}%";
|
||||
tooltip = false;
|
||||
format-muted = " Muted";
|
||||
on-click = "pamixer -t";
|
||||
on-click-middle = "pavucontrol & disown";
|
||||
on-scroll-up = "pamixer -i 5";
|
||||
on-scroll-down = "pamixer -d 5";
|
||||
on-click = "wpctl set-mute @DEFAULT_SINK@ toggle";
|
||||
on-click-middle = "pwvucontrol";
|
||||
scroll-step = 5;
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
@@ -104,14 +101,13 @@ _: {
|
||||
];
|
||||
};
|
||||
};
|
||||
"pulseaudio#microphone" = {
|
||||
format = "{format_source}";
|
||||
"wireplumber#source" = {
|
||||
node-type = "Audio/Source";
|
||||
format = " {volume}%";
|
||||
tooltip = false;
|
||||
format-source = " {volume}%";
|
||||
format-source-muted = " Muted";
|
||||
on-click = "pamixer --default-source -t";
|
||||
on-scroll-up = "pamixer --default-source -i 5";
|
||||
on-scroll-down = "pamixer --default-source -d 5";
|
||||
format-muted = " Muted";
|
||||
on-click = "wpctl set-mute @DEFAULT_SOURCE@ toggle";
|
||||
on-click-middle = "pwvucontrol";
|
||||
scroll-step = 5;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ tooltip * {
|
||||
#window,
|
||||
#clock,
|
||||
#battery,
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#network,
|
||||
#workspaces,
|
||||
#taskbar,
|
||||
@@ -219,13 +219,13 @@ window#waybar.empty #window {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
#wireplumber {
|
||||
color: #89b4fa;
|
||||
border-right: 0px;
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
}
|
||||
|
||||
#pulseaudio.microphone {
|
||||
#wireplumber.source {
|
||||
color: #cba6f7;
|
||||
margin-right: 5px;
|
||||
border-left: 0px;
|
||||
@@ -238,10 +238,3 @@ window#waybar.empty #window {
|
||||
margin-right: 10px;
|
||||
border-left: 0px;
|
||||
}
|
||||
|
||||
#custom-weather {
|
||||
border-radius: 0px 10px 10px 0px;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user