From 4bad81413601aaeddeb3fdfcaea260491b4db14a Mon Sep 17 00:00:00 2001 From: catvayor Date: Fri, 8 Nov 2024 12:59:17 +0100 Subject: [PATCH] feat(pipewire): finished to remove pulseaudio --- modules/desktop/sway.nix | 54 ++++++++++++++----------- modules/desktop/waybar/config | 4 +- users/catvayor.nix | 76 +++++++++++++++++++---------------- 3 files changed, 73 insertions(+), 61 deletions(-) diff --git a/modules/desktop/sway.nix b/modules/desktop/sway.nix index ad2db90..3476510 100644 --- a/modules/desktop/sway.nix +++ b/modules/desktop/sway.nix @@ -5,9 +5,11 @@ ... }: { - programs.wshowkeys.enable = true; - programs.sway.enable = true; - programs.dconf.enable = true; + programs = { + wshowkeys.enable = true; + sway.enable = true; + dconf.enable = true; + }; services.dbus.packages = with pkgs; [ dconf ]; xdg.portal = { enable = true; @@ -26,22 +28,24 @@ { xdg.configFile."sway/config".onChange = lib.mkForce ""; - home.sessionVariables = { - MOZ_ENABLE_WAYLAND = "1"; - MOZ_USE_XINPUT2 = "1"; - SDL_VIDEODRIVER = "wayland"; - QT_QPA_PLATFORM = "wayland"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - _JAVA_AWT_WM_NONREPARETING = "1"; - XDG_SESSION_TYPE = "wayland"; - XDG_CURRENT_DESKTOP = "sway"; + home = { + sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + MOZ_USE_XINPUT2 = "1"; + SDL_VIDEODRIVER = "wayland"; + QT_QPA_PLATFORM = "wayland"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + _JAVA_AWT_WM_NONREPARETING = "1"; + XDG_SESSION_TYPE = "wayland"; + XDG_CURRENT_DESKTOP = "sway"; + }; + file.".config/waybar" = { + source = ./waybar; + recursive = true; + }; }; programs.waybar.enable = true; - home.file.".config/waybar" = { - source = ./waybar; - recursive = true; - }; services.swayidle = let @@ -84,7 +88,10 @@ exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff''; in rec { - window.border = 1; + window = { + border = 1; + titlebar = false; + }; gaps.smartBorders = "on"; modifier = "Mod4"; terminal = "alacritty"; @@ -92,8 +99,8 @@ startup = [ # { command = "waybar -b bar-0"; } - { command = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ on"; } - { command = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ on"; } + { command = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ on"; } + { command = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ on"; } { command = "discord"; } { command = "thunderbird"; } @@ -125,7 +132,6 @@ output."*".bg = "${./wall.jpg} fill"; seat."*"."hide_cursor" = "5000"; focus.wrapping = "yes"; - window.titlebar = false; colors = let # black = "#000000"; @@ -260,10 +266,10 @@ "${modifier}+Shift+F1" = "move scratchpad"; "${modifier}+F1" = "scratchpad show"; - "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + "XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "XF86AudioMicMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%"; }; diff --git a/modules/desktop/waybar/config b/modules/desktop/waybar/config index 6fbe114..2a11c26 100644 --- a/modules/desktop/waybar/config +++ b/modules/desktop/waybar/config @@ -138,9 +138,7 @@ "car": "", "default": [""] }, - "on-click": "pavucontrol", - "on-scroll-up": "pamixer -ui 2", - "on-scroll-down": "pamixer -ud 2", + "on-click": "pwvucontrol", }, "tray": { diff --git a/users/catvayor.nix b/users/catvayor.nix index 4f641b3..f0e8c50 100644 --- a/users/catvayor.nix +++ b/users/catvayor.nix @@ -24,12 +24,14 @@ }; services.gvfs.enable = true; - programs.thunar.enable = true; - programs.thunar.plugins = with pkgs.xfce; [ - thunar-volman - thunar-archive-plugin - thunar-media-tags-plugin - ]; + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-volman + thunar-archive-plugin + thunar-media-tags-plugin + ]; + }; home-manager.users.catvayor = { imports = with mods.home; [ @@ -38,35 +40,45 @@ mail ]; - programs.git = { - enable = true; - userName = "catvayor"; - userEmail = "catvayor@katvayor.net"; - signing = { - key = null; - signByDefault = true; + programs = { + alacritty = { + enable = true; + settings = lib.importTOML ./cat-alacritty.toml; + }; + thunderbird = { + enable = true; + profiles = { }; + }; + git = { + enable = true; + userName = "catvayor"; + userEmail = "catvayor@katvayor.net"; + signing = { + key = null; + signByDefault = true; + }; }; }; - home.packages = with pkgs; [ - wl-clipboard - firefox - pavucontrol - libnotify - zathura + home = { + packages = with pkgs; [ + wl-clipboard + firefox + pwvucontrol + libnotify + zathura - discord - signal-desktop - mattermost-desktop - keepassxc - ]; - - programs.alacritty = { - enable = true; - settings = lib.importTOML ./cat-alacritty.toml; + discord + signal-desktop + mattermost-desktop + keepassxc + ]; + pointerCursor = { + package = pkgs.breeze-hacked-cursor-theme; + name = "Breeze_Hacked"; + }; }; - programs.thunderbird.enable = true; - programs.thunderbird.profiles = { }; + services.mako = { enable = true; width = 400; @@ -105,10 +117,6 @@ name = "Breeze_Hacked"; }; }; - home.pointerCursor = { - package = pkgs.breeze-hacked-cursor-theme; - name = "Breeze_Hacked"; - }; xdg.enable = true; }; }