More refactoring and added hyprlock

This commit is contained in:
marc
2024-12-03 22:57:56 +01:00
parent a5cd3713e7
commit 2af075c7dd
9 changed files with 170 additions and 75 deletions

44
modules/system/audio.nix Normal file
View File

@@ -0,0 +1,44 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
let
cfg = config.samfelag.modules.system.audio;
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
in
{
options.samfelag.modules.system.audio = {
enable = mkEnableOption "Audio support";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
alsa-utils
playerctl
brightnessctl
];
services.pipewire.enable = true;
# - Hyprland keybindings ---------------------
hm.wayland.windowManager.hyprland.settings = lib.mkIf hyprCfg.enable {
bind = [
# Pulse Audio controls (mute)
", XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
# Media player controls
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPause, exec, playerctl play-pause"
", XF86AudioNext, exec, playerctl next"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioStop, exec, playerctl stop"
];
binde = [
# Pulse Audio controls (volume)
", XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%"
", XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%"
];
};
};
}