headset-bt
Описание
The utility to quickly switch bluetooth headset between A2DP (high-quality playback, no microphone) and HFP (low-quality sound, microphone enabled)
Языки
- Python100%
headset-bt
РУССКАЯ ДОКУМЕНТАЦИЯ НИЖЕ / THE RUSSIAN TEXT FOLLOWS
This utility allows quick switching Bluetooth™ headsets between A2DP (high-quality playback, no microphone) and HFP (low-quality sound, microphone enabled) modes.
Usage
usage: headset-bt [-h] [-d] [-l] [-c] [-x] [--version] [mode]
Switch the mode of a Bluetooth device
positional arguments:
mode Switch the card to the specified mode; if omitted, switch to the next mode in round-robin order
options:
-h, --help show this help message and exit
-d, --daemonize Start daemon with tray icon and exit
-l, --list List available modes
-c, --current Show current mode (may also be used with -l)
-x, --extended Show extended info (to use with -l and -c)
--version show program's version number and exit
Installation
The utility controls Bluetooth device using PulseAudio interface through the library. Please install it with the following command:
To run the daemon showing tray icons, the program requires and libraries. Please install them by running
The library will be downloaded and installed automatically as a dependency of .
After than, just copy the file to your disk and run it.
Credits
The utility was inspired by the “How to keep the audio profile at A2DP while using a mic with Bluetooth headset? (Push-to-talk)” article on AskUbuntu.com
The daemon uses icons from the Font Awesome icon pack by Dave Gandy
Release history
- 0.1 (September, 2024)
- initial release
- 0.2 (October, 2024)
changed to#!/usr/bin/pythonto use locally managed python environment#!/usr/bin/env pythonand-coptions added-x- the algorithm of selecting tray icon has changed; the «unknown» icon has removed
- the round-robin logic has changed
Программа для быстрого переключения Bluetooth™-наушников между режимами A2DP (качественное воспроизведение звука, микрофон отключен) и HFP (режим гарнитуры, низкое качество звука).
Использование
Запуск: headset-bt [-h] [-d] [-l] [-c] [-x] [--version] [mode]
Переключение режима Bluetooth-устройства
Позиционные аргументы:
mode Режим, в который следует переключить карту; если не задан, выбирается следующий режим по списку
Опции:
-h, --help показать справку
-d, --daemonize запустить фоновый процесс, показывающий индикатор текущего режима в трее
-l, --list показать список доступных режимов
-c, --current показать текущий режим (можно использовать вместе с -l)
-x, --extended показывать расширенную информацию о режиме (использовать с -l и -c)
--version показать версию программы
Установка
Для управления Bluetooth-устройствами используется интерфейс PulseAudio при помощи библиотеки library. Чтобы установить эту библиотеку, используйте команду:
Для показа статуса в трее требуются библиотеки и . Установите их:
Библиотека будет установлена автоматически, т. к. её использует и зависит от неё.
Затем просто скопируйте файл и запустите его.
Благодарности
Идея написания программы навеяна топиком «How to keep the audio profile at A2DP while using a mic with Bluetooth headset? (Push-to-talk)» на сайте AskUbuntu.com
Использованы иконки из набора Font Awesome; автор — Dave Gandy
История выпусков
-
0.1 (сентябрь 2024)
- первая версия
-
0.2 (October, 2024)
-
шебанг
заменен на#!/usr/bin/pythonдля использования локальной среды python#!/usr/bin/env python -
добавлены опции
и-c-x -
изменён алгоритм выбора иконки в трее; иконка «неизвестный режим» удалена
-
изменён алгоритм перебора режимов
-