Git Product home page Git Product logo

livebudscli's Introduction

PRs ci/cd crates earbuds earbuds-git

LiveBudsCli

A free cli tool to control your Galaxy buds live, Galaxy Buds+, Galaxy Buds Pro, Galaxy Buds 2 and Galaxy Buds 2 Pro

Note: This requires your buds to be up to date. Buds with old firmware aren't supported


Features

  • Equalizer, touchpad-lock and anc/ambient sound control
  • Basic Buds status (battery, anc/ambient sound, current equalizer setting, ...)
  • Changing touchpad tap action
  • Advanced status informations (battery voltage/current, temperature)
  • Auto music play/pause on bud remove (via mpris)
  • Automatic sink switch (pulseaudio) [feature: pulse-sink, used by default]
  • Desktop notifications (for low battery)
  • Bash completion (for every shell)
  • Connect/Disconnect your earbuds easily with a subcommand
  • Multiple device support
  • Individual device configs
  • Json output for scripts (via jq)
  • Change config options from cli

Install

AUR

yay -S earbuds

Compilation

Requirements (make depends)

Arch: bluez-libs libpulse dbus
Fedora: dbus-devel bluez-libs-devel

Run following command:

cargo install earbuds

Polybar

Polybar
You can display the status of your buds in your polybar with this script
To achieve this, you have to add following to your polybar config and move the script into your polybar script folder. Don't forget to add buds to the modules section.

[module/buds]
type = custom/script
interval = 8
label = %output%
exec = ~/.config/polybar/scripts/polybar.sh
click-middle = earbuds toggle anc
click-right = earbuds toggle touchpadlock

Usage

To get most of the features listed above, you need to have a daemon instance running (earbuds -d). If you run one of the commands listed below, the daemon automatically gets started.

Status informations:

earbuds status

Set equalizer to Bass boost

earbuds set equalizer bass

Enable ANC

earbuds enable anc

Change ambient sound

earbuds set ambientsound <0-4> # 0: off 4: highest

Toggle noise reduction or the touchpad lock

earbuds toggle anc/touchpad

Get status in json format

earbuds status -o json

Set the left touchpad tap command to spotify

earbuds set tap-action spotify left

Connect/disconnect:

earbuds connect/disconnect

To debug the daemon run:

earbuds -k -d --no-fork

This kills the currently running daemon, creates a new one and starts it in the foreground.

livebudscli's People

Contributors

george124816 avatar jojiiofficial avatar renovate-bot avatar renovate[bot] avatar sl424 avatar slin72 avatar totikom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

livebudscli's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

XDG Base Directory Support

Hello,

First of all, thank you for this package.

Current implementation use home dir and hardcoded .config. Are there any chance to follow XDG Base Directory Spec? With this way, users can easily backup their configuration and program states.

Program should check $XDG_CONFIG_HOME environment variable for store buds settings. ~/.config/livebuds/config.toml -> $XDG_CONFIG_HOME/livebuds/config.toml (if environment variable exists).

fails to compile on LMDE6

When I try to cargo install, I get multiple errors. I have installed dbus-devel: apt install libdbus-1-dev. The errors are in the crate itself, not from dependencies.

   Compiling earbuds v0.1.9
error[E0432]: unresolved import `clap::crate_version`
 --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:1:12
  |
1 | use clap::{crate_version, App, AppSettings, Arg, ValueHint};
  |            ^^^^^^^^^^^^^ no `crate_version` in the root

error: cannot determine resolution for the macro `crate_version`
 --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:8:18
  |
8 |         .version(crate_version!())
  |                  ^^^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:16:18
   |
12 | /             Arg::new("verbose")
13 | |                 .short('v')
14 | |                 .long("verbose")
15 | |                 .global(true)
16 | |                 .about("Prints informations verbosely"),
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:28:18
   |
26 | /             Arg::new("generator")
27 | |                 .long("generate")
28 | |                 .about("Generate completion scripts for a given type of shell")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:33:18
   |
32 | /             Arg::new("daemon")
33 | |                 .about("Starts the daemon")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:39:18
   |
38 | /             Arg::new("no-fork")
39 | |                 .about("Don't fork the daemon")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:44:18
   |
43 | /             Arg::new("kill-daemon")
44 | |                 .about("Kill the daemon. If used together with -d, the daemon will get restarted")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:50:18
   |
49 | /             Arg::new("quiet")
50 | |                 .about("Don't print extra output")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:58:18
   |
56 | /             Arg::new("device")
57 | |                 .global(true)
58 | |                 .about("Specify the device to use")
   | |                 -^^^^^ method not found in `Arg<'_>`
   | |_________________|
   | 

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/cli.rs:91:26
   |
90 | /                     Arg::new("opt")
91 | |                         .about("Provide additional input for some keys")
   | |                         -^^^^^ method not found in `Arg<'_>`
   | |_________________________|
   | 

error[E0277]: the trait bound `std::string::String: From<&mut std::io::Stdout>` is not satisfied
   --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/main.rs:156:19
    |
156 |     generate::<G, _>(app, app.get_name().to_string(), &mut std::io::stdout());
    |                   ^ the trait `From<&mut std::io::Stdout>` is not implemented for `std::string::String`
    |
    = help: the following other types implement trait `From<T>`:
              <std::string::String as From<char>>
              <std::string::String as From<Box<str>>>
              <std::string::String as From<Cow<'a, str>>>
              <std::string::String as From<TrackID>>
              <std::string::String as From<zbus::guid::Guid>>
              <std::string::String as From<zvariant::signature::Signature<'a>>>
              <std::string::String as From<zvariant::str::Str<'a>>>
              <std::string::String as From<&zvariant::signature::Signature<'a>>>
            and 3 others
    = note: required for `&mut std::io::Stdout` to implement `Into<std::string::String>`
note: required by a bound in `clap_generate::generate`
   --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_generate-3.0.3/src/lib.rs:41:8
    |
38  | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        -------- required by a bound in this function
...
41  |     S: Into<String>,
    |        ^^^^^^^^^^^^ required by this bound in `generate`

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/main.rs:156:5
    |
156 |     generate::<G, _>(app, app.get_name().to_string(), &mut std::io::stdout());
    |     ^^^^^^^^^^^^^^^^ --- an argument of type `G` is missing
    |
note: expected `&mut dyn Write`, found `String`
   --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/earbuds-0.1.9/src/main.rs:156:27
    |
156 |     generate::<G, _>(app, app.get_name().to_string(), &mut std::io::stdout());
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: expected mutable reference `&mut dyn std::io::Write`
                          found struct `std::string::String`
note: function defined here
   --> /home/plex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_generate-3.0.3/src/lib.rs:38:8
    |
38  | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^
help: provide the argument
    |
156 |     generate::<G, _>(/* G */, app, &mut std::io::stdout(), /* &mut dyn std::io::Write */);
    |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some errors have detailed explanations: E0061, E0277, E0432, E0599.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `earbuds` (bin "earbuds") due to 12 previous errors
