controller: add auto-connect service

This commit is contained in:
Leonardo Eugênio 2024-05-30 21:48:43 -03:00
parent ad12a22346
commit 49074303af
3 changed files with 44 additions and 12 deletions

View file

@ -1,17 +1,22 @@
{ pkgs, lib, ... }:
{
config,
pkgs,
lib,
inputs,
...
}:
{
xdg.desktopEntries = {
connect-controller = {
name = "Connect Controller";
exec = "bluetoothctl connect 84:30:95:97:1A:79";
terminal = false;
systemd.user.services = {
autoconnect-gamepad = {
Unit = {
Description = "Attempt to connect to game controllers";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = lib.getExe pkgs.auto_connect_gamepad;
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
};
xdg.desktopEntries = {
disconnect-controller = {
name = "Disconnect Controller";
exec = "bluetoothctl disconnect 84:30:95:97:1A:79";