More refactoring and added hyprlock
This commit is contained in:
44
modules/system/audio.nix
Normal file
44
modules/system/audio.nix
Normal 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%"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user