Diverses modifs

This commit is contained in:
Breizh 2022-08-20 20:23:03 +02:00
parent 62004a2348
commit 2f111c4013
7 changed files with 30 additions and 33 deletions

View file

@ -27,6 +27,8 @@
# bar_height is only used for output in "noritake" format
; bar_height = 32
bar_width=1
# For SDL width and space between bars is in pixels, defaults are:
; bar_width = 20
; bar_spacing = 5

View file

@ -2,6 +2,6 @@
for dir in /run/media/breizh/*
do
[[ -d "$dir" ]] && echo -e "\${template3 $dir $(basename $dir)}\n\n"
[[ -d "$dir" ]] && echo -e "\${template3 $dir $(basename $dir)}\n"
done

View file

@ -36,7 +36,7 @@ column_meters_0=LeftCPUs2 Blank CPU Memory Swap Blank Hostname System DateTime B
column_meter_modes_0=1 2 1 1 1 2 2 2 2 2 2 2 2 2 2
column_meters_1=RightCPUs2 Blank CPU Memory Swap Blank Uptime LoadAverage Tasks Blank DiskIO NetworkIO Blank PressureStallMemoryFull PressureStallIOFull
column_meter_modes_1=1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
tree_view=0
tree_view=1
sort_key=46
tree_sort_key=0
sort_direction=-1
@ -46,7 +46,7 @@ all_branches_collapsed=0
screen:Main=PID USER PRIORITY NICE OOM M_VIRT M_RESIDENT M_SHARE M_SWAP IO_RATE STATE PERCENT_CPU PERCENT_MEM TIME Command
.sort_key=PERCENT_CPU
.tree_sort_key=PID
.tree_view=0
.tree_view=1
.tree_view_always_by_pid=0
.sort_direction=-1
.tree_sort_direction=1

View file

@ -1,9 +1,9 @@
-o "%(title)s.%(ext)s"
-o "%(release_date,upload_date)s.%(title)s.%(ext)s"
-P "temp:/tmp"
--embed-subs
--write-subs
--write-auto-subs
--sub-lang fr,en
--sub-langs fr,en,-live_chat
--embed-thumbnail
-i
-f "((bestvideo[vcodec^=av01][height<=?1440][width<=?2560]/bestvideo[vcodec=vp9][height<=?1440][width<=?2560]/bestvideo[height<=?1440][width<=?2560]/bestvideo)+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio))/best"
@ -11,3 +11,4 @@
--hls-use-mpegts
--compat-options no-keep-subs
--download-archive ".yt-dlp_archive"
--downloader axel

View file

@ -3,7 +3,7 @@
# Fonction de réinitialisation en cas de perte de la connexion
self-reset() {
echo "<span foreground=\"#515151\">[--:-- --:-- --:--]</span>"
sleep 5
sleep 1
exec "$0"
}
@ -14,7 +14,7 @@ coproc nc -U /home/breizh/.mpd/socket
IN=${COPROC[1]}
OUT=${COPROC[0]}
#echo "password xxx" >&"${IN}"
sed '/^OK/q' <&"$OUT" &>/dev/null
#sed '/^OK/q' <&"$OUT" &>/dev/null
# Initialisation des valeurs par défaut et des fonctions
declare -i SCROLL=50 I=0
@ -43,10 +43,9 @@ human_time() {
# Initialisation de létat
echo "status" >&"$IN"
while read -t 1 -u "$OUT" output
while read -t 0.1 -u "$OUT" output
do
[[ "$output" == "OK" ]] && break
o[${output%%:*}]="${output##*: }"
[[ "$output" =~ : ]] && o[${output%%:*}]="${output##*: }"
done
# Boucle principale
@ -54,7 +53,7 @@ while [[ -n "$COPROC_PID" ]]
do
# Gestion du clic, fait office de délai si aucune action (une seconde).
# En cas de clic, lactualisation de laffichage sera instantanné.
read -t 1 BLOCK_BUTTON
read -t 0.75 BLOCK_BUTTON
case $BLOCK_BUTTON in
1|3)
@ -84,18 +83,16 @@ do
# Récupération de létat
echo "status" >&"$IN" || self-reset
while read -t 1 -u "$OUT" output
while read -t 0.1 -u "$OUT" output
do
[[ "$output" == "OK" ]] && break
o[${output%%:*}]="${output##*: }"
[[ "$output" =~ : ]] && o[${output%%:*}]="${output##*: }"
done
# Récupération des informations du morceau en cours
echo "currentsong" >&"$IN" || self-reset
while read -t 1 -u "$OUT" output
while read -t 0.1 -u "$OUT" output
do
[[ "$output" == "OK" ]] && break
o[${output%%:*}]="${output##*: }"
[[ "$output" =~ : ]] && o[${output%%:*}]="${output##*: }"
done
# Choix des couleurs selon létat
@ -120,7 +117,7 @@ do
scroll=true
song=" $song "
else
scroll=false
unset scroll
song=" $song"
fi
@ -131,7 +128,7 @@ do
fi
# Gestion du défilement
if "$scroll"
if [[ -n "$scroll" ]]
then
unset bloc1 bloc2 bloc3 bloc4
declare -- bloc1 bloc2 bloc3 bloc4
@ -190,3 +187,5 @@ do
# DEBUG
printf '<b>%s</b>%s<b>%s</b>%s%s\n' "$bloc1" "$bloc2" "$bloc3" "$bloc4" " $status$time</span>"
done

View file

@ -8,19 +8,14 @@ touch /dev/shm/mccount
while true
do
mcpid=$(systemctl show minecraft-server.service --property MainPID --value)
mcstatus=$(ps -q "${mcpid}" -o state --no-headers 2>/dev/null)
mcpid="$(pgrep -nu minecraft java)"
mcstatus="$(ps -q "${mcpid}" -o state --no-headers 2>/dev/null)"
if [[ "$mcstatus" == "T" ]]
then
echo . >> /dev/shm/mccount
else
players_tmp=($(mcstatus localhost query | grep players))
players="${players_tmp[1]%%/*}"
if [[ "$players" -gt 0 ]]
then
> /dev/shm/mccount
fi
> /dev/shm/mccount
fi
time=$(wc -l /dev/shm/mccount | cut -d" " -f1)

View file

@ -4,9 +4,9 @@ cat | while read line
do
if [[ "$line" =~ ^/ ]]
then
echo "$line" > /run/minecraft-server.stdin
echo "mine $line" > /run/minecraft-server.stdin
else
echo "say $line" > /run/minecraft-server.stdin
echo "dynmap sendtoweb $line" > /run/minecraft-server.stdin
echo "mine say $line" > /run/minecraft-server.stdin
# echo "mine dynmap sendtoweb $line" > /run/minecraft-server.stdin
fi
done