error: failed to compile `earbuds v0.1.9`, intermediate artifacts can be found at `/tmp/cargo-installaOaAAJ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update rust crate serde to 1.0.200
  • fix(deps): update rust crate pretty_env_logger to 0.5.0
  • chore(deps): update actions/checkout action to v4
  • fix(deps): update rust crate human-panic to v2
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • clap 3.2.8
  • clap_complete 3.2.5
  • async-std 1.12.0
  • bluetooth-serial-port-async 0.6.3
  • blurz 0.4.0
  • ofiles 0.2.0
  • serde 1.0.139
  • serde_json 1.0.82
  • notify-rust 4.5.8
  • toml 0.5.9
  • mpris 2.0.0-rc2
  • nix 0.24.1
  • rust-pulsectl-fork 0.2.12
  • human-panic 1.0.3
  • log 0.4.17
  • pretty_env_logger 0.4.0
github-actions
.github/workflows/rust.yml
  • actions/checkout v2
  • actions/checkout v2

  • Check this box to trigger a request for Renovate to run again on this repository

Support for Ubuntu/Debian distros

Hello,

Great project you have here, i'm just curious to know if it's possible to implement this on linux mint (without building manually from source) or if you will eventually provide support for other distros...

Do you plan on providing this through apt/yum/.deb ?
Thank you,

error[E0308]: mismatched types

Compiling earbuds using cargo errors out when running cargo install earbuds.

Compiling errors on compiling rust-pulsectl v0.2.6.

Using Ubuntu 20.10 to compile.

I have attached two files containing the error output from cargo install earbuds and cargo install earbuds --verbose.

standard output.txt
verbose output.txt

Not to sure what information you require.

Fish shell completions not working

Starting to type earbuds gives this error with fish:

/usr/share/fish/vendor_completions.d/earbuds.fish (line 12): Unexpected ')' found, expecting '}'
            earbuds)
                   ^
from sourcing file /usr/share/fish/vendor_completions.d/earbuds.fish
in command substitution
source: Error while reading file “/usr/share/fish/vendor_completions.d/earbuds.fish”

Running up-to-date Arch Linux.

Awesome work btw! can't wait to get my polybar setup with this 👍

Build error on Fedora 36

Installed all dependencies and tried cargo install earbuds:

error[E0432]: unresolved import `clap::crate_version`
 --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:1:12
  |
1 | use clap::{crate_version, App, AppSettings, Arg, ValueHint};
  |            ^^^^^^^^^^^^^ no `crate_version` in the root

error: cannot determine resolution for the macro `crate_version`
 --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:8:18
  |
8 |         .version(crate_version!())
  |                  ^^^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:16:18
   |
16 |                 .about("Prints informations verbosely"),
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:28:18
   |
28 |                 .about("Generate completion scripts for a given type of shell")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:33:18
   |
33 |                 .about("Starts the daemon")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:39:18
   |
39 |                 .about("Don't fork the daemon")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:44:18
   |
44 |                 .about("Kill the daemon. If used together with -d, the daemon will get restarted")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:50:18
   |
50 |                 .about("Don't print extra output")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:58:18
   |
58 |                 .about("Specify the device to use")
   |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
  --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/cli.rs:91:26
   |
91 |                         .about("Provide additional input for some keys")
   |                          ^^^^^ method not found in `Arg<'_>`

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/earbuds-0.1.9/src/main.rs:156:5
    |
156 |     generate::<G, _>(app, app.get_name().to_string(), &mut std::io::stdout());
    |     ^^^^^^^^^^^^^^^^ ---  --------------------------  ---------------------- supplied 3 arguments
    |     |
    |     expected 4 arguments
    |
note: function defined here
   --> /home/amitkul2/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.3/src/lib.rs:38:8
    |
38  | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

Some errors have detailed explanations: E0061, E0432, E0599.
For more information about an error, try `rustc --explain E0061`.
error: failed to compile `earbuds v0.1.9`, intermediate artifacts can be found at `/tmp/cargo-installuE2qEq`

Caused by:
  could not compile `earbuds` due to 11 previous errors

Failed to compile on Fedora32

cargo-1.48.0-1.fc32.x86_64
rust-1.48.0-1.fc32.x86_64
$ cargo install earbuds
    Updating crates.io index
  Downloaded earbuds v0.1.7
  Downloaded 1 crate (50.9 KB) in 0.72s
  Installing earbuds v0.1.7
  Downloaded async-attributes v1.1.1
  Downloaded addr2line v0.14.0
  Downloaded iovec v0.1.4
  Downloaded indexmap v1.6.1
  Downloaded num-derive v0.3.3
  Downloaded polling v2.0.2
  Downloaded parking v2.0.0
  Downloaded pkg-config v0.3.19
  Downloaded pin-project-lite v0.2.0
  Downloaded pin-utils v0.1.0
  Downloaded clap_derive v3.0.0-beta.2
  Downloaded num_cpus v1.13.0
  Downloaded object v0.22.0
  Downloaded slab v0.4.2
  Downloaded synstructure v0.12.4
  Downloaded nix v0.17.0
  Downloaded unicode-xid v0.2.1
  Downloaded derive_is_enum_variant v0.1.1
  Downloaded mpris v2.0.0-rc2
  Downloaded termcolor v1.1.2
  Downloaded unicode-width v0.1.8
  Downloaded toml v0.5.8
  Downloaded async-executor v1.4.0
  Downloaded async-mutex v1.4.0
  Downloaded autocfg v1.0.1
  Downloaded unicode-xid v0.1.0
  Downloaded failure_derive v0.1.8
  Downloaded proc-macro2 v0.3.8
  Downloaded heck v0.3.2
  Downloaded async-task v4.0.3
  Downloaded backtrace v0.3.55
  Downloaded lazy_static v1.4.0
  Downloaded futures-lite v1.11.3
  Downloaded num-traits v0.1.43
  Downloaded async-global-executor v1.4.3
  Downloaded bluetooth-serial-port-async v0.6.1
  Downloaded log v0.4.11
  Downloaded net2 v0.2.37
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded version_check v0.9.2
  Downloaded textwrap v0.12.1
  Downloaded adler v0.2.3
  Downloaded waker-fn v1.1.0
  Downloaded libpulse-sys v1.16.2
  Downloaded atty v0.2.14
  Downloaded atomic-waker v1.0.0
  Downloaded cfg-if v0.1.10
  Downloaded async-io v1.3.1
  Downloaded blurz v0.4.0
  Downloaded cfg-if v1.0.0
  Downloaded cache-padded v1.1.1
  Downloaded blocking v1.0.2
  Downloaded miniz_oxide v0.4.3
  Downloaded vec-arena v1.0.0
  Downloaded concurrent-queue v1.2.2
  Downloaded crossbeam-utils v0.8.1
  Downloaded error-chain v0.11.0
  Downloaded fastrand v1.4.0
  Downloaded error-chain v0.12.4
  Downloaded glob v0.3.0
  Downloaded itoa v0.4.6
  Downloaded kv-log-macro v1.0.7
  Downloaded futures-io v0.3.8
  Downloaded rustc-demangle v0.1.18
  Downloaded quote v0.5.2
  Downloaded clap_generate v3.0.0-beta.2
  Downloaded libdbus-sys v0.2.1
  Downloaded hex v0.3.2
  Downloaded once_cell v1.5.2
  Downloaded proc-macro-error v1.0.4
  Downloaded serde v1.0.118
  Downloaded serde_json v1.0.60
  Downloaded syn v0.11.11
  Downloaded failure v0.1.8
  Downloaded darling_core v0.5.0
  Downloaded quote v0.3.15
  Downloaded from_variants v0.4.0
  Downloaded unicode-xid v0.0.4
  Downloaded ident_case v1.0.1
  Downloaded ryu v1.0.5
  Downloaded proc-macro2 v1.0.24
  Downloaded quote v1.0.8
  Downloaded galaxy_buds_live_rs v0.1.6
  Downloaded proc-macro2 v0.2.3
  Downloaded strsim v0.10.0
  Downloaded enum-kinds v0.4.1
  Downloaded async-channel v1.5.1
  Downloaded ofiles v0.2.0
  Downloaded nb-connect v1.0.2
  Downloaded enum_primitive v0.1.1
  Downloaded event-listener v2.5.1
  Downloaded memchr v2.3.4
  Downloaded quote v0.4.2
  Downloaded void v1.0.2
  Downloaded futures-core v0.3.8
  Downloaded num-traits v0.2.14
  Downloaded notify-rust v4.0.0
  Downloaded os_str_bytes v2.4.0
  Downloaded unicode-segmentation v1.7.1
  Downloaded synom v0.11.3
  Downloaded serde_derive v1.0.118
  Downloaded darling v0.5.0
  Downloaded rust-pulsectl v0.2.6
  Downloaded darling_macro v0.5.0
  Downloaded bitflags v1.2.1
  Downloaded vec_map v0.8.2
  Downloaded hashbrown v0.9.1
  Downloaded mio v0.6.23
  Downloaded from_variants_impl v0.4.0
  Downloaded dbus v0.8.4
  Downloaded dbus v0.6.5
  Downloaded libpulse-binding v2.21.0
  Downloaded async-std v1.8.0
  Downloaded clap v3.0.0-beta.2
  Downloaded syn v0.13.11
  Downloaded syn v1.0.55
  Downloaded syn v0.12.15
  Downloaded nix v0.13.1
  Downloaded nix v0.19.1
  Downloaded libc v0.2.81
  Downloaded gimli v0.23.0
  Downloaded 121 crates (5.8 MB) in 3.91s
   Compiling libc v0.2.81
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.55
   Compiling cfg-if v0.1.10
   Compiling version_check v0.9.2
   Compiling pkg-config v0.3.19
   Compiling unicode-xid v0.1.0
   Compiling bitflags v1.2.1
   Compiling log v0.4.11
   Compiling memchr v2.3.4
   Compiling cache-padded v1.1.1
   Compiling futures-core v0.3.8
   Compiling waker-fn v1.1.0
   Compiling pin-project-lite v0.2.0
   Compiling fastrand v1.4.0
   Compiling parking v2.0.0
   Compiling cfg-if v1.0.0
   Compiling futures-io v0.3.8
   Compiling once_cell v1.5.2
   Compiling async-task v4.0.3
   Compiling event-listener v2.5.1
   Compiling lazy_static v1.4.0
   Compiling ident_case v1.0.1
   Compiling unicode-segmentation v1.7.1
   Compiling vec-arena v1.0.0
   Compiling void v1.0.2
   Compiling adler v0.2.3
   Compiling gimli v0.23.0
   Compiling slab v0.4.2
   Compiling nix v0.13.1
   Compiling failure_derive v0.1.8
   Compiling serde v1.0.118
   Compiling atomic-waker v1.0.0
   Compiling unicode-xid v0.0.4
   Compiling rustc-demangle v0.1.18
   Compiling error-chain v0.11.0
   Compiling ryu v1.0.5
   Compiling hashbrown v0.9.1
   Compiling object v0.22.0
   Compiling unicode-width v0.1.8
   Compiling quote v0.3.15
   Compiling pin-utils v0.1.0
   Compiling nix v0.17.0
   Compiling serde_json v1.0.60
   Compiling serde_derive v1.0.118
   Compiling os_str_bytes v2.4.0
   Compiling vec_map v0.8.2
   Compiling strsim v0.10.0
   Compiling termcolor v1.1.2
   Compiling itoa v0.4.6
   Compiling glob v0.3.0
   Compiling hex v0.3.2
   Compiling proc-macro2 v0.3.8
   Compiling proc-macro2 v0.2.3
   Compiling concurrent-queue v1.2.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling error-chain v0.12.4
   Compiling num-traits v0.2.14
   Compiling crossbeam-utils v0.8.1
   Compiling miniz_oxide v0.4.3
   Compiling indexmap v1.6.1
   Compiling async-mutex v1.4.0
   Compiling libdbus-sys v0.2.1
   Compiling libpulse-sys v1.16.2
   Compiling synom v0.11.3
   Compiling heck v0.3.2
   Compiling textwrap v0.12.1
   Compiling quote v0.5.2
   Compiling quote v0.4.2
   Compiling async-channel v1.5.1
error: failed to run custom build command for `libdbus-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/tmp/cargo-install8lyLwQ/release/build/libdbus-sys-ad0b11745ec19ce1/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=DBUS_1_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=DBUS_1_STATIC
  cargo:rerun-if-env-changed=DBUS_1_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"dbus-1\" \"dbus-1 >= 1.6\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nPackage \'dbus-1\', required by \'virtual:world\', not found\nPackage \'dbus-1\', required by \'virtual:world\', not found\n" } }', /home/makopec/.cargo/registry/src/github.com-1ecc6299db9ec823/libdbus-sys-0.2.1/build.rs:6:70
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `earbuds v0.1.7`, intermediate artifacts can be found at `/tmp/cargo-install8lyLwQ`

Caused by:
  build failed

Support of Galaxy Buds Pro?

I've build earbuds from current master and used it connect command to connect to my Galaxy Buds Pro, it connected and I can play music, but earbuds status returns "No connected device found"

Here is the verbose log.

earbuds -k -d --no-fork Connected successfully to Buds live! thread 'async-std/runtime' panicked at 'not implemented', /home/marcin/.cargo/registry/src/github.com-1ecc6299db9ec823/galaxy_buds_rs-0.2.9/src/message/extended_status_updated.rs:107:14 note: run with RUST_BACKTRACE=1environment variable to display a backtrace device "/org/bluez/hci0/dev_64_03_7F_85_78_76" device "/org/bluez/hci0/dev_64_03_7F_85_78_76"

Case Battery Level

It's not really that your app lacks any features you have done an amazing job and for me at least it doesn't have any bugs, The only thing I miss is the ability to see the battery level of the case too

[REQ] Support for Galaxy Buds 2 Pro

currently I can't detect galaxy buds 2 pro with earbuds cli

➜  ~ bluetoothctl info
Device A0:AC:69:38:DA:C1 (public)
	Name: George's Buds2 Pro
	Alias: George's Buds2 Pro
	Class: 0x00240404
	Icon: audio-headset
	Paired: yes
	Bonded: yes
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: Vendor specific           (2e73a4ad-332d-41fc-90e2-16bef06523f2)
	UUID: Vendor specific           (a23d00bc-217c-123b-9c00-fc44577136ee)
	UUID: Vendor specific           (b4a9d6a0-b2e3-4e40-976d-a69f167ea895)
	UUID: Vendor specific           (e7ab2241-ca64-4a69-ac02-05f5c6fe2d62)
	UUID: Vendor specific           (f8620674-a1ed-41ab-a8b9-de9ad655729d)
	Modalias: bluetooth:v0075pA013d0001
➜  ~ earbuds status
No connected device found
➜  ~ earbuds --version
earbuds 0.1.9

Polybar script doesn't work

Hello!

I have installed the Polybar on my Ubuntu 20.04.
The polybar.sh script not work.
At the first time say: /bin/sh: 1: /home/glsmith/.config/polybar/scripts/polybar.sh: Permission denied
chmod +x solve this problem.

Second time start problem:
/home/glsmith/.config/polybar/scripts/polybar.sh: 5: [: error: unexpected operator

I can't solve this issue.

Question

I can use this cli on ubuntu ?

Keep getting the same error when compiling with Cargo using Ubuntu

error[E0308]: mismatched types
--> src/main.rs:166:19
|
166 | generate(gen, cmd, cmd.get_name().to_string(), &mut std::io::stdout());
| ^^^ expected struct clap::builder::command::App, found struct clap::Command
|
= note: expected mutable reference &mut clap::builder::command::App<'_>
found mutable reference `&mut clap::Command

