From cc6f15e24345d2f0b2237d34901f920355ffdeae Mon Sep 17 00:00:00 2001 From: Breizh Date: Sat, 23 Jul 2022 02:26:09 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20script=20conversion=20et=20?= =?UTF-8?q?diverses=20m=C3=A0j?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/conky/conky_mount | 19 ++++---------- .config/conky/conkyrc1 | 31 +++++++++-------------- .config/conky/conkyrc2 | 11 ++++++++ .config/htop/htoprc | 2 +- .config/ranger/scope.sh | 2 +- .config/variety/scripts/set_wallpaper | 36 +++++++++++++++++++++------ .config/yt-dlp/config | 2 ++ .i3blocks/toggle-sink | 4 +-- .local/bin/music-convert | 12 ++++++++- 9 files changed, 73 insertions(+), 46 deletions(-) diff --git a/.config/conky/conky_mount b/.config/conky/conky_mount index 931791f..b7a0d5b 100755 --- a/.config/conky/conky_mount +++ b/.config/conky/conky_mount @@ -1,16 +1,7 @@ #!/bin/bash -if [[ "$1" == "es" ]] -then - for disk in /dev/sd? - do - [[ "$disk" == "/dev/sda" ]] && continue - [[ "$disk" == "/dev/sdb" ]] && echo - echo '${voffset 2}Lecture '$(basename $disk)' ${diskio_read '$(basename $disk)'}${goto 140}Écriture '$(basename $disk)' ${diskio_write '$(basename $disk)'}' - done -else - for dir in /run/media/breizh/* - do - [[ -d "$dir" ]] && echo -e "\${template3 $dir $(basename $dir)}\n\n" - done -fi +for dir in /run/media/breizh/* +do + [[ -d "$dir" ]] && echo -e "\${template3 $dir $(basename $dir)}\n\n" +done + diff --git a/.config/conky/conkyrc1 b/.config/conky/conkyrc1 index a89a1b6..b1c98a1 100644 --- a/.config/conky/conkyrc1 +++ b/.config/conky/conkyrc1 @@ -35,7 +35,7 @@ conky.config = { template0 = [[${cpubar cpu\1 6,125}${goto 140}${cpubar cpu\2}]], template1 = [[${top pid \1} ${top name \1}$alignr${top cpu \1}%]], template2 = [[${top_io pid \1} ${top_io name \1}$alignr${top_io io_perc \1}%]], - template3 = [[${scroll wait 20 1 2 \2} ${goto 140}${if_match ${fs_used_perc \1}>85}${color F2777A}$else${if_match ${fs_used_perc \1}>70}${color FFCC66}$else${color 99CC99}$endif$endif${fs_bar \1}${color}\nUtilisé : ${fs_used \1}${goto 140}Libre: ${fs_free \1}\nTaux ut.: ${fs_used_perc \1}%${goto 140}Total: ${fs_size \1}]] + template3 = [[${scroll wait 20 1 2 \2} ${goto 140}${if_match ${fs_used_perc \1}>90}${color F2777A}$else${if_match ${fs_used_perc \1}>75}${color FFCC66}$else${color 99CC99}$endif$endif${fs_bar \1}${color}\nUtilisé : ${fs_used \1}${goto 140}Libre: ${fs_free \1}\nTaux ut.: ${fs_used_perc \1}%${goto 140}Total: ${fs_size \1}]] }; conky.text = [[ @@ -69,27 +69,22 @@ ${template1 9} ${template1 10} ${color2}${font2}Disque E/S $hr${font}${color} -${voffset 2}Lecture SSD ${diskio_read /dev/disk/by-id/wwn-0x5002538e39c2174e}${goto 140}Écriture SSD ${diskio_write /dev/disk/by-id/wwn-0x5002538e39c2174e} -${diskiograph_read /dev/disk/by-id/wwn-0x5002538e39c2174e 26,125}$alignr${diskiograph_write /dev/disk/by-id/wwn-0x5002538e39c2174e 26,125} -Lecture HDD ${diskio_read /dev/disk/by-id/wwn-0x50014ee0af38f135}${goto 140}Écriture HDD ${diskio_write /dev/disk/by-id/wwn-0x50014ee0af38f135} +${voffset 2}Lecture ssd ${diskio_read /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S4X6NJ0MC09727A}${goto 140}Écriture ssd ${diskio_write /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S4X6NJ0MC09727A} +${diskiograph_read /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S4X6NJ0MC09727A 26,125}$alignr${diskiograph_write /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S4X6NJ0MC09727A 26,125} +Lecture L1V ${diskio_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159L1V}${goto 140}Écriture L1V ${diskio_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159L1V} +${diskiograph_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159L1V 26,125}$alignr${diskiograph_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159L1V 26,125} +Lecture T9F ${diskio_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX32D6123T9F}${goto 140}Écriture T9F ${diskio_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX32D6123T9F} +${diskiograph_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX32D6123T9F 26,125}$alignr${diskiograph_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX32D6123T9F 26,125} +Lecture T0W0 ${diskio_read /dev/disk/by-id/wwn-0x50014ee0af38f135}${goto 140}Écriture T0W0 ${diskio_write /dev/disk/by-id/wwn-0x50014ee0af38f135} ${diskiograph_read /dev/disk/by-id/wwn-0x50014ee0af38f135 26,125}$alignr${diskiograph_write /dev/disk/by-id/wwn-0x50014ee0af38f135 26,125} +Lecture JTP ${diskio_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159JTP}${goto 140}Écriture JTP ${diskio_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159JTP} +${diskiograph_read /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159JTP 26,125}$alignr${diskiograph_write /dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX52D7159JTP 26,125} ${template2 1} ${template2 2} ${template2 3} ${template2 4} ${template2 5} -${color2}${font2}Carte graphique $hr${font}${color} -${voffset 2}Usage${goto 140}${texeci 3 conky_radeon}% -VRAM: ${texeci 3 conky_radeon vram mb}M${goto 140}${texeci 3 conky_radeon vram}% -Temp${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."edge"."temp1_input"'}>70}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."edge"."temp1_input"' | cut -d. -f1}°C${color} -Conso${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."slowPPT"."power1_average"'}>180}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."slowPPT"."power1_average"' | cut -d. -f1} W${color} -Ventilo${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."fan1"."fan1_input"'}>3000}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."fan1"."fan1_input"' | cut -d. -f1} RPM${color} - -${color2}${font2}Système $hr$font$color${voffset 2} -Kernel${goto 140}$kernel -Uptime${goto 140}$uptime - ${color2}${font2}Espace disque $hr${font}${color} ${voffset 2}${template3 / /} @@ -97,13 +92,11 @@ ${template3 /home /home} ${template3 /mnt/data /mnt/data} +${template3 /mnt/backup /mnt/backup} + ${template3 /home/minecraft /home/minecraft} ${template3 /tmp /tmp} -${template3 /dev/shm /dev/shm} - -${template3 /run/user/1000 /run/user/1000} - ${execpi 5 /home/breizh/.config/conky/conky_mount}#${color2}${font2}$hr${font}${color} ]] diff --git a/.config/conky/conkyrc2 b/.config/conky/conkyrc2 index 6dea2d8..6f41f07 100644 --- a/.config/conky/conkyrc2 +++ b/.config/conky/conkyrc2 @@ -77,6 +77,17 @@ ${endif} ${color2}${font2}Capteurs $hr$font$color${voffset 2} CPU${goto 140}${if_match ${execi 5 sensors -j | jq '."zenpower-pci-00c3"."Tdie"."temp1_input"'}>70}${color F2777A}$endif${execi 5 sensors -j | jq '."zenpower-pci-00c3"."Tdie"."temp1_input"' | cut -d. -f1}°C${color} +${color2}${font2}Carte graphique $hr${font}${color} +#${voffset 2}Usage${goto 140}${texeci 3 conky_radeon}% +#VRAM: ${texeci 3 conky_radeon vram mb}M${goto 140}${texeci 3 conky_radeon vram}% +Temp${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."edge"."temp1_input"'}>70}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."edge"."temp1_input"' | cut -d. -f1}°C${color} +Conso${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."PPT"."power1_average"'}>180}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."PPT"."power1_average"' | cut -d. -f1} W${color} +Ventilo${goto 140}${if_match ${execi 5 sensors -j | jq '."amdgpu-pci-2900"."fan1"."fan1_input"'}>3000}${color F2777A}$endif${execi 5 sensors -j | jq '."amdgpu-pci-2900"."fan1"."fan1_input"' | cut -d. -f1} RPM${color} + +${color2}${font2}Système $hr$font$color${voffset 2} +Kernel${goto 140}$kernel +Uptime${goto 140}$uptime + ${color2}${font2}Sylvexplorer $hr$font$color${voffset 2} ${texeci 3600 /home/breizh/.config/conky/sylv.sh} diff --git a/.config/htop/htoprc b/.config/htop/htoprc index 675f8dc..57398e1 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -1,6 +1,6 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. -htop_version=3.2.0 +htop_version=3.2.1 config_reader_min_version=3 fields=0 48 17 18 113 38 39 40 119 111 2 46 47 49 1 hide_kernel_threads=1 diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index a324ee4..95e78c1 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -156,7 +156,7 @@ handle_image() { ## Video video/*) # Thumbnail - ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 + ffmpegthumbnailer -m -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 exit 1;; ## PDF diff --git a/.config/variety/scripts/set_wallpaper b/.config/variety/scripts/set_wallpaper index 4f137f7..60b283b 100755 --- a/.config/variety/scripts/set_wallpaper +++ b/.config/variety/scripts/set_wallpaper @@ -18,6 +18,12 @@ # # $3: The third passed parameter is the absolute path to the original wallpaper image (before effects, clock, etc.) # +# $4: Fourth parameter comes from the display mode setting: "os" means that set_wallpaper should try to +# leave the OS setting unchanged. "zoom" means to try to fill the screen fully with the provided image. +# Other parameters that could be passed are the scaling modes used by GNOME: +# "centered", "scaled", "stretched", "zoom", "spanned", "wallpaper" +# TODO: Ideally all sections below for different DEs would take this setting into account +# # EXAMPLE: # echo "$1" # /home/username/.config/variety/wallpaper/wallpaper-clock-fac0eef772f9b03bd9c0f82a79d72506.jpg # echo "$2" # auto @@ -168,20 +174,28 @@ fi # Gnome 3, Unity gsettings set org.gnome.desktop.background picture-uri "file://$WP" 2> /dev/null gsettings set org.gnome.desktop.background picture-uri-dark "file://$WP" 2> /dev/null -if [ "$(gsettings get org.gnome.desktop.background picture-options)" == "'none'" ]; then +if [[ "$4" =~ ^(wallpaper|centered|scaled|stretched|zoom|spanned)$ ]]; then + gsettings set org.gnome.desktop.background picture-options "$4" +fi +if [ "$(gsettings get org.gnome.desktop.background picture-options)" == "'none'" ]; then gsettings set org.gnome.desktop.background picture-options 'zoom' fi # GNOME Screensaver / Lock screen - thanks to George C. de Araujo for the patch gsettings set org.gnome.desktop.screensaver picture-uri "file://$WP" 2> /dev/null +if [[ "$4" =~ ^(wallpaper|centered|scaled|stretched|zoom|spanned)$ ]]; then + gsettings set org.gnome.desktop.screensaver picture-options "$4" +fi if [ "$(gsettings get org.gnome.desktop.screensaver picture-options)" == "'none'" ]; then gsettings set org.gnome.desktop.screensaver picture-options 'zoom' fi - # Deepin if [ "$(gsettings list-schemas | grep -c com.deepin.wrap.gnome.desktop.background)" -ge 1 ]; then gsettings set com.deepin.wrap.gnome.desktop.background picture-uri "file://$WP" + if [[ "$4" =~ ^(wallpaper|centered|scaled|stretched|zoom|spanned)$ ]]; then + gsettings set com.deepin.wrap.gnome.desktop.background picture-options "$4" + fi if [ "$(gsettings get com.deepin.wrap.gnome.desktop.background picture-options)" == "'none'" ]; then gsettings set com.deepin.wrap.gnome.desktop.background picture-options 'zoom' fi @@ -215,8 +229,10 @@ SIMPLE_WMS=("bspwm" "dwm" "herbstluftwm" "i3" "i3-with-shmlog" "jwm" "LeftWM" "o if [[ " ${SIMPLE_WMS[*]} " = *" $XDG_CURRENT_DESKTOP "* || " ${SIMPLE_WMS[*]} " = *" $XDG_SESSION_DESKTOP "* || " ${SIMPLE_WMS[*]} " = *" $DESKTOP_SESSION "* ]]; then if command -v "feh" >/dev/null 2>&1; then - feh --bg-max "$WP" 2> /dev/null + # TODO: This should take the scaling parameter $4 into account and use other options than --bg-fill + feh --bg-fill "$WP" 2> /dev/null elif command -v "nitrogen" >/dev/null 2>&1; then + # TODO: This should take the scaling parameter $4 into account and use other options than --set-zoom-fill nitrogen --set-zoom-fill --save "$WP" 2> /dev/null fi fi @@ -246,12 +262,21 @@ fi # MATE after 1.6 gsettings set org.mate.background picture-filename "$WP" 2> /dev/null +if [ "$(gsettings get org.mate.desktop.background picture-options 2>/dev/null)" == "'none'" ]; then + gsettings set org.mate.desktop.background picture-options 'zoom' +fi +if [[ "$4" =~ ^(wallpaper|centered|scaled|stretched|zoom|spanned)$ ]]; then + gsettings set org.mate.desktop.background picture-options "$4" +fi # Cinnamon after 2.0 gsettings set org.cinnamon.desktop.background picture-uri "file://$WP" 2> /dev/null if [ "$(gsettings get org.cinnamon.desktop.background picture-options 2>/dev/null)" == "'none'" ]; then gsettings set org.cinnamon.desktop.background picture-options 'zoom' fi +if [[ "$4" =~ ^(wallpaper|centered|scaled|stretched|zoom|spanned)$ ]]; then + gsettings set org.cinnamon.desktop.background picture-options "$4" +fi # Awesome Window Manager # Be sure to start variety when you start awesome, such as by adding it to ~/.xinitrc @@ -263,9 +288,4 @@ fi # ===================================================================================== -# OPTIONAL: Show a notification on automatic wallpaper change. -# Display the original filename in the notification, but actually apply the post-effects image. -# name=$(echo "$3" | sed 's/\//\n/g'| tail -n 1) -# if [ "$2" == "auto" ]; then notify-send --icon "$WP" "Wallpaper changed" "$name" ; fi - exit 0 diff --git a/.config/yt-dlp/config b/.config/yt-dlp/config index c47b24c..ecba7c7 100644 --- a/.config/yt-dlp/config +++ b/.config/yt-dlp/config @@ -1,8 +1,10 @@ -o "%(title)s.%(ext)s" +-P "temp:/tmp" --embed-subs --write-subs --write-auto-subs --sub-lang fr,en +--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" --add-metadata diff --git a/.i3blocks/toggle-sink b/.i3blocks/toggle-sink index d0977db..8133d17 100755 --- a/.i3blocks/toggle-sink +++ b/.i3blocks/toggle-sink @@ -7,10 +7,10 @@ if [[ -n "$button" ]] then if [[ "$currentport" == "Active Port: analog-output-lineout" ]] then - pactl set-sink-port "alsa_output.pci-0000_2b_00.3.analog-stereo" "analog-output-headphones" + pactl set-sink-port "alsa_output.pci-0000_2b_00.3.analog-stereo.5" "analog-output-headphones" echo "casque" else - pactl set-sink-port "alsa_output.pci-0000_2b_00.3.analog-stereo" "analog-output-lineout" + pactl set-sink-port "alsa_output.pci-0000_2b_00.3.analog-stereo.5" "analog-output-lineout" echo "front " fi pkill -RTMIN+10 i3blocks diff --git a/.local/bin/music-convert b/.local/bin/music-convert index 4bc0cad..b0d882b 100755 --- a/.local/bin/music-convert +++ b/.local/bin/music-convert @@ -8,6 +8,7 @@ shopt -s globstar # Initialisation de la mise en forme blue=$(tput setaf 4) green=$(tput setaf 2) +red=$(tput setaf 1) reset=$(tput sgr0) bold=$(tput bold) @@ -58,7 +59,7 @@ do declare -a running running=($(jobs -p)) - if [[ "${#running[@]}" -ge 12 ]] + if [[ "${#running[@]}" -ge 6 ]] then wait -n fi @@ -75,5 +76,14 @@ do fi done wait + ( + 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 $! done wait