Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
A
attic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
hydrargyrum
attic
Commits
5b0126b4
Commit
5b0126b4
authored
Oct 08, 2020
by
hydrargyrum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
headset-bluez: enable a bluetooth headset and out or in/out mode
parent
3a669054
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
headset-bluez/headset-bluez
headset-bluez/headset-bluez
+39
-0
No files found.
headset-bluez/headset-bluez
0 → 100755
View file @
5b0126b4
#!/bin/sh -e
# license: Do What The Fuck You Want To Public License version 2 [http://www.wtfpl.net/]
# Enable a bluetooth headset and out or in/out mode.
find_bluez
()
{
pactl list short
"
$1
"
|
grep
bluez |
grep
-v
monitor |
awk
'{print $2}'
}
card
=
$(
find_bluez cards
)
if
[
"
$1
"
=
inout
]
then
pactl set-card-profile
"
$card
"
headset_head_unit
sink
=
$(
find_bluez sinks
)
pactl set-default-sink
"
$sink
"
pactl set-sink-mute
"
$sink
"
0
src
=
$(
find_bluez sources
)
pactl set-default-source
"
$src
"
pactl set-source-mute
"
$src
"
0
elif
[
"
$1
"
=
out
]
then
pactl set-card-profile
"
$card
"
a2dp_sink
sink
=
$(
find_bluez sinks
)
pactl set-default-sink
"
$sink
"
pactl set-sink-mute
"
$sink
"
0
else
cat
<<-
EOF
usage:
$0
{out | inout}
Enable a bluetooth headset and set either:
- in/out mode: mono audio output + microphone (HSP/HFP)
- out mode: high-quality output, no microphone (A2DP)
EOF
exit
64
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment