Unverified Commit 50f4b2d2 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

earbuds: init at 0.1.9-unstable-2024-06-28 (#351860)

parents 2285ef73 54d6c4b1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8297,6 +8297,13 @@
    githubId = 201997;
    name = "Eric Seidel";
  };
  griffi-gh = {
    name = "Alex Prasol";
    email = "prasol258@gmail.com";
    matrix = "@voxel:nyanbinary.rs";
    github = "griffi-gh";
    githubId = 45996170;
  };
  grimmauld = {
    name = "Sören Bender";
    email = "soeren@benjos.de";
+2534 −0

File added.

Preview size limit exceeded, changes collapsed.

+26 −0
Original line number Diff line number Diff line
From 6f52bee7f71e253b0504164fc268750116945108 Mon Sep 17 00:00:00 2001
From: griffi-gh <prasol258@gmail.com>
Date: Mon, 4 Nov 2024 00:43:49 +0100
Subject: [PATCH] fix daemon autostart

---
 src/daemon_utils.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/daemon_utils.rs b/src/daemon_utils.rs
index cd8f49b..f56e100 100644
--- a/src/daemon_utils.rs
+++ b/src/daemon_utils.rs
@@ -13,7 +13,11 @@ use nix::{
 pub fn start() -> bool {
     let curr_exe = env::current_exe().expect("Couldn't get current executable!");
     let mut cmd = Command::new("nohup");
-    let cmd = cmd.arg(curr_exe).arg("-d").arg("--no-fork").arg("-q");
+    let cmd = cmd
+        .arg(curr_exe)
+        .arg("--daemon").arg("true")
+        .arg("--no-fork").arg("true")
+        .arg("--quiet").arg("true");
     cmd.stdout(Stdio::null());
     cmd.stderr(Stdio::null());
     let status = cmd.spawn();
+77 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  rustPlatform,
  fetchFromGitHub,
  installShellFiles,
  nix-update-script,
  pkg-config,
  dbus,
  libpulseaudio,
  bluez,
}:
rustPlatform.buildRustPackage {
  pname = "earbuds";
  version = "0.1.9-unstable-2024-06-28";

  src = fetchFromGitHub {
    owner = "JojiiOfficial";
    repo = "LiveBudsCli";
    rev = "df46706e44fa9e7de355b11eab4cc850efe968a3";
    hash = "sha256-IEor7aZnwCA6Rg2gXIYSQ65hV/jJOKehujOSZnVzVis=";
  };

  # fix daemon autostart not working
  patches = [
    ./fix-daemon.patch
  ];

  # git dependencies are currently not supported in the fixed-output derivation fetcher.
  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "galaxy_buds_rs-0.2.10" = "sha256-95PBmGwHJiXi72Rir8KK7as+i9yjs5nf45SaBhj1geg=";
    };
  };

  nativeBuildInputs = [
    pkg-config
    installShellFiles
  ];

  buildInputs = [
    dbus
    libpulseaudio
    bluez
  ];

  # package does not contain any tests
  doCheck = false;

  # nativeInstallCheckInputs = [
  #   versionCheckHook
  # ];
  # versionCheckProgramArg = [ "--version" ];
  # doInstallCheck = true;

  passthru = {
    updateScript = nix-update-script { };
  };

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd earbuds \
      --bash <($out/bin/earbuds --generate bash) \
      --fish <($out/bin/earbuds --generate fish) \
      --zsh <($out/bin/earbuds --generate zsh)
  '';

  meta = {
    description = "Free CLI tool to control your Galaxy Buds";
    homepage = "https://github.com/JojiiOfficial/LiveBudsCli";
    changelog = "https://github.com/JojiiOfficial/LiveBudsCli/releases";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ griffi-gh ];
    mainProgram = "earbuds";
    platforms = lib.platforms.linux;
  };
}