Skip to content

Commit

Permalink
Merge pull request #1374 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Jun 30, 2023
2 parents 36293c3 + a146533 commit 27ded0d
Show file tree
Hide file tree
Showing 37 changed files with 338 additions and 704 deletions.
217 changes: 22 additions & 195 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

alias=r1

# restore 20230522
#. /srv/http/bash/settings/addons.sh
[[ -e /srv/http/bash/settings/addons.sh ]] && . /srv/http/bash/settings/addons.sh || . /srv/http/bash/addons.sh
. /srv/http/bash/settings/addons.sh

# 20230630
if ! grep -q sudo /etc/conf.d/devmon; then
sed -i 's|/srv|/usr/bin/sudo /srv|g' /etc/conf.d/devmon
systemctl restart devmon@http
fi

file=/etc/systemd/system/spotifyd.service
grep -q CPUAffinity $file && sed -i '/CPUAffinity/ d' $file

# 20230620
file=/etc/pacman.conf
Expand All @@ -13,10 +20,6 @@ grep -q community $file && sed -i -e '/community/,/^$/ d' -e '/aur/,/^$/ d' $fil
! grep -q scrobblekeyremove $dirsettings/features.sh && rm -f $dirsystem/scrobble

# 20230616
if [[ -e $diraddons/dab && ! -e /usr/bin/mediamtx ]]; then
pacman -Sy --noconfirm mediamtx
fi

if [[ -e /boot/overlays/i2s-dac.dtbo ]]; then
grep -q rpi-dac /boot/config.txt && sed -i 's/rpi-dac/i2s-dac/' /boot/config.txt && rebooti2s=1
grep -q rpi-cirrus /boot/config.txt && sed -i 's/rpi-cirrus/cirrus/' /boot/config.txt && rebooti2s=1
Expand Down Expand Up @@ -47,7 +50,7 @@ if [[ -e $file ]]; then
fi
rm -f /tmp/localbrowser.conf

[[ $( pacman -Q bluealsa ) != 'bluealsa 4.1.0-1' ]] && pacman -Sy --noconfirm bluealsa
[[ $( pacman -Q bluealsa ) == 'bluealsa 4.0.0-1' ]] && packages+=bluealsa

# 20230528
file=$dirmpdconf/conf/snapserver.conf
Expand All @@ -61,171 +64,12 @@ if grep -q port $file; then
fi

if [[ ! -e /boot/kernel.img && -e /lib/python3.11 && ! -e /lib/python3.11/site-packages/RPi ]]; then
pacman -Sy --noconfirm python-pycamilladsp python-pycamilladsp-plot python-rpi-gpio python-rplcd python-smbus2
packages+='python-pycamilladsp python-pycamilladsp-plot python-rpi-gpio python-rplcd python-smbus2'
rm -rf /lib/python3.10
fi

# 20230522
crontab -l | grep -q addonsupdates && echo "00 01 * * * $dirsettings/addons-data.sh" | crontab -
systemctl restart cronie

if ls $dirsystem/autoplay* &> /dev/null && [[ ! -s $dirsystem/autoplay ]]; then
k=( startup bluetooth cd )
f=( autoplay autoplaybt autoplaycd )
for (( i=0; i < 3; i++ )); do
[[ -e $dirsystem/${f[i]} ]] && data+=${k[i]}=true || data+=${k[i]}=false
done
echo "$data" >> $dirsystem/autoplay
rm -f $dirsystem/{autoplaybt,autoplaycd}
fi

rm -f $dirsystem/btoutputonly
[[ -e $dirmpdconf/bluetooth.conf && -e $dirmpdconf/output.conf ]] && touch $dirsystem/btoutputall

