Last active
May 14, 2025 08:35
-
-
Save tinywrkb/04e7fd644afa9b92d33a3a99ab07ee9e to your computer and use it in GitHub Desktop.
Revisions
-
tinywrkb revised this gist
Jan 27, 2021 . No changes.There are no files selected for viewing
-
tinywrkb revised this gist
Jan 12, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ # wait a second this is too fast for udev sleep 1 btdev="$(pactl list sinks|grep Name|grep 'bluez.*.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')" if [ -n "$btdev" ]; then echo "Found bluetooth device: $btdev" else -
tinywrkb revised this gist
Nov 17, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,6 @@ pactl set-sink-volume @DEFAULT_SINK@ 26% echo "Moving all sink inputs to the default sink..." for i in $(pactl list sink-inputs|grep 'Sink Input'|sed 's/Sink Input #//'); do echo "Moving sink input $i to the default sink..." pactl move-sink-input $i @DEFAULT_SINK@ done -
tinywrkb revised this gist
Nov 17, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # # /etc/udev/rules.d/pipewire-pulse-bt.rules # # phys: bt controller mac # name: bt device name -
tinywrkb revised this gist
Nov 17, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ # # /etc/udev/rules.d/pipewire-pulse-bt.rule # # phys: bt controller mac # name: bt device name SUBSYSTEM=="input",ATTRS{phys}=="0c:54:15:b5:cf:ec",ATTR{name}=="Bose SoundSport (AVRCP)",ACTION=="add",TAG+="systemd",ENV{SYSTEMD_USER_WANTS}+="pipewire-pulse-bt-switch.service" -
tinywrkb revised this gist
Nov 17, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # ~/.local/bin/btswitch # # wait a second this is too fast for udev sleep 1 btdev="$(pactl list sinks|grep Name|grep 'bluez5.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')" -
tinywrkb revised this gist
Nov 17, 2020 . 2 changed files with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ #!/bin/bash # # ~/.local/bin/btswitch # This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # # /etc/udev/rules.d/pipewire-pulse-bt.rule # SUBSYSTEM=="input",ATTRS{phys}=="0c:54:15:b5:cf:ec",ACTION=="add",TAG+="systemd",ENV{SYSTEMD_USER_WANTS}+="pipewire-pulse-bt-switch.service" -
tinywrkb created this gist
Nov 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/bin/bash # # ~/.local/bin/btswitch # # wait a second this is too fast for udev sleep 1 btdev="$(pactl list sinks|grep Name|grep 'bluez5.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')" if [ -n "$btdev" ]; then echo "Found bluetooth device: $btdev" else echo "Could not find bluetooth device, exiting..." exit 1 fi echo "Setting default sink to the found bluetooth device..." echo "Running pactl set-default-sink $btdev" pactl set-default-sink "$btdev" echo "Setting default volume of sink to 26%" pactl set-sink-volume @DEFAULT_SINK@ 26% echo "Moving all sink inputs to the default sink..." for i in $(pactl list sink-inputs|grep 'Sink Input'|sed 's/Sink Input #//'); do echo "Moving all sink input $i to the default sink..." pactl move-sink-input $i @DEFAULT_SINK@ done This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # # ~/.config/systemd/user/pipewire-pulse-bt-switch.service # [Unit] Description=Pipewire Pulse Server Auto Switch to Bluetooth [Service] ExecStart=%h/.local/bin/btswitch [Install] WantedBy=default.target This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ #/etc/udev/rules.d/ # /etc/udev/rules.d/pipewire-pulse-bt.rule # SUBSYSTEM=="input",ATTRS{phys}=="0c:54:15:b5:cf:ec",ACTION=="add",TAG+="systemd",ENV{SYSTEMD_USER_WANTS}+="pipewire-pulse-bt-switch.service"