From 351d4321a45a448fbb6745725529a891417ea13c Mon Sep 17 00:00:00 2001 From: Johannes Hendrik Gerard van der Weide Date: Wed, 29 Nov 2023 11:24:29 +0100 Subject: [PATCH] Added keybinds for light and audio control to sway --- Hosts/hertog-laptop/configuration.nix | 3 +++ Hosts/hertog-laptop/packages.nix | 1 + Users/Hertog/sway.nix | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Hosts/hertog-laptop/configuration.nix b/Hosts/hertog-laptop/configuration.nix index a290331..ac2266c 100644 --- a/Hosts/hertog-laptop/configuration.nix +++ b/Hosts/hertog-laptop/configuration.nix @@ -21,6 +21,9 @@ jack.enable = true; }; }; + programs = { + light.enable = true; + }; boot.kernelParams = [ "i915.force_probe=9a49" ]; hardware = { opengl = { diff --git a/Hosts/hertog-laptop/packages.nix b/Hosts/hertog-laptop/packages.nix index 9e2fa16..0bc1011 100644 --- a/Hosts/hertog-laptop/packages.nix +++ b/Hosts/hertog-laptop/packages.nix @@ -24,6 +24,7 @@ gnome-text-editor warp tor-browser-bundle-bin + pamixer # Utils popsicle ]; diff --git a/Users/Hertog/sway.nix b/Users/Hertog/sway.nix index cd85099..4752292 100755 --- a/Users/Hertog/sway.nix +++ b/Users/Hertog/sway.nix @@ -1,5 +1,8 @@ -{ config, pkgs, ... }: +{ config, pkgs, options, lib, ... }: +let + modifierKey = config.wayland.windowManager.sway.config.modifier; +in { # Wofi programs.wofi = { @@ -131,6 +134,12 @@ {command = "swaybg -i /etc/nixos/Assets/background.svg";} {command = "keepassxc /home/hertog/Documents/Belangrijk/Wachtwoorden.kdbx";} ]; + keybindings = lib.mkOptionDefault { + "${modifierKey}+Shift+l+p" = "exec light -A 5"; + "${modifierKey}+Shift+l+m" = "exec light -U 5"; + "${modifierKey}+Shift+s+p" = "exec pamixer -i 5"; + "${modifierKey}+Shift+s+m" = "exec pamixer -d 5"; + }; colors = { background = "#242424"; focused = {