nix/system/Udev.nix

13 lines
359 B
Nix
Raw Permalink 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"
'';
}