Compare commits
No commits in common. "43f376d9ace80e7df6afd76d659fb0782045cba0" and "914d2ffde574e94bb5da161d8d0057be3adff4e7" have entirely different histories.
43f376d9ac
...
914d2ffde5
24
flake.lock
24
flake.lock
|
@ -176,11 +176,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726325969,
|
"lastModified": 1723685519,
|
||||||
"narHash": "sha256-Mlw7009cdFry9OHpS6jy294lXhb+gcRa0iS2hYhkC6s=",
|
"narHash": "sha256-GkXQIoZmW2zCPp1YFtAYGg/xHNyFH/Mgm79lcs81rq0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "3632080c41d7a657995807689a08ef6c4bcb2c72",
|
"rev": "276a0d055a720691912c6a34abb724e395c8e38a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -393,11 +393,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725703823,
|
"lastModified": 1720042825,
|
||||||
"narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=",
|
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba",
|
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -414,11 +414,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725765290,
|
"lastModified": 1723352546,
|
||||||
"narHash": "sha256-hwX53i24KyWzp2nWpQsn8lfGQNCP0JoW/bvQmcR1DPY=",
|
"narHash": "sha256-WTIrvp0yV8ODd6lxAq4F7EbrPQv0gscBnyfn559c3k8=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "642275444c5a9defce57219c944b3179bf2adaa9",
|
"rev": "ec78079a904d7d55e81a0468d764d0fffb50ac06",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -456,11 +456,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726062281,
|
"lastModified": 1723556749,
|
||||||
"narHash": "sha256-PyFVySdGj3enKqm8RQuo4v1KLJLmNLOq2yYOHsI6e2Q=",
|
"narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e65aa8301ba4f0ab8cb98f944c14aa9da07394f8",
|
"rev": "4a92571f9207810b559c9eac203d1f4d79830073",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
27
scripts/auto_connect_gamepad
Executable file
27
scripts/auto_connect_gamepad
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
list_paired_controllers() {
|
||||||
|
bluetoothctl devices Paired | grep 'Controller' | cut -d' ' -f2
|
||||||
|
}
|
||||||
|
|
||||||
|
count_connected_controllers() {
|
||||||
|
bluetoothctl devices Connected | grep 'Controller' | wc -l
|
||||||
|
}
|
||||||
|
|
||||||
|
try_to_connect_to_all_controllers() {
|
||||||
|
list_paired_controllers | while read paired_controller; do
|
||||||
|
echo "Trying to connect to controller $paired_controller"
|
||||||
|
bluetoothctl connect "$paired_controller"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
echo "looping"
|
||||||
|
if test "$(count_connected_controllers)" -ne 0 ; then
|
||||||
|
echo "there is a controller connected, not attempting to connect to any other"
|
||||||
|
sleep 10s
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
sleep 1s
|
||||||
|
try_to_connect_to_all_controllers
|
||||||
|
done
|
|
@ -124,6 +124,11 @@
|
||||||
zbar
|
zbar
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
];
|
];
|
||||||
|
auto_connect_gamepad = [
|
||||||
|
bluez
|
||||||
|
coreutils
|
||||||
|
gnugrep
|
||||||
|
];
|
||||||
powerplay-led-idle = [
|
powerplay-led-idle = [
|
||||||
bash
|
bash
|
||||||
libinput
|
libinput
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
settings = {
|
settings = {
|
||||||
General = {
|
General = {
|
||||||
DiscoverableTimeout = 0;
|
DiscoverableTimeout = 0;
|
||||||
Discoverable = true;
|
# Discoverable = true;
|
||||||
AlwaysPairable = true;
|
AlwaysPairable = true;
|
||||||
};
|
};
|
||||||
Policy = {
|
Policy = {
|
||||||
|
|
26
user/controller.nix
Normal file
26
user/controller.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
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";
|
||||||
|
terminal = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./controller.nix
|
||||||
./waybar
|
./waybar
|
||||||
./helix.nix
|
./helix.nix
|
||||||
./kakoune
|
./kakoune
|
||||||
|
|
Loading…
Reference in a new issue