diff --git a/scripts/auto_connect_gamepad b/scripts/auto_connect_gamepad deleted file mode 100755 index d373281..0000000 --- a/scripts/auto_connect_gamepad +++ /dev/null @@ -1,27 +0,0 @@ -#!/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 diff --git a/scripts/default.nix b/scripts/default.nix index ff25367..975ed2a 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -25,11 +25,6 @@ wl-clipboard fish ]; - auto_connect_gamepad = [ - bluez - coreutils - gnugrep - ]; powerplay-led-idle = [ bash libinput diff --git a/system/bluetooth.nix b/system/bluetooth.nix index 1bcea1f..d3d6af5 100644 --- a/system/bluetooth.nix +++ b/system/bluetooth.nix @@ -1,12 +1,11 @@ { pkgs, ... }: { - services.blueman.enable = true; hardware.bluetooth = { enable = true; settings = { General = { DiscoverableTimeout = 0; - # Discoverable = true; + Discoverable = true; AlwaysPairable = true; }; Policy = { diff --git a/user/controller.nix b/user/controller.nix deleted file mode 100644 index fe08a98..0000000 --- a/user/controller.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ 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; - }; - }; -} diff --git a/user/home.nix b/user/home.nix index 4a4f129..2bb33ae 100644 --- a/user/home.nix +++ b/user/home.nix @@ -8,7 +8,6 @@ }: { imports = [ - ./controller.nix ./helix.nix ./vscode ./fish