From aadadd64bc88164ac2d8eec476562d6f827523ac Mon Sep 17 00:00:00 2001 From: Breizh Date: Sat, 17 Jun 2023 11:56:49 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9=C3=A9criture=20du=20music-convert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .Xresources | 2 +- .config/conky/conkyrc2 | 2 +- .config/i3/config | 2 +- .config/mpv/mpv.conf | 2 +- .config/pikaur.conf | 10 ++--- .config/yt-dlp/config | 6 +-- .local/bin/auto-poweroff.sh | 8 ++++ .local/bin/music-convert | 81 +++++++++++++------------------------ .local/bin/set_wall_clock | 6 ++- .local/bin/space-cadet | 9 ----- 10 files changed, 53 insertions(+), 75 deletions(-) delete mode 100755 .local/bin/space-cadet diff --git a/.Xresources b/.Xresources index 89bd791..9926133 100644 --- a/.Xresources +++ b/.Xresources @@ -86,7 +86,7 @@ URxvt*shading: 25 ! URxvt.keysym.M-v: perl:clipboard:paste ! URxvt.keysym.M-C-v: perl:clipboard:paste_escaped ! URxvt*termName: string -URxvt*geometry: 400x100 +! URxvt*geometry: 80x24 ! URxvt*chdir: string ! URxvt*reverseVideo: boolean ! URxvt*loginShell: boolean diff --git a/.config/conky/conkyrc2 b/.config/conky/conkyrc2 index 391b9e6..599eb47 100644 --- a/.config/conky/conkyrc2 +++ b/.config/conky/conkyrc2 @@ -96,7 +96,7 @@ ${color2}${font2}Sylvexplorer $hr$font$color${voffset 2} ${texeci 3600 /home/breizh/.config/conky/sylv.sh} ${color2}${font2}MPD $hr$font$color${voffset 2} -$alignc${scroll wait 43 1 2 ${mpd_smart}} +$alignc${scroll wait 43 1 2  ${mpd_smart} } $alignc${if_match "$mpd_album"!=""}${scroll wait 48 1 2 ${mpd_album}}$endif $alignr$mpd_elapsed / $mpd_length ${goto 140}${if_match "${mpd_status}"=="Playing"}${color 99CC99}$endif${if_match "${mpd_status}"=="Paused"}${color FFCC66}$endif${if_match "${mpd_status}"=="Stopped"}${color F2777A}$endif$mpd_bar$color diff --git a/.config/i3/config b/.config/i3/config index 96a4c03..8b2c901 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -370,7 +370,7 @@ exec claws-mail --online exec --no-startup-id urxvtc -name newsboat -e newsboat exec --no-startup-id redshift-gtk exec --no-startup-id nm-applet -exec --no-startup-id steam-native -silent -noverifyfiles -language french +exec --no-startup-id sleep 2m && steam-native -silent -noverifyfiles -language french #exec --no-startup-id SVPManager #exec --no-startup-id hp-systray -x exec --no-startup-id sleep 5 && play "$HOME/Musique/WELCOME BACK.wav" diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 2054a3a..1db3897 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -13,7 +13,7 @@ hwdec=auto-copy hwdec-codecs=all # Audio -# audio-channels=stereo +audio-channels=stereo alang=fr,fre,fra # Sous-titres diff --git a/.config/pikaur.conf b/.config/pikaur.conf index 854a583..eba3c8b 100644 --- a/.config/pikaur.conf +++ b/.config/pikaur.conf @@ -1,18 +1,18 @@ [sync] develpkgsexpiration = 30 -alwaysshowpkgorigin = no +alwaysshowpkgorigin = yes upgradesorting = versiondiff showdownloadsize = yes ignoreoutofdateaurupgrades = no [build] -keepbuilddir = no -keepdevbuilddir = no +keepbuilddir = yes +keepdevbuilddir = yes keepbuilddeps = no skipfailedbuild = no -alwaysusedynamicusers = no ignorearch = no -gpgdir = /etc/pacman.d/gnupg +gpgdir = /etc/pacman.d/gnupg +dynamicusers = root [review] donteditbydefault = no diff --git a/.config/yt-dlp/config b/.config/yt-dlp/config index aabce87..56b7cdd 100644 --- a/.config/yt-dlp/config +++ b/.config/yt-dlp/config @@ -3,7 +3,7 @@ --embed-subs --write-subs --write-auto-subs ---sub-langs fr,en,en(-|_)?[A-Z]+,-live_chat +--sub-langs fr,en,en(-|_)?.+,-live_chat #--sub-langs en --embed-thumbnail -i @@ -13,8 +13,8 @@ --hls-use-mpegts --compat-options no-keep-subs --download-archive ".yt-dlp_archive" --N 4 ---netrc +-N 1 +#--netrc # For 429 errors --retry-sleep fragment:exp=1:320 diff --git a/.local/bin/auto-poweroff.sh b/.local/bin/auto-poweroff.sh index b55a412..33379a0 100755 --- a/.local/bin/auto-poweroff.sh +++ b/.local/bin/auto-poweroff.sh @@ -3,10 +3,18 @@ # 1: Temps en minutes # 2: Type d’extinction +#reset-dpms() { +# xset dpms 600 600 600 +# exit +#} + trap 'exit' INT TERM touch /dev/shm/mccount +#xset dpms 10 10 10 +#xset dpms force standby + while true do diff --git a/.local/bin/music-convert b/.local/bin/music-convert index 6f25dc4..71e802d 100755 --- a/.local/bin/music-convert +++ b/.local/bin/music-convert @@ -13,57 +13,51 @@ reset=$(tput sgr0) bold=$(tput bold) # Répertoire source -rootdir="${HOME}/Musique/" +rootdir="${HOME}/Vidéos/Musique" cd "$rootdir" # Pour tous les sous-répertoires, à tous les niveaux -for dir in **/ . +for dir in **/ ./ do # Ignorer les liens symboliques - #if [[ -h "${rootdir}/${dir::-1}" && "${dir}" != "Vidéos/" ]] - # Converti uniquement les vidéos - if [[ "${dir}" != "Vidéos/" ]] + if [[ -h "${rootdir}/${dir::-1}" ]] then continue fi - - # Affichage du répertoire en cours de traitement - echo "$bold$dir$reset" - # Définition du répertoire de destination - dstdir="${HOME}/Musique.opus/${dir}" - - # Création de la destination + # Répertoire de destination + dstdir="${HOME}/Musique/Vidéos/${dir}" + + # Création du répertoire de destination mkdir -p "${dstdir}" - + # On entre dans le répertoire à traiter cd "${rootdir}/${dir}" # Pour chaque fichier for file in * do - # On ignore les dossiers - if [[ -d "${file}" ]] - then - continue - fi - - # S’il s’agit de FLAC ou d’une vidéo - if [[ "${file}" =~ .flac$ ]] || [[ "${dir}" == "Vidéos/" && "$(file --mime-type -b -e ascii -e compress -e tar -e cdf "$file")" =~ video/ ]] + # On ignore les dossiers + if [[ -d "${file}" ]] + then + continue + fi + + # Converti uniquement les vidéos + if [[ "$(file --mime-type -b -e ascii -e compress -e tar -e cdf "$file")" =~ video/ ]] then # Définition du fichier de destination - dstfile="$(basename -s .flac "$file").opus" + dstfile="${file%.*}.opus" - # S’il a déjà été traité on passe, pour gagner du - # temps. - if [[ -f "${dstdir}${dstfile}" ]] + # Passe les fichiers déjà traités + if [[ "${dstdir}${dstfile}" -nt "${file}" ]] then - echo "[${blue}SKIP${reset}] $file" + echo "[${blue}SKIP${reset}] ${dir#./}$file" continue fi - # Parrallélisation des conversions + # Parallélisation des conversions declare -a running mapfile -t running < <(jobs -p) @@ -72,37 +66,18 @@ do wait -n fi - togain="true" - ( - echo " $file" - ffmpeg -n -loglevel error -i "file:$file" -c:a libopus -b:a 256K "file:${dstdir}${dstfile}" - echo "[${green} OK ${reset}] $file" + echo " ${dir#./}$file" + ffmpeg -n -loglevel error -i "file:$file" -c:a libopus -b:a 256K "file:${dstdir}${dstfile}" && \ + loudgain -S -r -k -q -s e "${dstdir}${dstfile}" &>/dev/null && \ + echo "[${green} OK ${reset}] ${dir#./}$file" || \ + echo "[${red}FAIL${reset}] ${dir#./}$file" ) & else - # Pour les autres fichiers, les copier tel quels - echo "[${green}COPY${reset}] $file" + # Copie les autres types de fichiers + echo "[${green}COPY${reset}] ${dir#./}$file" cp -n --reflink=auto "${file}" "${dstdir}/" || true fi done - wait - - # Si le moindre fichier a été converti, on refait les tags replay gain - - #if ${togain} && [[ "${dir}" != "Vidéos/" ]] - #then - # ( - # cd "${dstdir}" - # shopt -s nullglob - # echo "[${blue}GAIN${reset}] $dir" - # loudgain -S -a -k -q -s e -- *.opus &>/dev/null && \ - # echo "[${green}GAIN${reset}] $dir" || \ - # echo "[${red}GAIN${reset}] $dir" - # shopt -u nullglob - # ) & disown $! - # - # # Réinitialise le tag togain - # togain="false" - #fi done wait diff --git a/.local/bin/set_wall_clock b/.local/bin/set_wall_clock index 9599943..e7fcf80 100755 --- a/.local/bin/set_wall_clock +++ b/.local/bin/set_wall_clock @@ -15,4 +15,8 @@ weekday=$($date +%-u) hour=$(( ($($date +%-H)%12)*5 + $($date +%-M)/12)) minute=$($date +%-M) -convert "bg.jpg" "month${month}.png" -composite "day${day}.png" -composite "weekday${weekday}.png" -composite "hour${hour}.png" -composite "minute${minute}.png" -composite "/tmp/output.png" +# Avec jour de la semaine +#convert "bg.jpg" "month${month}.png" -composite "day${day}.png" -composite "weekday${weekday}.png" -composite "hour${hour}.png" -composite "minute${minute}.png" -composite "/tmp/output.png" + +# Sans jour de la semaine +convert "bg.jpg" "month${month}.png" -composite "day${day}.png" -composite "hour${hour}.png" -composite "minute${minute}.png" -composite "/tmp/output.png" diff --git a/.local/bin/space-cadet b/.local/bin/space-cadet deleted file mode 100755 index 086855d..0000000 --- a/.local/bin/space-cadet +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -cvlc --loop "$HOME/.wine/drive_c/Maxis/FullTilt/CADET/SOUND/TABA1.MID" & -pid=$! - -wine .wine/drive_c/Maxis/FullTilt/CADET/CADET.EXE -kill $pid -timeout 2 wait $pid || kill -9 $pid -