feat(hyprland): migrate hardware key bindings
This commit was merged in pull request #157.
This commit is contained in:
@@ -118,6 +118,9 @@
|
||||
]
|
||||
++ lib.optional keybind.repeating {
|
||||
repeating = true;
|
||||
}
|
||||
++ lib.optional keybind.locked {
|
||||
locked = true;
|
||||
};
|
||||
}) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind);
|
||||
};
|
||||
|
||||
@@ -1,9 +1,43 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# PipeWire as the desktop audio server.
|
||||
{
|
||||
options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server";
|
||||
|
||||
config = lib.mkIf config.modules.desktop.utilities.audio.enable {
|
||||
registry.keybind.${config.networking.hostName} = {
|
||||
media-play = {
|
||||
keys = "XF86AudioPlay";
|
||||
locked = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
};
|
||||
};
|
||||
|
||||
media-next = {
|
||||
keys = "XF86AudioNext";
|
||||
locked = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.playerctl}/bin/playerctl next";
|
||||
};
|
||||
};
|
||||
|
||||
media-previous = {
|
||||
keys = "XF86AudioPrev";
|
||||
locked = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.playerctl}/bin/playerctl previous";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Realtime scheduling for the audio threads, so playback survives load.
|
||||
security.rtkit.enable = true;
|
||||
|
||||
|
||||
@@ -13,6 +13,53 @@ in
|
||||
lib.mkEnableOption "the SwayOSD volume and brightness popup";
|
||||
|
||||
config = lib.mkIf config.modules.desktop.utilities.osd.enable {
|
||||
registry.keybind.${config.networking.hostName} = {
|
||||
volume-up = {
|
||||
keys = "XF86AudioRaiseVolume";
|
||||
repeating = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.swayosd}/bin/swayosd-client --output-volume raise --max-volume 100";
|
||||
};
|
||||
};
|
||||
|
||||
volume-down = {
|
||||
keys = "XF86AudioLowerVolume";
|
||||
repeating = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.swayosd}/bin/swayosd-client --output-volume lower";
|
||||
};
|
||||
};
|
||||
|
||||
brightness-up = {
|
||||
keys = "XF86MonBrightnessUp";
|
||||
repeating = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.swayosd}/bin/swayosd-client --brightness raise";
|
||||
};
|
||||
};
|
||||
|
||||
brightness-down = {
|
||||
keys = "XF86MonBrightnessDown";
|
||||
repeating = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.swayosd}/bin/swayosd-client --brightness lower";
|
||||
};
|
||||
};
|
||||
|
||||
mute = {
|
||||
keys = "XF86AudioMute";
|
||||
locked = true;
|
||||
action = {
|
||||
kind = "exec";
|
||||
command = "${pkgs.swayosd}/bin/swayosd-client --output-volume mute-toggle";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.swayosd ];
|
||||
|
||||
# The udev rule chgrps each backlight's brightness node to `video` and adds
|
||||
|
||||
@@ -53,6 +53,13 @@
|
||||
example = true;
|
||||
};
|
||||
|
||||
locked = lib.mkOption {
|
||||
description = "Allows the keybind action while the session is locked.";
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
action = lib.mkOption {
|
||||
description = "Declares the action this keybind runs.";
|
||||
type = lib.types.submodule {
|
||||
|
||||
Reference in New Issue
Block a user