From 7086a78ec72c56b6479f3bfea4632c88b4be36e6 Mon Sep 17 00:00:00 2001 From: afify Date: Fri, 19 Jun 2020 09:34:44 +0300 Subject: [PATCH] gitconfig, cproj, xbps_base, bluetooth_connect --- .config/git/config | 6 +++++- .scripts/bluetooth_connect | 53 +++++++++++++++------------------------------- .scripts/create_c_proj.sh | 2 +- .scripts/xbps_base.txt | 3 +++ 4 files changed, 26 insertions(+), 38 deletions(-) diff --git a/.config/git/config b/.config/git/config index 71b4de7..52dc09c 100644 --- a/.config/git/config +++ b/.config/git/config @@ -107,7 +107,8 @@ l = log --all --pretty=format:"%C(#0080ff)%h\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" lc = log --pretty=format:"%C(#0080ff)%h\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" lgpg = log --all --pretty=format:"%C(#0080ff)%h\\ %C(#cd9a00)%G?\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" - ll = log --all --graph --pretty=format:"%C(#0080ff)%h\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" +# ll = log --all --graph --pretty=format:"%C(#0080ff)%h\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" + ll = log --all --graph --pretty=format:"%C(#0080ff)%h\\ %C(#cd9a00)<%an>\\ \\%C(#c0d6de)%s\\%C(#17b062)%d" lo = log --all --pretty=format:"%C(#cd9a00)%h\\%C(#0080ff)\\ <%an>\\ %C(#17b062)(%cr)%d\\ \\%C(#c0d6de)%s" ld = log --all --date=format:'%a %d %b' --pretty=format:"%C(#cd9a00)%h\\%C(#0080ff)\\ <%an>\\ %C(#17b062)(%cd)%d\\ \\%C(#c0d6de)%s" lg = log --all --graph --pretty=format:"%C(#cd9a00)%h\\%C(#0080ff)\\ <%an>\\ %C(#17b062)(%cr)%d\\ \\%C(#c0d6de)%s" @@ -157,3 +158,6 @@ # stash # git stash save # git stash pop + +# clean + k = git remote prune github diff --git a/.scripts/bluetooth_connect b/.scripts/bluetooth_connect index 5a24e13..edd3b4e 100755 --- a/.scripts/bluetooth_connect +++ b/.scripts/bluetooth_connect @@ -1,5 +1,9 @@ #!/bin/sh +device='FC:A8:9A:57:A4:8A' +device_sink='FC_A8_9A_57_A4_8A' +device_name="JBL Headset" + force(){ pulseaudio -k # usermod -a -G bluetooth $USER @@ -8,7 +12,7 @@ force(){ "rfkill unblock bluetooth sv stop bluetoothd sv start bluetoothd" -# sudo rfkill block wlan && sudo modprobe -r btusb && sleep 10 && sudo modprobe btusb && systemctl --user restart pulseaudio && sudo systemctl restart bluetooth +# sudo rfkill block wlan && sudo modprobe -r btusb && sleep 10 && sudo modprobe btusb && systemctl --user restart pulseaudio && sudo systemctl restart bluetooth # modprobe btusb ;sudo systemctl start bluetooth } @@ -20,19 +24,6 @@ check_bluetooth(){ fi } -select_device(){ - device=$(printf "JBL Headset\nAnne Pro" | dmenu -i -p " ") - if [ "$device" = "Anne Pro" ]; then - device='4C:24:98:32:B7:01' - device_name="Anne Pro" - elif [ "$device" = "JBL Headset" ]; then - device='FC:A8:9A:57:A4:8A' - device_sink='FC_A8_9A_57_A4_8A' - device_name="JBL Headset" - else exit - fi -} - connect_device(){ is_connected=$(bluetoothctl info $device | awk '/Connected/ {print $2}') if [ ! "$is_connected" = "yes" ]; then @@ -45,28 +36,18 @@ connect_device(){ fi } -jbl(){ - if [ "$device_name" = "JBL Headset" ]; then - change=$(pacmd set-card-profile bluez_card.$device_sink a2dp_sink |\ - grep -o "Failed") - if [ "$change" = "Failed" ]; then - force - jbl - else - pacmd set-default-sink bluez_sink.$device_sink.a2dp_sink - inputs=$(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') - for apps in $inputs; do - pacmd move-sink-input "$apps" bluez_sink.$device_sink.a2dp_sink - done - fi - fi -} - -pulseaudio_fix(){ - pulseaudio -k -} +change=$(pacmd set-card-profile bluez_card.$device_sink a2dp_sink |\ + grep -o "Failed") +if [ "$change" = "Failed" ]; then + force + jbl +else + pacmd set-default-sink bluez_sink.$device_sink.a2dp_sink + inputs=$(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') + for apps in $inputs; do + pacmd move-sink-input "$apps" bluez_sink.$device_sink.a2dp_sink + done +fi check_bluetooth -select_device connect_device -jbl diff --git a/.scripts/create_c_proj.sh b/.scripts/create_c_proj.sh index 1549a4b..86f5a44 100644 --- a/.scripts/create_c_proj.sh +++ b/.scripts/create_c_proj.sh @@ -19,7 +19,7 @@ year=$(date +'%Y') mkdir "$proj" cd "$proj" && git init > /dev/null git remote add github git@github.com:afify/"$proj".git > /dev/null -git remote add repo sh://repo.or.cz/"$proj".git > /dev/null +git remote add repo ssh://repo.or.cz/"$proj".git > /dev/null # Create gitignore #============================================================================== diff --git a/.scripts/xbps_base.txt b/.scripts/xbps_base.txt index 3c44f91..086dcd4 100644 --- a/.scripts/xbps_base.txt +++ b/.scripts/xbps_base.txt @@ -47,6 +47,9 @@ libreoffice linux linux-firmware linux-headers +man-pages +man-pages-devel +man-pages-posix mpv msmtp mupdf -- 2.11.4.GIT