add bluetooth and media keys

This commit is contained in:
Ray Andrew 2024-11-03 00:22:06 -05:00
parent 3591ebbdbf
commit 3a32e50429
9 changed files with 65 additions and 10 deletions

View file

@ -64,6 +64,7 @@
};
programs.home-manager.enable = true;
services.mpris-proxy.enable = true;
xdg = {
enable = true;

View file

@ -35,6 +35,10 @@ in
blocks = [
{
block = "sound";
click = [{
button = "left";
cmd = lib.getExe' pkgs.pwvucontrol "pwvucontrol";
}];
}
{
block = "net";

View file

@ -1,9 +1,10 @@
{ config
, pkgs
, lib
, light
, menu
, terminal
, light ? lib.getExe' pkgs.brightnessctl "brightnessctl"
, playerctl ? lib.getExe' pkgs.playerctl "playerctl"
, sound ? "pactl"
, alt ? "Mod1"
, modifier ? "Mod4"
@ -137,8 +138,15 @@ in
"${modifier}+Shift+k" = "move up";
"${modifier}+Shift+l" = "move right";
"XF86MonBrightnessUp" = "exec --no-startup-id ${light} -A 10%";
"XF86MonBrightnessDown" = "exec --no-startup-id ${light} -U 10%";
# "XF86MonBrightnessUp" = "exec --no-startup-id ${light} -A 10%";
# "XF86MonBrightnessDown" = "exec --no-startup-id ${light} -U 10%";
"XF86MonBrightnessUp" = "exec --no-startup-id ${light} s +10%";
"XF86MonBrightnessDown" = "exec --no-startup-id ${light} s 10%-";
"XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause";
"XF86AudioPause" = "exec --no-startup-id ${playerctl} play-pause";
"XF86AudioNext" = "exec --no-startup-id ${playerctl} next";
"XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous";
};
modes =

View file

@ -7,7 +7,6 @@ let
clipboard-copy = lib.getExe' pkgs.xclip "xclip";
commonOptions = import ./common-i3.nix rec {
inherit config lib pkgs;
light = lib.getExe' pkgs.light "light";
menu = lib.getExe' pkgs.dmenu "dmenu_run";
terminal =
if config.programs.kitty.enable then
@ -38,10 +37,10 @@ in
# modifier = "Mod4";
# terminal = "kitty";
keybindings = {
"XF86AudioRaiseVolume" = "exec --no-startup-id '${pactl} set-sink-volume @DEFAULT_SINK@ 1%'";
"XF86AudioLowerVolume" = "exec --no-startup-id '${pactl} set-sink-volume @DEFAULT_SINK@ -1%'";
"XF86AudioMute" = "exec --no-startup-id '${pactl} set-sink-volume @DEFAULT_SINK@ toggle'";
"XF86AudioMicMute" = "exec --no-startup-id '${pactl} set-source-mute @DEFAULT_SOURCE@ toggle'";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +1%";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -1%";
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
"${commonOptions.modifier}+o" = "exec --no-startup-id ${maim} -s ~/pictures/screenshots/$(date +%Y-%m-%d-%H-%M-%S).png";
"${commonOptions.modifier}+Shift+o" = "exec --no-startup-id ${maim} -s | ${clipboard-copy} -selection clipboard -t image/png";
"PRINT" = "exec --no-startup-id ${maim} -s | ${clipboard-copy} -selection clipboard -t image/png";

View file

@ -8,7 +8,6 @@ let
clipboard-copy = lib.getExe' pkgs.wl-clipboard "wl-copy";
commonOptions = import ./common-i3.nix rec {
inherit config lib pkgs;
light = lib.getExe' pkgs.light "light";
menu = lib.getExe' pkgs.bemenu "bemenu-run";
terminal =
if config.programs.kitty.enable then

View file

@ -37,6 +37,7 @@
custom = {
touchpad.enable = true;
fingerprint.enable = true;
bluetooth.enable = true;
wm = {
i3.enable = true;
sway.enable = true;

30
src/nixos/bluetooth.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:
{
options.custom = with lib; {
bluetooth = {
enable = mkEnableOption "Bluetooth";
};
};
config = lib.mkIf config.custom.bluetooth.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true;
};
};
};
services.blueman = {
enable = true;
};
custom.persist = {
root.directories = [
"/var/lib/bluetooth"
];
};
};
}

View file

@ -8,6 +8,7 @@
{
imports = [
./1password.nix
./bluetooth.nix
./displaymanager.nix
./fonts.nix
./fingerprint.nix

View file

@ -19,11 +19,23 @@
main."monitor.libcamera" = "disabled";
};
};
"10-bluez" = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [
"hsp_hs"
"hsp_ag"
"hfp_hf"
"hfp_ag"
];
};
};
};
};
};
hardware.pulseaudio.enable = false;
environment.systemPackages = with pkgs; [ pwvucontrol ];
}