From af99b4960a9bf1043234354d685ed23818c14aaa Mon Sep 17 00:00:00 2001 From: Alexander Kassouni Date: Sat, 29 Aug 2026 23:53:40 -0700 Subject: new laptop --- users/kassouni/xbindkeys.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 users/kassouni/xbindkeys.nix (limited to 'users/kassouni/xbindkeys.nix') diff --git a/users/kassouni/xbindkeys.nix b/users/kassouni/xbindkeys.nix new file mode 100644 index 0000000..41ef7ed --- /dev/null +++ b/users/kassouni/xbindkeys.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: +let + wpctl = "${pkgs.wireplumber}/bin/wpctl"; + + xbindkeysrc = pkgs.writeText "xbindkeysrc" '' + "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+" + XF86AudioRaiseVolume + + "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-" + XF86AudioLowerVolume + + "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" + XF86AudioMute + ''; +in +{ + systemd.user.services.xbindkeys = { + Unit = { + Description = "xbindkeys"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + # -n keeps it in the foreground so systemd can supervise it + ExecStart = "${pkgs.xbindkeys}/bin/xbindkeys -n -f ${xbindkeysrc}"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; +} -- cgit v1.3.1