From 883655dc58dff0016e5db56c07ec66b95ece4e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sat, 13 Dec 2025 22:49:53 +0100 Subject: [PATCH] dmenu-bluetooth: remove --- configs/packages.nix | 1 - flake.nix | 1 - packages/dmenu-bluetooth.nix | 64 ------------------------------------ 3 files changed, 66 deletions(-) delete mode 100644 packages/dmenu-bluetooth.nix diff --git a/configs/packages.nix b/configs/packages.nix index c506aa2..bd9df79 100644 --- a/configs/packages.nix +++ b/configs/packages.nix @@ -158,7 +158,6 @@ in { niveumPackages.literature-quote niveumPackages.booksplit niveumPackages.dmenu-randr - niveumPackages.dmenu-bluetooth niveumPackages.manual-sort niveumPackages.dns-sledgehammer niveumPackages.wttr diff --git a/flake.nix b/flake.nix index 38c7405..ef63450 100644 --- a/flake.nix +++ b/flake.nix @@ -357,7 +357,6 @@ dashboard = pkgs.callPackage packages/dashboard {}; devanagari = pkgs.callPackage packages/devanagari {}; devour = pkgs.callPackage packages/devour.nix {}; - dmenu-bluetooth = pkgs.callPackage packages/dmenu-bluetooth.nix {}; dmenu-scrot = pkgs.callPackage packages/dmenu-scrot.nix {}; dns-sledgehammer = pkgs.callPackage packages/dns-sledgehammer.nix {}; fkill = pkgs.callPackage packages/fkill.nix {}; diff --git a/packages/dmenu-bluetooth.nix b/packages/dmenu-bluetooth.nix deleted file mode 100644 index 971c478..0000000 --- a/packages/dmenu-bluetooth.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - writers, - libnotify, - dmenu, - bluez5, - lib, -}: -writers.writeDashBin "dmenu-bluetooth" '' - # UI for connecting to bluetooth devices - set -efu - PATH=$PATH=${lib.makeBinPath [libnotify dmenu bluez5]} - - bluetooth_notify() { - notify-send --app-name=" Bluetooth" "$@" - } - - chose_device() { - # the output from `bluetoothctl {paired-,}devices` has a first column which always contains `Device` followed by a MAC address and the device name - cut -d ' ' -f2- | dmenu -i -l 5 -p "Bluetooth device" - } - - bluetoothctl scan on & - - case "$(printf "pair\nconnect\ndisconnect" | dmenu -i)" in - pair) - chosen="$(bluetoothctl devices | chose_device)" - chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)" - - bluetooth_notify "$chosen_name" "Pairing ..." - - if bluetoothctl pair "$(echo "$chosen" | cut -d ' ' -f1)"; then - bluetooth_notify "✔ $chosen_name" "Paired with device." - else - test "$chosen" && bluetooth_notify "❌ $chosen_name" "Failed to pair with device." - fi - ;; - - connect) - chosen="$(bluetoothctl paired-devices | chose_device)" - chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)" - - bluetooth_notify "$chosen_name" "Trying to connect ..." - - if bluetoothctl connect "$(echo "$chosen" | cut -d ' ' -f1)"; then - bluetooth_notify "✔ $chosen_name" "Connected to device." - else # something was selected but it didn't work - test "$chosen" && bluetooth_notify "❌ $chosen_name" "Failed to connect to device." - fi - ;; - - disconnect) - chosen="$(bluetoothctl paired-devices | chose_device)" - chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)" - - bluetooth_notify "$chosen_name" "Disconnecting ..." - - if bluetoothctl disconnect "$(echo "$chosen" | cut -d ' ' -f1)"; then - bluetooth_notify "✔ $chosen_name" "Disconnected from device." - else # something was selected but it didn't work - test "$chosen" && bluetooth_notify "❌ $chosen_name" "Failed to disconnect from device." - fi - ;; - esac -''