chore: add bluetooth

This commit is contained in:
2026-07-19 14:06:35 -04:00
parent dc0369137b
commit 75d0e91958
4 changed files with 13 additions and 5 deletions
@@ -33,6 +33,7 @@ in
wms.hyprland = { wms.hyprland = {
enable = true; enable = true;
mainMod = "ALT"; mainMod = "ALT";
bluetooth = true;
}; };
kitty = enabled; kitty = enabled;
strawberry = enabled; strawberry = enabled;
@@ -12,6 +12,7 @@ hl.on("hyprland.start", function()
hl.exec_cmd("uwsm app -- waybar") hl.exec_cmd("uwsm app -- waybar")
if terminal then hl.exec_cmd("uwsm app -- " .. terminal) end if terminal then hl.exec_cmd("uwsm app -- " .. terminal) end
hl.exec_cmd("uwsm app -- firefox") hl.exec_cmd("uwsm app -- firefox")
if btApplet then hl.exec_cmd("uwsm app -- blueman-applet") end
end) end)
----------------------- -----------------------
@@ -182,9 +183,11 @@ hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 4%+"), { locked = true, repeating = true }) hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 4%+"), { locked = true, repeating = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 5%-"), { locked = true, repeating = true }) hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 5%-"), { locked = true, repeating = true })
-- macOS Keyboard Brightness -- macOS Keyboard Brightness - Dedicated F5/F6 keys emit XF86KbdBrightness*; applesmc LED is 'smc::kbd_backlight'.
hl.bind(menuMod .. " + XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -d kbd_backlight s 10%+"), { locked = true, repeating = true }) hl.bind("XF86KbdBrightnessUp", hl.dsp.exec_cmd("brightnessctl -d smc::kbd_backlight s 10%+"), { locked = true, repeating = true })
hl.bind(menuMod .. " + XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -d kbd_backlight s 10%-"), { locked = true, repeating = true }) hl.bind("XF86KbdBrightnessDown", hl.dsp.exec_cmd("brightnessctl -d smc::kbd_backlight s 10%-"), { locked = true, repeating = true })
hl.bind(menuMod .. " + XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -d smc::kbd_backlight s 10%+"), { locked = true, repeating = true })
hl.bind(menuMod .. " + XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -d smc::kbd_backlight s 10%-"), { locked = true, repeating = true })
-- Player Controls -- Player Controls
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
@@ -7,7 +7,7 @@
}: }:
let let
inherit (lib) types mkIf; inherit (lib) types mkIf;
inherit (lib.${namespace}) mkOpt enabled; inherit (lib.${namespace}) mkOpt mkBoolOpt enabled;
cfg = config.${namespace}.programs.graphical.wms.hyprland; cfg = config.${namespace}.programs.graphical.wms.hyprland;
graphical = config.${namespace}.programs.graphical; graphical = config.${namespace}.programs.graphical;
@@ -22,6 +22,7 @@ in
mainMod = mkOpt types.str "SUPER" "main modifier key"; mainMod = mkOpt types.str "SUPER" "main modifier key";
menuMod = mkOpt types.str "SUPER" "menu modifier key (i.e. menuMod + space)"; menuMod = mkOpt types.str "SUPER" "menu modifier key (i.e. menuMod + space)";
monitors = mkOpt (with types; listOf str) [ ", preferred, auto, 1" ] "monitor configuration"; monitors = mkOpt (with types; listOf str) [ ", preferred, auto, 1" ] "monitor configuration";
bluetooth = mkBoolOpt false "Bluetooth tray applet (blueman); requires system services.blueman.enable";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@@ -47,6 +48,7 @@ in
local mainMod = "${cfg.mainMod}" local mainMod = "${cfg.mainMod}"
local menuMod = "${cfg.menuMod}" local menuMod = "${cfg.menuMod}"
local terminal = ${if terminal == null then "nil" else ''"${terminal}"''} local terminal = ${if terminal == null then "nil" else ''"${terminal}"''}
local btApplet = ${if cfg.bluetooth then "true" else "false"}
${lib.concatMapStringsSep "\n" mkMonitor cfg.monitors} ${lib.concatMapStringsSep "\n" mkMonitor cfg.monitors}
'' ''
@@ -218,7 +220,7 @@ in
hyprshot hyprshot
wofi wofi
wofi-emoji wofi-emoji
]; ] ++ lib.optional cfg.bluetooth blueman;
xdg.configFile = { xdg.configFile = {
"wofi/config".source = ./config/wofi.conf; "wofi/config".source = ./config/wofi.conf;
@@ -23,6 +23,8 @@ in
services = { services = {
xserver.videoDrivers = [ "modesetting" ]; xserver.videoDrivers = [ "modesetting" ];
fwupd.enable = true; fwupd.enable = true;
# Blueman Mechanism - Polkit helper the waybar tray applet needs for privileged BT ops.
blueman.enable = true;
}; };
# System Config # System Config