clean up some real old shit
This commit is contained in:
parent
fb8f6800a8
commit
ab4c6db5dd
2 changed files with 45 additions and 88 deletions
|
|
@ -1,34 +0,0 @@
|
||||||
diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
|
|
||||||
index 4afa399..fbaaf06e 100644
|
|
||||||
--- a/ui/gtk/native_theme_gtk.cc
|
|
||||||
+++ b/ui/gtk/native_theme_gtk.cc
|
|
||||||
@@ -116,6 +116,13 @@
|
|
||||||
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
|
|
||||||
base::BindRepeating(AddGtkNativeCoreColorMixer));
|
|
||||||
|
|
||||||
+ // Add the web native theme as an observer to stay in sync with dark mode,
|
|
||||||
+ // high contrast, and preferred color scheme changes.
|
|
||||||
+ color_scheme_observer_ =
|
|
||||||
+ std::make_unique<NativeTheme::ColorSchemeNativeThemeObserver>(
|
|
||||||
+ NativeTheme::GetInstanceForWeb());
|
|
||||||
+ AddObserver(color_scheme_observer_.get());
|
|
||||||
+
|
|
||||||
OnThemeChanged(gtk_settings_get_default(), nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/ui/gtk/native_theme_gtk.h b/ui/gtk/native_theme_gtk.h
|
|
||||||
index 876a738..ad3b88d41 100644
|
|
||||||
--- a/ui/gtk/native_theme_gtk.h
|
|
||||||
+++ b/ui/gtk/native_theme_gtk.h
|
|
||||||
@@ -93,6 +93,11 @@
|
|
||||||
mutable absl::optional<SkColor> color_cache_[kColorId_NumColors];
|
|
||||||
|
|
||||||
ScopedCssProvider theme_css_override_;
|
|
||||||
+
|
|
||||||
+ // Used to notify the web native theme of changes to dark mode, high
|
|
||||||
+ // contrast, and preferred color scheme.
|
|
||||||
+ std::unique_ptr<NativeTheme::ColorSchemeNativeThemeObserver>
|
|
||||||
+ color_scheme_observer_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace gtk
|
|
||||||
|
|
@ -22,6 +22,12 @@ in {
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
batch = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "idfk";
|
||||||
|
default = cfg.usbSoundcard;
|
||||||
|
};
|
||||||
|
|
||||||
periodSize = mkOption {
|
periodSize = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -50,75 +56,60 @@ in {
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
|
|
||||||
jack.enable = lib.mkDefault true;
|
jack.enable = lib.mkDefault true;
|
||||||
alsa.enable = lib.mkDefault true;
|
alsa.enable = lib.mkDefault true;
|
||||||
alsa.support32Bit = lib.mkDefault true;
|
alsa.support32Bit = lib.mkDefault true;
|
||||||
pulse.enable = lib.mkDefault true;
|
pulse.enable = lib.mkDefault true;
|
||||||
|
|
||||||
wireplumber.enable = lib.mkDefault true;
|
wireplumber.enable = lib.mkDefault true;
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
extraConfig = {
|
||||||
# pactl is required for pipewire-pulse
|
pipewire."92-low-latency" = mkIf cfg.lowLatency {
|
||||||
pulseaudio
|
"context.properties" = {
|
||||||
];
|
"default.clock.rate" = cfg.rate;
|
||||||
|
"default.clock.quantum" = cfg.quantum;
|
||||||
|
"default.clock.min-quantum" = cfg.quantum;
|
||||||
|
"default.clock.max-quantum" = cfg.quantum;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.pipewire.extraConfig.pipewire."92-low-latency" = mkIf cfg.lowLatency {
|
pipewire-pulse."92-low-latency" = mkIf cfg.lowLatency {
|
||||||
context.properties = {
|
context.modules = [
|
||||||
default.clock.rate = cfg.rate;
|
{
|
||||||
default.clock.quantum = cfg.quantum;
|
name = "libpipewire-module-protocol-pulse";
|
||||||
default.clock.min-quantum = cfg.quantum;
|
args = {
|
||||||
default.clock.max-quantum = cfg.quantum;
|
pulse.min.req = qr;
|
||||||
|
pulse.default.req = qr;
|
||||||
|
pulse.max.req = qr;
|
||||||
|
pulse.min.quantum = qr;
|
||||||
|
pulse.max.quantum = qr;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
stream.properties = {
|
||||||
|
node.latency = qr;
|
||||||
|
resample.quality = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = mkIf cfg.lowLatency {
|
wireplumber.extraConfig."99-alsa-lowlatency"."alsa_monitor.rules" = [
|
||||||
context.modules = [
|
|
||||||
{
|
{
|
||||||
name = "libpipewire-module-protocol-pulse";
|
matches = [ { "node.name" = "matches:alsa_output.*"; } ];
|
||||||
args = {
|
apply_properties = {
|
||||||
pulse.min.req = qr;
|
"audio.format" = "S32LE";
|
||||||
pulse.default.req = qr;
|
"audio.rate" = toString (cfg.rate * (if cfg.usbSoundcard then 2 else 1)); # for USB soundcards it should be twice your desired rate
|
||||||
pulse.max.req = qr;
|
"api.alsa.period-size" = toString cfg.periodSize; # defaults to 1024, tweak by trial-and-error
|
||||||
pulse.min.quantum = qr;
|
"api.alsa.disable-batch" = if cfg.batch then "false" else "true"; # generally, USB soundcards use the batch mode
|
||||||
pulse.max.quantum = qr;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
stream.properties = {
|
|
||||||
node.latency = qr;
|
|
||||||
resample.quality = 1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.pipewire.wireplumber.configPackages =
|
environment.systemPackages = with pkgs; [
|
||||||
[
|
# pactl is required for lots of scripts still
|
||||||
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
|
pulseaudio
|
||||||
bluez_monitor.properties = {
|
];
|
||||||
["bluez5.enable-sbc-xq"] = true,
|
|
||||||
["bluez5.enable-msbc"] = true,
|
|
||||||
["bluez5.enable-hw-volume"] = true,
|
|
||||||
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
|
||||||
}
|
|
||||||
'')
|
|
||||||
]
|
|
||||||
++ optional cfg.lowLatency (pkgs.writeTextDir "share/wireplumber/main.lua.d/99-alsa-lowlatency.lua" ''
|
|
||||||
alsa_monitor.rules = {
|
|
||||||
{
|
|
||||||
matches = {{{ "node.name", "matches", "alsa_output.*" }}};
|
|
||||||
apply_properties = {
|
|
||||||
["audio.format"] = "S32LE",
|
|
||||||
["audio.rate"] = "${toString (cfg.rate
|
|
||||||
* (
|
|
||||||
if cfg.usbSoundcard
|
|
||||||
then 2
|
|
||||||
else 1
|
|
||||||
))}", -- for USB soundcards it should be twice your desired rate
|
|
||||||
["api.alsa.period-size"] = ${toString cfg.periodSize}, -- defaults to 1024, tweak by trial-and-error
|
|
||||||
-- ["api.alsa.disable-batch"] = true, -- generally, USB soundcards use the batch mode
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'');
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue