Script de conversion de Musique

This commit is contained in:
Breizh 2021-07-02 14:00:50 +02:00
parent 8b90ddd870
commit 5e4498b2d7
3 changed files with 71 additions and 7 deletions

View file

@ -3,7 +3,7 @@
fields=0 17 18 48 49 39 113 111 109 110 46 47 2 1
sort_key=111
sort_direction=1
tree_sort_key=0
tree_sort_key=47
tree_sort_direction=1
hide_kernel_threads=1
hide_userland_threads=1
@ -24,8 +24,8 @@ header_margin=1
detailed_cpu_time=1
cpu_count_from_one=0
show_cpu_usage=1
show_cpu_frequency=1
show_cpu_temperature=0
show_cpu_frequency=0
show_cpu_temperature=1
degree_fahrenheit=0
update_process_names=0
account_guest_in_cpu_meter=0
@ -37,3 +37,4 @@ left_meter_modes=1 2 1 1 1 1 2 2 2 2 2 2 2 2
right_meters=RightCPUs2 Blank CPU Memory LoadAverage Blank Clock Uptime Blank DiskIO NetworkIO Blank PressureStallMemoryFull PressureStallIOFull
right_meter_modes=1 2 2 2 2 2 2 2 2 2 2 2 2 2
hide_function_bar=0

View file

@ -94,13 +94,13 @@ bar-cache-position=overlay
# zone and there is no request-display active. Useful in combination with bar-
# cache-position to control whether or not the cache bar is occluded by (or
# occludes) the progress bar.
bar-cache-height-inactive=1.5
bar-cache-height-inactive=3
# Sets the height of the cache bar display when the mouse is in the active zone or
# request-display is active. Useful in combination with bar-cache- position to
# control whether or not the cache bar is occluded by (or occludes) the progress
# bar.
bar-cache-height-active=4
bar-cache-height-active=8
# A string of ASS override tags that get applied to all three layers of the bar:
# progress, cache, and background. You probably don't want to remove \bord0 unless
@ -114,7 +114,8 @@ bar-foreground-style=
# A string of ASS override tags that get applied only to the cache layer of the
# bar, particularly the part of the cache bar that is behind the current playback
# position. The default sets only the color.
bar-cache-style=\c&H697374&
# bar-cache-style=\c&H697374&
bar-cache-style=\c&7A77F2&
# A string of ASS override tags that get applied only to the cache layer of the
# bar, particularly the part of the cache bar that is after the current playback
@ -122,7 +123,7 @@ bar-cache-style=\c&H697374&
# them. Leaving this blank will leave the style the same as specified by bar-
# cache-style. The split does not account for a nonzero progress-bar-width and may
# look odd when used in tandem with that setting.
bar-cache-background-style=
bar-cache-background-style=\c&H697374&
# A string of ASS override tags that get applied only to the background layer of
# the bar. The default sets only the color.

62
.local/bin/music-convert Executable file
View file

@ -0,0 +1,62 @@
#!/bin/bash
set -e
shopt -s globstar
blue=$(tput setaf 4)
green=$(tput setaf 2)
reset=$(tput sgr0)
bold=$(tput bold)
rootdir="${HOME}/Musique/"
cd "$rootdir"
for dir in **/ $rootdir
do
echo "$bold$dir$reset"
dstdir="${HOME}/Musique.opus/${dir}"
mkdir -p "${dstdir}"
cd "${rootdir}/${dir}"
for file in *
do
if [[ -d "${file}" ]]
then
continue
fi
if [[ "${file}" =~ .flac$ ]]
then
dstfile="$(basename -s .flac "$file").opus"
if [[ -f "${dstdir}${dstfile}" ]]
then
echo "[${blue}SKIP${reset}] $file"
continue
fi
declare -a running
running=($(jobs -p))
if [[ "${#running[@]}" -ge 12 ]]
then
wait -n
fi
(
echo " $file"
ffmpeg -n -loglevel error -i "$file" "file:${dstdir}${dstfile}"
echo "[${green} OK ${reset}] $file"
) &
else
echo "[${green}COPY${reset}] $file"
cp -n --reflink=auto "${file}" "${dstdir}/"
fi
done
wait
done
wait