いつの頃からか不明だが、いままで slackware64-current を起動時(起動後のログインコンソール)
で自動認識されていた Logicoolのbluetooth-Mouse が自動認識されなくなり、X起動後の
bluemanで接続処理しないと使えない状況になっていた。
根本的な原因と対策は未だ不明で調査中であるが、Archの「bluetooth-autoconnect」 スクリプトが
有効そうなので、とりあえずの暫定対策として導入した。(> Thanks Arch)
Step by Step INSTALL How2
Step-1. Install python-prctrl package
※ 忙しい人は、おそらく pip install python-prctrl でインストール可能と思われるが
自分はパッケージ管理したかったので、以下のスクリプトで Slackware64-current向け
パッケージを作成してインストールした。
1) pythom-prctrl.SlackBuild
#!/bin/sh # Slackware build script for python-prctl # Copyright 2021 JW(Shinichi Abe) <shin1.abe@nifty.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=python-prctl VERSION=${VERSION:-1.8.1} BUILD=${BUILD:-1} TAG=${TAG:-jw} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp/jw} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; python3 setup.py install --root=$PKG find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true #find $PKG/usr/man -type f -exec gzip -9 {} \; #for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ README docs $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} |
2) slack-desc
# HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| python-prctl: python-prctl () python-prctl: The linux prctl function allows you to control specific python-prctl: characteristics of a process' behaviour. Usage of the function is python-prctl: fairly messy though, due to limitations in C and linux. python-prctl: This module provides a nice non-messy python(ic) interface. python-prctl: python-prctl: https://pypi.org/project/python-prctl/ python-prctl: python-prctl: python-prctl: python-prctl: |
Step-2. Copy the python script "bluetooth-autoconnect" into /usr/bin/
[Code]
wget https://github.com/jrouleau/bluetooth-autoconnect/raw/master/bluetooth-autoconnect |
[Code]
# cp bluetooth-autoconnect /usr/bin/ # chmod a+x /usr/bin/bluetooth-autoconnect |
Step-3. Edit /etc/rc.d/rc.local and enable bluetooth-autostart at boot-up
Add following line to /etc/rc.d/rc.local
----------------------------------------------
# Enable bluetooth-autoconnect
/usr/bin/bluetooth-autoconnect
----------------------------------------------
----------------------------------------------
# Enable bluetooth-autoconnect
/usr/bin/bluetooth-autoconnect
----------------------------------------------
Step-4. Edit /etc/bluetooth/main.conf
[Code]
# AutoEnable defines option to enable all controllers when they are found. # This includes adapters present on start as well as adapters that are plugged # in later on. Defaults to 'false'. AutoEnable = true |