nix/system/Udev.nix

13 lines
359 B
Nix
Raw Normal View History

{ pkgs, ... }:
let
waybar_reload = pkgs.writeShellScriptBin "bt-wb-dispatcher" ''
${pkgs.procps}/bin/pkill -RTMIN+7 waybar
'';
in
{
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="${waybar_reload}/bin/bt-wb-dispatcher"
ACTION=="remove", SUBSYSTEM=="bluetooth", RUN+="${waybar_reload}/bin/bt-wb-dispatcher"
'';
}