Code Monkey home page Code Monkey logo

bt-dualboot's People

Contributors

j3rn avatar x2es 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

bt-dualboot's Issues

Revert registry changes

I've run the program to sync one device (with the backup flag enabled) between Fedora Linux and Windows 11, but now Bluetooth isn't working at all on my Windows installation. None of the Bluetooth devices I've tried to connect to have been able to connect.

I have since "forgotten" the device through Windows settings, removed it through bluetoothctl on Linux and factory reset the Bluetooth device itself, but still cannot connect to it nor any other Bluetooth device.

Is there some way I can restore my registry using the generated backup or revert the changes done?

Feature Requests

If you'd like to see new feature, here is best place to ask for it.

Doesn't work when the same device connected to multiple bt-adapters.

          I'm using Fedora Silverblue 37 and Windows 10 (I'll update the version shortly).  I was ultimately unsuccessful with using the script.  First, the script crashed because evidently the `info` file for my Logitech MX Master 3S does not contain the `LinkKey` key.  Not sure what this means, but I removed it as a bluetooth device and was able to proceed.

The issue that ultimately prevented me from was this:

WARNING: Following devices paired on Windows for multiple BT-adapters: <headphone mac>

I do have two bluetooth adapters in my desktop; one is built-in to the motherboard and scarcely works, the other is an external one that I use. Indeed, my headphones have been, at different times, connected to each. I tried just about everything, but could not figure out how to get this error to go away. I wound up extracting the key by hand.

Originally posted by @J3RN in #1 (comment)

Restore the Windows registry backup?

Hi, sorry if this is a noob question, I'm not very familiar with Windows. I've got bt-dualboot ver 1.0.1 and I synced the keys from Linux to Windows partition with the backup option enabled. Now I'm pretty sure I needed to do it the other way around (keys from Win to Linux). How do I use the created Windows reg backup?

Config parser error: no LinkKey section

Listing devices gives me the following error

Traceback (most recent call last):
  File "/usr/bin/bt-dualboot", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 342, in main
    app.run()
  File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 252, in run
    self.list_devices()
  File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 173, in list_devices
    devices=sync_manager.devices_both_synced(),
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 111, in devices_both_synced
    index = self._index_devices()
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 61, in _index_devices
    linux_devices   = get_linux_devices()
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in get_devices
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in <listcomp>
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 55, in bluetooth_device_factory
    info = extract_info(device_info_path)
  File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 39, in extract_info
    "pairing_key":  config.get("LinkKey", "Key"),
  File "/usr/lib/python3.10/configparser.py", line 782, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.10/configparser.py", line 1153, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'LinkKey'

The command I used

sudo bt-dualboot -l

And reinstalling seems not working.

bt-dualboot: 1.0.1
Python: 3.10.7
OS: Arch Linux with kernel 5.19.11-arch1-1

Multiple BT-adapter fstring broken

When a device is paired for multiple BT-adapters, the warning produced seems to have a broken fstring.

$ sudo bt-dualboot --sync-all -b ~/Dropbox/
> BACKUP /media/yee/<device MAC>/Windows/System32/config/SYSTEM to /home/yee/Dropbox/SYSTEM-2023-12-03--14-35-20
WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)}
WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)}
Nothing to sync

Version information:

$ sudo bt-dualboot --version
bt-dualboot 1.0.1
$ python --version
Python 3.10.12

No LinkKey

$ sudo ./bt-dualboot --sync-all --no-backup --dry-run
Traceback (most recent call last):
  File "/home/shared/conda/bin/./bt-dualboot", line 8, in <module>
    sys.exit(main())
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/cli/app.py", line 342, in main
    app.run()
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/cli/app.py", line 262, in run
    self.sync_all()
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/cli/app.py", line 228, in sync_all
    devices_for_push = sync_manager.devices_needs_sync()
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 129, in devices_needs_sync
    index = self._index_devices()
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 61, in _index_devices
    linux_devices   = get_linux_devices()
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in get_devices
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in <listcomp>
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 55, in bluetooth_device_factory
    info = extract_info(device_info_path)
  File "/home/shared/conda/lib/python3.9/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 39, in extract_info
    "pairing_key":  config.get("LinkKey", "Key"),
  File "/home/shared/conda/lib/python3.9/configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "/home/shared/conda/lib/python3.9/configparser.py", line 1152, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'LinkKey'

How did this happen?

typo in readme

$ bt-dualboot --lsit-win-mounts

Windows locations:

/media/user/win_foo
/media/user/win_bar

lsit should be list

ERROR: None Windows locations found, use `--win MOUNT` to point actual Windows location

Installation step

Tool could not be installed from sudo pip install because of below error

Error message
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

So installed from AUR with
❯ yay -S bt-dualboot

Commands outputs

❯ sudo bt-dualboot -l
ERROR: None Windows locations found, use `--win MOUNT` to point actual Windows location

❯ sudo bt-dualboot --list-win-mounts 
ERROR: None Windows locations found, use `--win MOUNT` to point actual Windows location

OS

Window 10 Home
EndeavourOS

How do I get the path to pass for --win parameter?

Syncsing devices with same name

If both device has the same name, but different MAC, tool able to detect and sync only one of them, even by supplying mac address of second device by:

sudo bt-dualboot --sync A0:AB:51:92:52:59 --backup
> BACKUP /run/media/calcifer/D49EB9E49EB9BF74/Windows/System32/config/SYSTEM to /var/backup/bt-dualboot/SYSTEM-2022-09-21--14-13-18
WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)}
WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)}
ERROR: Can't push A0:AB:51:92:52:59! Not found or already in sync!
Nothing changed.

Unfortunately name of devices is unchangeable (two DualSence controllers, if it matters).
Report from list option (missing second controller with MAC A0:AB:51:92:52:59):

sudo bt-dualboot -l
WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)}
WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)}

Works both in Linux and Windows
===============================
 [D8:37:3B:47:B2:29] JBL Flip 5
 [48:18:8D:55:25:1A] Wireless Controller

Needs sync
==========

Following devices available for sync with `--sync-all` or `--sync MAC` options.

 [DC:2C:26:DC:00:16] None

Python issues (Pop 21.10)

Hello,

thanks for your hard work. This is the first attempt. Here's the output:

otheos@kepler:~$ sudo bt-dualboot --list-win-mounts

Windows locations:
==================
 /mnt

Then,

otheos@kepler:~$ sudo bt-dualboot --win /mnt -l
Traceback (most recent call last):
  File "/usr/lib/python3.9/configparser.py", line 789, in get
    value = d[option]
  File "/usr/lib/python3.9/collections/__init__.py", line 941, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/lib/python3.9/collections/__init__.py", line 933, in __missing__
    raise KeyError(key)
KeyError: 'class'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/bt-dualboot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 342, in main
    app.run()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 252, in run
    self.list_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 173, in list_devices
    devices=sync_manager.devices_both_synced(),
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 111, in devices_both_synced
    index = self._index_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 61, in _index_devices
    linux_devices   = get_linux_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/devices.py", line 40, in get_devices
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/devices.py", line 40, in <listcomp>
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 55, in bluetooth_device_factory
    info = extract_info(device_info_path)
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 38, in extract_info
    "class":        config.get("General", "Class"),
  File "/usr/lib/python3.9/configparser.py", line 792, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'class' in section: 'General'

Thanks.

Lowcase system file

In windows the file "system" was with lower case letters and because of that the program was not working, I renamed it and it worked

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.