« Commandeur de minuit », v. 4.8.19

Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

Rebonjour, la compagnie !

Voici un 2e script pour lancer Midnight Commander, inspiré de la suggestion
d'Argolance ci-dessus.

Sur mon ordi, rien à faire, beep ne fonctionne pas.

Alors j'ai concocté une onde carrée avec sox. Rien de bien original, les recettes se
trouvent ici et là dans Internet.

Code: Select all

sox -n notette7.wav synth 0.20 square 111
(C'est un la en clé de fa, 1er espace, que peut chanter un bariton ou une basse,
mais avec un vague timbre de clarimette. Oui-oui, de « clarimette ». :lol: Didier a
fait bien pire sur le fil DeepL !!!) MDR

Ensuite, à l'exécution, on module ce son avec l'utilitaire play de sox:

Code: Select all

play notette7.wav echos 0.8 0.7 700.0 0.25 900.0 0.3 chorus 0.7 0.9 55.0 0.4 0.25 2.0 -t
en se servant des effets chorus et echos.

Il faut, bien sûr, avoir le progiciel sox sur son Toutou. (2e de la liste)
http://augras.eu/puppy_linux/?dir=mushe ... et_Musique

Sinon, aplay jouera ce court la grave sans effet sonore.

Finalement, il faut aemenu. Un petit menu pour fermer MC s'affichera si MC est
en activité. (Voir illustration.)

Alors voici :

Code: Select all

#!/bin/sh
# mc2.sh # Pour lancer Midnight Commander
# Dép. : / Dep.: awk, aemenu ordinaire, aplay.  # Optionnel : / Optional: play (from / de sox)
#
# © Christian L'Écuyer, Gatineau (Qc), Canada, 30 août 2016 # (Alias musher0 [forum Puppy].)
# Rév.  15 sept. 2016; 19 et 27 févr. 2017, 21 nov. 2017.
################# # https://opensource.org/licenses/GPL-3.0
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    	This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    	You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
##########
#    Ce programme est libre : vous pouvez le redistribuer ou modifier
#    selon les termes de la Licence Publique Générale GNU publiée par la
#    Free Software Foundation (v. 3 ou toute version ultérieure choisie par
#    vous).
#        Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS
#    AUCUNE GARANTIE, ni explicite ni implicite, y compris des garanties de
#    commercialisation ou d'adaptation à un but spécifique. Pour obtenir plus
#    de détails, veuillez vous reporter au texte de cette licence à
#    https://opensource.org/licenses/GPL-3.0 pour le texte officiel, à
#    http://www.linux-france.org/article/these/gpl.html pour une traduction et à
#    https://fr.wikipedia.org/wiki/Licence_publique_générale_GNU pour une
#    explication en français.
################
psawk () { ps | awk '$4=="mc" { print $1 }'; }

if [ "`psawk`" ];then # Si actif / If active
	if [ -f /usr/bin/sox ];then
		play -q /usr/share/audio/notette5.wav echos 0.8 0.7 700.0 0.25 900.0 0.3 chorus 0.7 0.9 55.0 0.4 0.25 2.0 -t &
	else
		aplay /usr/share/audio/notette5.wav &
	fi

	echo -e "	cmd \"   _________________________\" \" \"
menu \"-=> MC est en activité. <=- \"
	cmd \" \" \" \"
	cmd \"Si oui, cliquer sur la ligne ci-contre.\" \" \"
#	cmd \"          sinon, cliquer ailleurs.\" \" \"
	cmd \" \" \" \"
end
cmd \"            Fermer MC ?           \" \"killall -q mc\"
cmd \"         -------------------\" \" \"" > /tmp/menuMC # -s 9 `psawk`\""
	aemenu -rc /tmp/menuMC 2>/dev/null
	rm -f /tmp/menuMC

else # Sinon
	FnT="fn xft:Monaco:pixelsize=14:antialias=true:autohint=true"
# Monaco # LiberationMono # DejaVuSansMono # ok
	FadE="fade 70 -fadecolor "#94A495""
	TrnsP="tr -sh 45 -tint bisque4"
	ColoR="fg cornsilk -bg SaddleBrown -cr green"
	IcoN="icon /usr/share/icons/MidnightCommander.png"
	HoriZ="`xwininfo -root | awk '$1=="Width:" { print $2/6 }'`"
	GeoM="g 133x37+$HoriZ+110";BrdR="sr +st -b 20"

#	wmctrl -s 1 # optionnel
# Avec transparence :
	urxvt +sb -$IcoN -$FnT -$TrnsP -$GeoM -$ColoR -bc -$BrdR +tcw -e mc /mnt/home /root/.wmx
# "$@"
# Sans :
#	urxvt +sb -$IcoN -$FnT +tr -$GeoM -$ColoR -bc -$BrdR +tcw -e mc /mnt/home /root/.wmx
# "$@"
fi
Bonne fin de journée !
Attachments
mc2.sh.zip
Le script ci-dessus, zippé. Déballer dans /root/my-applications/bin et rendre exécutable.
(1.83 KiB) Downloaded 57 times
Fermer-MC-2.jpg
(135.19 KiB) Downloaded 60 times
notette5.wav.zip
Déballer dans /usr/share/audio.
(1.3 KiB) Downloaded 56 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

did18
Posts: 417
Joined: Wed 19 Nov 2014, 22:27

#22 Post by did18 »

Bonjour
Didier a fait bien pire sur le fil DeepL !!!) MDR
Ce n'est pas de ma faute, c'est ma "boite à 1" qui a fait des sienne...
Elle a probablement attrapé un coup de froid, heu... Un virus... ça semble logique ne cette saison.

Bonne journée.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#23 Post by musher0 »

did18 wrote:Bonjour
Didier a fait bien pire sur le fil DeepL !!!) MDR
Ce n'est pas de ma faute, c'est ma "boite à 1" qui a fait des sienne...
Elle a probablement attrapé un coup de froid, heu... Un virus... ça semble logique ne cette saison.

Bonne journée.
:lol: ;)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply