Merge branch 'master' of ssh://git.jonathanh.co.uk:2222/jab2870/Dotfiles

Jonathan Hodgson 3 years ago
commit 85aa514a53
  1. 3
      alsa/.config/alsa/README.md
  2. 246
      alsa/.config/alsa/default_alsa_sound.conf
  3. 25
      bin/.bin/dmenu/menu-phone
  4. 2
      bin/.bin/dmenu/trofi
  5. 2
      bin/.bin/modem/checkCall
  6. 12
      bin/.bin/modem/checkSMS
  7. 4
      bin/.bin/modem/makeCall
  8. 27
      bin/.bin/notifications/phoneStatus

@ -1,3 +0,0 @@
This file was ~~stolen~~ borrowed from sxmo
<https://git.sr.ht/~mil/sxmo-utils/tree/master/item/configs/alsa>

@ -1,9 +1,29 @@
state.PinePhone {
control.1 {
iface CARD
name 'Headphone Jack'
value false
comment {
access read
type BOOLEAN
count 1
}
}
control.2 {
iface CARD
name 'Headset Microphone Jack'
value false
comment {
access read
type BOOLEAN
count 1
}
}
control.3 {
iface MIXER
name 'AIF1 AD0 Capture Volume'
value.0 165
value.1 165
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -11,15 +31,15 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 375
dbvalue.1 375
dbvalue.0 0
dbvalue.1 0
}
}
control.2 {
control.4 {
iface MIXER
name 'AIF1 DA0 Playback Volume'
value.0 149
value.1 149
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -27,15 +47,15 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 -825
dbvalue.1 -825
dbvalue.0 0
dbvalue.1 0
}
}
control.3 {
control.5 {
iface MIXER
name 'AIF2 ADC Capture Volume'
value.0 168
value.1 168
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -43,15 +63,15 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 600
dbvalue.1 600
dbvalue.0 0
dbvalue.1 0
}
}
control.4 {
control.6 {
iface MIXER
name 'AIF2 DAC Playback Volume'
value.0 0
value.1 0
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -59,15 +79,15 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 -9999999
dbvalue.1 -9999999
dbvalue.0 0
dbvalue.1 0
}
}
control.5 {
control.7 {
iface MIXER
name 'ADC Capture Volume'
value.0 179
value.1 179
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -75,15 +95,15 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 1425
dbvalue.1 1425
dbvalue.0 0
dbvalue.1 0
}
}
control.6 {
control.8 {
iface MIXER
name 'DAC Playback Volume'
value.0 169
value.1 169
value.0 160
value.1 160
comment {
access 'read write'
type INTEGER
@ -91,14 +111,14 @@ state.PinePhone {
range '0 - 192'
dbmin -9999999
dbmax 2400
dbvalue.0 675
dbvalue.1 675
dbvalue.0 0
dbvalue.1 0
}
}
control.7 {
control.9 {
iface MIXER
name 'Headphone Playback Volume'
value 29
value 63
comment {
access 'read write'
type INTEGER
@ -106,13 +126,13 @@ state.PinePhone {
range '0 - 63'
dbmin -9999999
dbmax 0
dbvalue.0 -3400
dbvalue.0 0
}
}
control.8 {
control.10 {
iface MIXER
name 'Mic1 Playback Volume'
value 0
value 3
comment {
access 'read write'
type INTEGER
@ -120,13 +140,13 @@ state.PinePhone {
range '0 - 7'
dbmin -450
dbmax 600
dbvalue.0 -450
dbvalue.0 0
}
}
control.9 {
control.11 {
iface MIXER
name 'Mic1 Boost Volume'
value 0
value 4
comment {
access 'read write'
type INTEGER
@ -134,13 +154,13 @@ state.PinePhone {
range '0 - 7'
dbmin 0
dbmax 4200
dbvalue.0 0
dbvalue.0 3300
}
}
control.10 {
control.12 {
iface MIXER
name 'Mic2 Playback Volume'
value 0
value 3
comment {
access 'read write'
type INTEGER
@ -148,13 +168,13 @@ state.PinePhone {
range '0 - 7'
dbmin -450
dbmax 600
dbvalue.0 -450
dbvalue.0 0
}
}
control.11 {
control.13 {
iface MIXER
name 'Mic2 Boost Volume'
value 0
value 4
comment {
access 'read write'
type INTEGER
@ -162,10 +182,10 @@ state.PinePhone {
range '0 - 7'
dbmin 0
dbmax 4200
dbvalue.0 0
dbvalue.0 3300
}
}
control.12 {
control.14 {
iface MIXER
name 'ADC Gain Capture Volume'
value 3
@ -179,10 +199,10 @@ state.PinePhone {
dbvalue.0 0
}
}
control.13 {
control.15 {
iface MIXER
name 'Line In Playback Volume'
value 0
value 3
comment {
access 'read write'
type INTEGER
@ -190,13 +210,13 @@ state.PinePhone {
range '0 - 7'
dbmin -450
dbmax 600
dbvalue.0 -450
dbvalue.0 0
}
}
control.14 {
control.16 {
iface MIXER
name 'Line Out Playback Volume'
value 0
value 31
comment {
access 'read write'
type INTEGER
@ -204,13 +224,13 @@ state.PinePhone {
range '0 - 31'
dbmin -9999999
dbmax 0
dbvalue.0 -9999999
dbvalue.0 0
}
}
control.15 {
control.17 {
iface MIXER
name 'Earpiece Playback Volume'
value 0
value 31
comment {
access 'read write'
type INTEGER
@ -218,14 +238,14 @@ state.PinePhone {
range '0 - 31'
dbmin -9999999
dbmax 0
dbvalue.0 -9999999
dbvalue.0 0
}
}
control.16 {
control.18 {
iface MIXER
name 'AIF1 AD0 Stereo Capture Route'
value.0 'Mix Mono'
value.1 'Mix Mono'
value.0 Stereo
value.1 Stereo
comment {
access 'read write'
type ENUMERATED
@ -236,11 +256,11 @@ state.PinePhone {
item.3 'Mix Mono'
}
}
control.17 {
control.19 {
iface MIXER
name 'AIF2 ADC Stereo Capture Route'
value.0 Stereo
value.1 Stereo
value.0 'Mix Mono'
value.1 'Mix Mono'
comment {
access 'read write'
type ENUMERATED
@ -251,20 +271,20 @@ state.PinePhone {
item.3 'Mix Mono'
}
}
control.18 {
control.20 {
iface MIXER
name 'AIF3 ADC Source Capture Route'
value 'AIF2 Right'
value None
comment {
access 'read write'
type ENUMERATED
count 1
item.0 None
item.1 'AIF2 Left'
item.2 'AIF2 Right'
item.1 'AIF2 ADCL'
item.2 'AIF2 ADCR'
}
}
control.19 {
control.21 {
iface MIXER
name 'AIF1 Slot 0 Digital ADC Capture Switch'
value.0 false
@ -275,21 +295,21 @@ state.PinePhone {
count 2
}
}
control.20 {
control.22 {
iface MIXER
name 'AIF2 Digital ADC Capture Switch'
value.0 false
value.1 false
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.21 {
control.23 {
iface MIXER
name 'AIF1 Data Digital ADC Capture Switch'
value.0 false
value.0 true
value.1 false
comment {
access 'read write'
@ -297,7 +317,7 @@ state.PinePhone {
count 2
}
}
control.22 {
control.24 {
iface MIXER
name 'AIF2 Inv Digital ADC Capture Switch'
value.0 false
@ -308,18 +328,18 @@ state.PinePhone {
count 2
}
}
control.23 {
control.25 {
iface MIXER
name 'AIF2 ADC Mixer AIF1 DA0 Capture Switch'
value.0 false
value.1 false
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.24 {
control.26 {
iface MIXER
name 'AIF2 ADC Mixer AIF2 DAC Rev Capture Switch'
value.0 false
@ -330,10 +350,10 @@ state.PinePhone {
count 2
}
}
control.25 {
control.27 {
iface MIXER
name 'AIF2 ADC Mixer ADC Capture Switch'
value.0 false
value.0 true
value.1 false
comment {
access 'read write'
@ -341,20 +361,20 @@ state.PinePhone {
count 2
}
}
control.26 {
control.28 {
iface MIXER
name 'AIF2 DAC Source Playback Route'
value None
value AIF2
comment {
access 'read write'
type ENUMERATED
count 1
item.0 None
item.1 'AIF2 Left'
item.2 'AIF2 Right'
item.0 AIF2
item.1 AIF3+2
item.2 AIF2+3
}
}
control.27 {
control.29 {
iface MIXER
name 'AIF1 DA0 Stereo Playback Route'
value.0 Stereo
@ -369,11 +389,11 @@ state.PinePhone {
item.3 'Mix Mono'
}
}
control.28 {
control.30 {
iface MIXER
name 'AIF2 DAC Stereo Playback Route'
value.0 Stereo
value.1 Stereo
value.0 'Sum Mono'
value.1 'Sum Mono'
comment {
access 'read write'
type ENUMERATED
@ -384,29 +404,29 @@ state.PinePhone {
item.3 'Mix Mono'
}
}
control.29 {
control.31 {
iface MIXER
name 'AIF1 Slot 0 Digital DAC Playback Switch'
value.0 true
value.1 true
value.1 false
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.30 {
control.32 {
iface MIXER
name 'AIF2 Digital DAC Playback Switch'
value.0 false
value.1 false
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.31 {
control.33 {
iface MIXER
name 'ADC Digital DAC Playback Switch'
value.0 false
@ -417,7 +437,7 @@ state.PinePhone {
count 2
}
}
control.32 {
control.34 {
iface MIXER
name 'Headphone Source Playback Route'
value.0 DAC
@ -430,7 +450,7 @@ state.PinePhone {
item.1 Mixer
}
}
control.33 {
control.35 {
iface MIXER
name 'Headphone Playback Switch'
value.0 true
@ -441,10 +461,10 @@ state.PinePhone {
count 2
}
}
control.34 {
control.36 {
iface MIXER
name 'Line Out Source Playback Route'
value.0 'Mono Differential'
value.0 Stereo
value.1 Stereo
comment {
access 'read write'
@ -454,18 +474,18 @@ state.PinePhone {
item.1 'Mono Differential'
}
}
control.35 {
control.37 {
iface MIXER
name 'Line Out Playback Switch'
value.0 false
value.1 false
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.36 {
control.38 {
iface MIXER
name 'Earpiece Source Playback Route'
value DACR
@ -479,17 +499,17 @@ state.PinePhone {
item.3 'Left Mixer'
}
}
control.37 {
control.39 {
iface MIXER
name 'Earpiece Playback Switch'
value false
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.38 {
control.40 {
iface MIXER
name 'Mic1 Playback Switch'
value.0 false
@ -500,7 +520,7 @@ state.PinePhone {
count 2
}
}
control.39 {
control.41 {
iface MIXER
name 'Mic2 Playback Switch'
value.0 false
@ -511,18 +531,18 @@ state.PinePhone {
count 2
}
}
control.40 {
control.42 {
iface MIXER
name 'Line In Playback Switch'
value.0 false
value.1 false
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.41 {
control.43 {
iface MIXER
name 'DAC Playback Switch'
value.0 true
@ -533,7 +553,7 @@ state.PinePhone {
count 2
}
}
control.42 {
control.44 {
iface MIXER
name 'DAC Reversed Playback Switch'
value.0 false
@ -544,18 +564,18 @@ state.PinePhone {
count 2
}
}
control.43 {
control.45 {
iface MIXER
name 'Mic1 Capture Switch'
value.0 false
value.1 false
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.44 {
control.46 {
iface MIXER
name 'Mic2 Capture Switch'
value.0 false
@ -566,7 +586,7 @@ state.PinePhone {
count 2
}
}
control.45 {
control.47 {
iface MIXER
name 'Line In Capture Switch'
value.0 false
@ -577,7 +597,7 @@ state.PinePhone {
count 2
}
}
control.46 {
control.48 {
iface MIXER
name 'Mixer Capture Switch'
value.0 false
@ -588,7 +608,7 @@ state.PinePhone {
count 2
}
}
control.47 {
control.49 {
iface MIXER
name 'Mixer Reversed Capture Switch'
value.0 false

@ -1,9 +1,31 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DIR/../modem/common"
viewMissedCalls(){
local choice="$( (
#cat "$CALL_DIR/missed-calls" | awk -F '\t' '{"date +%Y-%m-%d %H:%M:%S -d @" $1 |& getline $1; print $2 "<sub>" $1 "</sub>"}'
cat "$CALL_DIR/missed-calls" | awk -F '\t' '{"date -d @" $1 " \"+%Y-%m-%d %H:%M:%S\"" |& getline $1; print $2 " <span size=\"xx-small\">" $1 "</span><span font=\"0\">"$3"</span>"}'
echo "Clear"
)| trofi -markup-rows )"
case "$choice" in
"Clear") rm "$CALL_DIR/missed-calls" ;;
*)
local number="$(echo "$choice" | cut -d '>' -f 4 | cut -d '<' -f 1)"
makeCall "$number"
;;
esac
}
options="End All Calls
Check for Calls
Check for Texts
Dialer"
$( [ -f "$CALL_DIR/missed-calls" ] && echo "Missed Calls" )
Dialer
Back"
options="$(echo "$options" | sed '/^$/d')"
while true ; do
choice="$(echo "$options" | trofi)"
@ -14,6 +36,7 @@ while true ; do
break ;;
"Check for Calls") checkCall ;;
"Check for Texts") checkSMS ;;
"Missed Calls") viewMissedCalls; break ;;
"Dialer") (dialer &); break ;;
"Back") break;;
esac

@ -9,4 +9,4 @@ lines="$(echo "$input" | wc -l )"
[ "$lines" -gt 15 ] && lines=15
echo "$input" | rofi -dmenu -me-accept-entry '!MousePrimary' -theme "themes/touch-dmenu.rasi" -lines "$lines"
echo "$input" | rofi -dmenu -me-accept-entry '!MousePrimary' -theme "themes/touch-dmenu.rasi" -lines "$lines" "$@"

@ -220,7 +220,7 @@ checkFinished(){
# it hasn't been answerd yet.
# Treat as a missed call
if ps aux | grep -E '\Wrofi' | grep -q "call-from-$contact"; then
echo "Missed call from $contact" >> "$CALL_DIR/missed-calls"
echo -e "$(date '+%s')\t$contact\t$number" >> "$CALL_DIR/missed-calls"
pkill mpv
mmcli -m "$modem" --voice-delete-call "$id"
ps aux | grep -E '\Wrofi' | grep "call-from-$contact" |

@ -61,13 +61,15 @@ echo "$ids" | while read -r id; do
log="$SMS_DIR/$number/sms.log"
[ ! -f "$log" ] && printf '\00READ\00' >> "$log"
# Store the message in the log file
echo "RECIEVED"
echo "SENDER: $number" >> $log
echo "TIME: $(date -d "$time")" >> $log
echo "----" >> $log
echo -e "$text" >> $log
printf '\00\n' >> $log
echo "SENDER: $number" >> "$log"
echo "TIME: $(date -d "$time")" >> "$log"
echo "----" >> "$log"
echo -e "$text" >> "$log"
printf '\00\n' >> "$log"
mmcli -m "$modem" --messaging-delete-sms="$id"
done

@ -27,7 +27,9 @@ while [[ $1 = -?* ]]; do
shift
done
number="$1"
number="$(echo "$1" | sed 's/^0/+44/')"
[ -z "$number" ] && die "No Number Specified"

@ -1,10 +1,33 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DIR/../modem/common"
battery="$(cat /sys/class/power_supply/axp20x-battery/capacity)"
batteryStatus="$(cat /sys/class/power_supply/axp20x-battery/status)"
[ "$batteryStatus" = "Charging" ] && batteryIcon="🔌" || batteryIcon="🔋"
missedCallsNo="$(cat "$CALL_DIR/missed-calls" | wc -l )"
time="$(date "+%H:%M")"
notify-send "$(hostname)" "$batteryIcon ${battery}%\nTime $time"
newTexts=0
for i in "$SMS_DIR"/*/sms.log; do
echo "$i"
count="$(sed -n '/\x0READ\x0/,$ p' "$i" | sed '1d' |
sed -n 's/\x0/-/p' | wc -l)"
echo "$count"
newTexts=$(( newTexts + count ))
done
notification="
$batteryIcon ${battery}%
Time $time
$( ip r | grep -v "default" | awk '{print $3 ": " $9}')
$( [ "$missedCallsNo" -gt 0 ] && echo "$missedCallsNo Missed Calls" )
$( [ "$newTexts" -gt 0 ] && echo "$newTexts New Texts" )
"
notification="$( echo "$notification" | sed '/^$/d' )"
notify-send "$(hostname)" "$notification"

Loading…
Cancel
Save