file=$dirsystem/equalizer.conf
if [[ ! -e ${file/.*} ]]; then
rm -f $file
elif [[ ! -e$dirsystem/equalizer.json ]]; then
active=$( head -1 $file )
current=$( sed -n "/^$active^/ {s/^.*\^//; p}" $file )
readarray -t lines <<< $( grep -v '^Flat$' $file )
for l in "${lines[@]}"; do
preset+=', "'${l/^*}'" : [ '$( tr ' ' , <<< ${l/*^} )' ]'
done
data='{
"active" : "'$active'"
, "current" : "'$current'"
, "preset" : {
"Flat": [ 62, 62, 62, 62, 62, 62, 62, 62, 62, 62 ]'
$preset'
}
}'
jq <<< $data > $dirsystem/equalizer.json
rm $file
fi

for file in display order; do
[[ -e $dirsystem/$file ]] && mv $dirsystem/$file{,.json}
done

file=/etc/systemd/system/lcdchar.service
if [[ ! -e $file ]]; then
echo '[Unit]
Description=Character LCD
[Service]
ExecStart=/srv/http/bash/lcdchar.py' > $file
systemctl daemon-reload
fi
file=$dirsystem/lcdchar.conf
if [[ ! -e ${file/.*} ]]; then
rm -f $file
elif [[ -e $file ]]; then
. $file
data='inf="'$inf'"
cols='$cols'
charmap="'$charmap'"'
if [[ $address ]]; then
data+='
address='$(( 16#${address: -2} ))'
chip="'$chip'"'
else
data+='
pin_rs='$pin_rs'
pin_rw='$pin_rw'
pin_e='$pin_e
p=( $( tr [,] ' ' <<< $pins_data ) )
for (( i=0; i < 4; i++ )); do
data+="
p$i=${p[i]}"
done
fi
data+='
backlight='$backlight
echo $data > $dirsystem/lcdcharconf.py
rm -f $file
fi

if [[ ! -e /boot/kernel.img ]]; then
file=$dirsystem/localbrowser.conf
if ! systemctl -q is-enabled localbrowser; then
rm -f $file
elif [[ -e $file && $( sed -n 6p $file ) != cursor* ]]; then
[[ -e $dirsystem/onwhileplay ]] && onwhileplay=true && rm $dirsystem/onwhileplay
grep -q hdmi_force_hotplug=1 /boot/config.txt && hdmi=true
. $file
conf="\
rotate=$rotate
zoom=$zoom
screenoff=$screenoff
onwhileplay=$onwhileplay
hdmi=$hdmi
cursor=$( [[ $cursor == yes ]] && echo true )"
echo "$conf" > $file
fi
fi

systemctl -q is-enabled powerbutton && touch $dirsystem/powerbutton

file=$dirsystem/relays.conf
if [[ ! -e ${file/.*} ]]; then
rm -f $file
elif [[ ! -e $dirsystem/relays.json ]]; then
. $file
data="\
on='${on[@]}'
off='${off[@]}'
ond='${ond[@]}'
offd='${offd[@]}'
timer=$timer"
p=( $( tr , ' ' <<< ${pin:2:-2} ) )
n=( $( tr , ' ' <<< ${name:2:-2} ) )
for (( i=0; i < 4; i++ )); do
pn+=', "'${p[i]}'" : '${n[i]}
done
json='{ '${pn:1}' }'
jq <<< $json > $dirsystem/relays.json
for p in ${on[@]}; do
name=$( jq -r '.["'$p'"]' <<< $json )
[[ $name ]] && orderon+=$name'\n'
done
for p in ${off[@]}; do
name=$( jq -r '.["'$p'"]' <<< $json )
[[ $name ]] && orderoff+=$name'\n'
done
data+='
orderon="'$( sed -E 's/(["`])/\\\1/g; s/\\n$//' <<< $orderon )'"
orderoff="'$( sed -E 's/(["`])/\\\1/g; s/\\n$//' <<< $orderoff )'"'
echo "$data" > $file
fi

[[ -e /usr/bin/rtsp-simple-server ]] && pacman -Sy --noconfirm mediamtx

if [[ -L $dirmpd && ! -s /etc/exports && -e /mnt/MPD/SD ]]; then
mv /mnt/MPD/{SD,USB} /mnt
sed -i 's|/mnt/MPD/USB|/mnt/USB|' /etc/udevil/udevil.conf
systemctl restart devmon@http
rm /mnt/MPD/.mpdignore
fi

[[ -e $dirsystem/spotify ]] && mv $dirsystem/spotify{,key}

if [[ ! -e $dirshm/cpuinfo ]]; then
file=$dirsystem/usbautoupdate
[[ -e $file ]] && rm $file || touch $file{,no}
fi

file=$dirsystem/vuled.conf
if [[ ! -e ${file/.*} ]]; then
rm -f $file
elif ! grep -q ^p0 $file; then
pins=( $( < $file ) )
data=
for (( i=0; i < 7; i++ )); do
data+="p$i=${pins[i]}"$'\n'
done
echo "$data" > $file
fi
# 20230609
[[ $packages ]] && pacman -Sy --noconfirm $packages

#-------------------------------------------------------------------------------
installstart "$1"
Expand All @@ -236,33 +80,12 @@ getinstallzip

. $dirbash/common.sh
dirPermissions
cacheBust
[[ -e $dirsystem/color ]] && $dirbash/cmd.sh color
hash=?v=$( date +%s )
sed -E -i "s/(rern.woff2).*'/\1$hash'/" /srv/http/assets/css/common.css
sed -i "s/?v=.*/$hash';/" /srv/http/common.php

installfinish
#-------------------------------------------------------------------------------

# 20230522
[[ ! -e $dirshm/cpuinfo ]] && $dirsettings/system.sh cpuinfo

! grep -q listing $dirbash/mpdidle.sh && systemctl restart mpd

file=$dirsystem/multiraudio.conf
if [[ -e $file ]]; then
filejson=${file/conf/json}
grep -q '{' $file && jq < $file > $filejson || conf2json $file | jq > $filejson
rm -f $file
fi

if grep -q /srv/http/data /etc/exports; then
echo "$info Server rAudio:
- Disconnect client
- Disable server
- Re-enable again"
fi

# 20230528
if [[ -e $dirshm/mixernone ]] && grep -q . $dirshm/amixercontrol; then
if [[ $( volumeGet valdb | jq .db ) != 0 ]]; then
Expand All @@ -279,8 +102,12 @@ if [[ $rebooti2s ]]; then
fi

# 20230623
! grep -q dirshm/listing $dirbash/mpdidle.sh && systemctl restart mpd
if [[ -e $dirmpd/album ]]; then
charlast=$( tail -c 1 $dirmpd/album )
[[ $charlast ]] && echo >> $dirmpd/album
files=$( ls -1 $dirmpd | grep -Ev 'mpd.db|listing|updating' )
for f in $files; do
charlast=$( tail -c 1 $dirmpd/$f )
[[ $charlast ]] && echo >> $dirmpd/$f
done
fi

$dirsettings/player-conf.sh
26 changes: 7 additions & 19 deletions srv/http/assets/css/camillagui.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,12 @@ input[type=checkbox] {
border: none;
border-radius: 3px;
background-color: var(--cg) !important;
background: radial-gradient( 160% 100% at 50% -50%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
background: var( --glossy-btn );
}
input:checked {
background-color: var( --cm ) !important;
}
input[type=range] {
--gloss: radial-gradient( 225% 90% at 100% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
--track: linear-gradient( 90deg, transparent 10px, var( --cg ) 10px, var( --cg ) calc( 100% - 10px ), transparent 10px );
--trackborder : 1px solid var( --cgd );
display: block;
Expand All @@ -262,7 +261,7 @@ input[type=range]::-webkit-slider-thumb {
margin-top: -18px;
border: none;
border-radius: 3px;
background: var( --gloss );
background: var( --glossy-btn );
background-color: var( --cm );
-webkit-appearance: none;
box-shadow: var( --shadow-btn );
Expand All @@ -272,7 +271,7 @@ input[type=range]::-moz-range-thumb {
width: 36px;
border: none;
border-radius: 3px;
background: var( --gloss );
background: var( --glossy-btn );
background-color: var( --cm );
box-shadow: var( --shadow-btn );
}
Expand Down Expand Up @@ -311,7 +310,7 @@ input[data-tip='Mixer name, must be unique'] {
.button {
border: none;
background-color: var( --cg ) !important;
background: radial-gradient( 160% 100% at 50% -50%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
background: var( --glossy-btn );
text-shadow: var( --shadow-text );
width:36px;
height: 36px;
Expand Down Expand Up @@ -344,28 +343,17 @@ input[data-tip='Mixer name, must be unique'] {
border-right: 1px solid var( --cga );
margin-right: 0 !important;
border-radius: 3px 0 0 3px;
background: radial-gradient( 225% 90% at 100% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
background: var( --glossy-btn-l );
}
#button-mute {
border-radius: 0;
border-right: 1px solid var( --cga );
background: -webkit-linear-gradient(
top,
hsla(0,0%,100%,.3) 0%,
hsla(0,0%,100%,.3) 45%,
rgba(0,0,0,0) 50%,
rgba(0,0,0,0) 100% );
background: linear-gradient(
to bottom,
hsla(0,0%,100%,.3) 0%,
hsla(0,0%,100%,.3) 45%,
rgba(0,0,0,0) 50%,
rgba(0,0,0,0) 100% );
background: var( --glossy-btn-m );
}
#button-volumeup,
#button-redo {
border-radius: 0 3px 3px 0;
background: radial-gradient( 300% 90% at 0% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
background: var( --glossy-btn-r );
}
/* compact view */
::marker {
Expand Down
5 changes: 5 additions & 0 deletions srv/http/assets/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
--shadow-menu-u : -4px -4px 10px #000;
--shadow-select : -1px 1px 1px #000;
--shadow-text : -1px 0 2px #000;
/* w h x y inner(color) w outer(color) w */
--glossy-btn : radial-gradient( 225% 90% at 100% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
--glossy-btn-l : radial-gradient( 225% 90% at 100% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
--glossy-btn-m : linear-gradient( to bottom, hsla(0,0%,100%,.3) 0%, hsla(0,0%,100%,.3) 45%, rgba(0,0,0,0) 50%, rgba(0,0,0,0) 100% );
--glossy-btn-r : radial-gradient( 300% 90% at 0% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
}

bl, .bl { color : var( --cm ) !important }
Expand Down
12 changes: 5 additions & 7 deletions srv/http/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@font-face {
font-family : rern;
src : url( '/assets/fonts/rern.woff2?v=1686837293' );
src : url( '/assets/fonts/rern.woff2?v=1687770021' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -399,8 +399,7 @@ codered {
}

#infoRange {
--gloss: radial-gradient( 225% 90% at 100% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
--track: linear-gradient( 90deg, transparent 10px, #000000 10px, #000000 calc( 100% - 10px ), transparent 10px );
--track: linear-gradient( 90deg, transparent 10px, #000 10px, #000 calc( 100% - 10px ), transparent 10px );
--trackborder : 1px solid var( --cgd );
}
#infoRange input {
Expand All @@ -418,7 +417,7 @@ codered {
margin-top: -20px;
border: none;
border-radius: 4px;
background: var( --gloss );
background: var( --glossy-btn );
background-color: var( --cm );
-webkit-appearance: none;
box-shadow: var( --shadow-btn );
Expand All @@ -428,7 +427,7 @@ codered {
width: 40px;
border: none;
border-radius: 4px;
background: var( --gloss );
background: var( --glossy-btn );
background-color: var( --cm );
box-shadow: var( --shadow-btn );
}
Expand Down Expand Up @@ -481,8 +480,7 @@ codered {
.infobtn,
input[ type=radio ],
input[ type=checkbox ] {
/* w h x y inner(color) w outer(color) w */
background: radial-gradient( 125% 100% at 50% 0%, hsla(0,0%,100%,.3) 50%, hsla(0,0%,100%,0) 55% );
background: var( --glossy-btn );
box-shadow: var( --shadow-check );
}
.infobtn {
Expand Down
Loading

0 comments on commit 27ded0d

Please sign in to comment.