Properly Implement support for Buds+

Some values seem to be parsed wrongly for the Buds+.

Wrongly parsed values:

  • Temparature (MsgDebugGetAllData)
  • Touchpad options (MsgExtendedStatusUpdate)
  • Ambient mode

Cargo install fails to compile using master branch

After installing the required dependencies, cargo install earbuds fails to compile on both Fedora 36 (Workstation/Silverblue) and an updated Arch Linux, apparrently due to an outdated clap version.

Using a different branch e.g. cargo install --git https://github.com/JojiiOfficial/LiveBudsCli --branch renovate/clap_complete-3.x solves the problem, so we could add it to the install instructions or the master branch could be updated with wathever change fixed the issue.

Seems like #90 is ready to be merged and fix it.

Add auto sink switch

Add feature to automatically switch the default pulse audio sink to the earbuds sink when wearing them.

  • Rust feature
  • Configurable per device in config

libdbus-sys build error on Ubuntu 20.04

System Details
OS: Ubuntu 20.04
Cargo: 1.5.0

Steps to reproduce

  1. Clone repository
  2. Run cargo build --release

Expected result - Build is successful

Actual result

8:30 $ cargo build --release
    Updating git repository `https://github.com/JojiiOfficial/GalaxyBuds-rs`
  Downloaded zvariant_derive v2.5.0
  Downloaded zvariant v2.5.0
  Downloaded socket2 v0.3.19
  Downloaded libc v0.2.88
  Downloaded version_check v0.9.2
  Downloaded polling v2.0.2
  Downloaded human-panic v1.0.3
  Downloaded serde v1.0.123
  Downloaded serde_derive v1.0.123
  Downloaded nb-connect v1.0.3
  Downloaded byteorder v1.4.2
  Downloaded ctor v0.1.19
  Downloaded regex-syntax v0.6.22
  Downloaded regex v1.4.3
  Downloaded syn v1.0.61
  Downloaded os_type v2.2.0
  Downloaded uuid v0.8.2
  Downloaded vec-arena v1.0.0
  Downloaded nix v0.20.0
  Downloaded getrandom v0.2.2
  Downloaded 20 crates (1.9 MB) in 1.46s
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.61
   Compiling libc v0.2.88
   Compiling autocfg v1.0.1
   Compiling cfg-if v1.0.0
   Compiling memchr v2.3.4
   Compiling serde_derive v1.0.123
   Compiling serde v1.0.123
   Compiling futures-core v0.3.13
   Compiling bitflags v1.2.1
   Compiling value-bag v1.0.0-alpha.6
   Compiling unicode-xid v0.1.0
   Compiling log v0.4.14
   Compiling futures-io v0.3.13
   Compiling once_cell v1.7.2
   Compiling pin-project-lite v0.2.6
   Compiling version_check v0.9.2
   Compiling cfg-if v0.1.10
   Compiling pkg-config v0.3.19
   Compiling cache-padded v1.1.1
   Compiling waker-fn v1.1.0
   Compiling parking v2.0.0
   Compiling fastrand v1.4.0
   Compiling slab v0.4.2
   Compiling pin-utils v0.1.0
   Compiling event-listener v2.5.1
   Compiling proc-macro-hack v0.5.19
   Compiling vec-arena v1.0.0
   Compiling proc-macro-nested v0.1.7
   Compiling async-task v4.0.3
   Compiling futures-sink v0.3.13
   Compiling unicode-segmentation v1.7.1
   Compiling ident_case v1.0.1
   Compiling lazy_static v1.4.0
   Compiling gimli v0.23.0
   Compiling futures-task v0.3.13
   Compiling adler v1.0.2
   Compiling atomic-waker v1.0.0
   Compiling nix v0.17.0
   Compiling failure_derive v0.1.8
   Compiling unicode-xid v0.0.4
   Compiling object v0.23.0
   Compiling getrandom v0.2.2
   Compiling rustc-demangle v0.1.18
   Compiling void v1.0.2
   Compiling ryu v1.0.5
   Compiling byteorder v1.4.2
   Compiling error-chain v0.11.0
   Compiling unicode-width v0.1.8
   Compiling regex-syntax v0.6.22
   Compiling hashbrown v0.9.1
   Compiling quote v0.3.15
   Compiling termcolor v1.1.2
   Compiling os_str_bytes v2.4.0
   Compiling scoped-tls v1.0.0
   Compiling vec_map v0.8.2
   Compiling strsim v0.10.0
   Compiling serde_json v1.0.64
   Compiling hex v0.3.2
   Compiling itoa v0.4.7
   Compiling glob v0.3.0
   Compiling proc-macro2 v0.3.8
   Compiling proc-macro2 v0.2.3
   Compiling num-traits v0.2.14
   Compiling miniz_oxide v0.4.4
   Compiling crossbeam-utils v0.8.3
   Compiling indexmap v1.6.2
   Compiling thread_local v1.1.3
   Compiling concurrent-queue v1.2.2
   Compiling async-mutex v1.4.0
   Compiling async-lock v2.3.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling error-chain v0.12.4
   Compiling futures-channel v0.3.13
   Compiling libdbus-sys v0.2.1
   Compiling libpulse-sys v1.18.0
   Compiling heck v0.3.2
   Compiling synom v0.11.3
   Compiling textwrap v0.12.1
   Compiling quote v0.4.2
   Compiling quote v0.5.2
   Compiling addr2line v0.14.1
   Compiling async-channel v1.6.1
error: failed to run custom build command for `libdbus-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/home/adishwar/tools/LiveBudsCli/target/release/build/libdbus-sys-2c0b0f5f504dfca1/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=DBUS_1_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=DBUS_1_STATIC
  cargo:rerun-if-env-changed=DBUS_1_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"dbus-1\" \"dbus-1 >= 1.6\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\nPackage dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\n" } }', /home/adishwar/.cargo/registry/src/github.com-1ecc6299db9ec823/libdbus-sys-0.2.1/build.rs:6:70
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Additional Info
I originally thought that I may not have dbus installed. However checking apt this is the output I get

18:34 $ sudo apt install dbus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dbus is already the newest version (1.12.16-2ubuntu2.1).
0 to upgrade, 0 to newly install, 0 to remove and 7 not to upgrade.

Missing features // TODO

  • Find my buds
  • Force firmware reboot
  • Buds original support
  • Actually check for daemon to be ready
  • Custom touchpad actions
  • Relieve pressure (Buds live)
  • Factory reset
  • Allow disconnect tap-action if touchpad is blocked

Digital artifacts on audio when daemon is running - Galaxy Buds Live

Hi! Thank you for this fantastic project.
However while running the daemon I notice a lot of artifacts on audio. (every 4-5 seconds)
Initially I was thinking of a bluetooth problem but I noticed that by blocking the daemon everything goes back to normal...
Everything seems to be recognized correctly by observing the output of the command "earbuds status -v":

$ earbuds status -v
Info for 'Galaxy Buds Live (452C)':

Type:		BudsLive
Battery:	L: 91%, R: 77%
Equalizer:	Normal
ANC:		Enabled
Touchpads:	Enabled
Left option:	NoiseCanceling
Right option:	VoiceCommand
Temp. left:	36.9°C
Temp. right:	36.7°C
Current left:	70.0mA
Current right:	61.0mA
Volt left:	4.02V
Volt right:	3.89V

Build error on KUbuntu 21.04 (error: could not compile `clap`)

I installed dependencies (libdbus-dev and cargo), when trying to build with cargo install earbuds, I get:

   Compiling async-global-executor v2.0.2
   Compiling libpulse-binding v2.25.0
   Compiling async-std v1.10.0
   Compiling clap v3.0.0-beta.4
error[E0658]: arbitrary expressions in key-value attributes are unstable
 --> /home/ppawel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10
  |
8 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

error[E0658]: use of unstable library feature 'osstring_ascii'
   --> /home/ppawel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19
    |
130 |                 v.eq_ignore_ascii_case(val)
    |                   ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #70516 <https://github.com/rust-lang/rust/issues/70516> for more information

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `clap`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `earbuds v0.1.9`, intermediate artifacts can be found at `/tmp/cargo-installNS1fmy`

Caused by:
  build failed

If I build from local source with cargo build, it works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.