Bonjour,
Pour essayer de couper court à l’ambiance et la morosité de l’actualité du moment ( … ), je me suis remis sur la personnalisation du message de notification émis par
notify-send lorsque j’active le switch xfwm4-compton.
Pour cette fois, j’ai réussi à :
- faire varier la transparence des couleurs du fond et/ou de la police de caractères en recourant à certains tags du PangoMarkupLanguage utilisé par
notify-send (
source 1 et
source 2);
- faire clignoter le texte affiché dans la notification, que ce soit le summary et/ou le body de notify-send (
source).
Voici ce que ça donne sur une vue fixe :

et
et, en animation, sur une
capture vidéo.
1)
pour faire varier la transparence de la couleur de la police, j’ai eu recours au tag
fgalpha (abrégeable en
alpha). On peut lui attribuer une valeur comprise entre 0 et 100 %. Je lui ai donné la valeur :
fgalpha="100%"
2)
pour faire varier la transparence de la couleur du fond, j’ai eu recours au tag
background_alpha (abrégeable en
bgalpha). On peut lui attribuer une valeur comprise entre 0 et 100 %. Je lui ai fixé la valeur :
bgalpha="100%"
J’ai apporté ces deux premières modifications aux lignes 8 et 15 du script
switch_xfwm4_compton.sh qui devient donc :
#!/bin/bash
STATUS=$(xfconf-query -c xfwm4 -p /general/use_compositing)
if [ "$STATUS" = "true" ]; then
xfconf-query -c xfwm4 -p /general/use_compositing -s false
compton -b --config $HOME/.config/compton.conf
paplay /usr/share/sounds/sound-icons/glass-water-1.wav
spd-say "compositeur kompetone activé"
notify-send -i file:///home/jlfh0816/.scripts/clef_vide.png "$(echo -e " compositeur")" '<span font="21px" color="red" fgalpha="100%" bgcolor="#000000"><b><i>Compton</i></b></span>'
xfconf-query -c xfce4-notifyd -p /theme -s Perso; sleep 10; xfconf-query -c xfce4-notifyd -p /theme -s Smoke
else
killall compton
xfconf-query -c xfwm4 -p /general/use_compositing -s true
paplay /usr/share/sounds/sound-icons/glass-water-1.wav
spd-say "compositeur X F W M 4 activé"
notify-send 'compositeur' '<span font="21px" color="#0F0" fgalpha="100%"><b><i>xfwm4</i></b></span>' --icon=$HOME/.scripts/clef_vide.png;
xfconf-query -c xfce4-notifyd -p /theme -s Perso; sleep 10; xfconf-query -c xfce4-notifyd -p /theme -s Smoke
fi
3)
pour faire clignoter une partie du texte envoyé par
notify-send (dans mon cas je voulais juste faire clignoter le nom du compositeur, donc seulement xfwm4 / Compton), j’ai modifié la partie ci-dessous du fichier
gtk.css du dossier
xfce-notify-4.0 de mon thème "Perso" de la façon suivante :
#XfceNotifyWindow label#summary {
font-weight: bold;
border-bottom: 2px solid #00DFFF;
}
#XfceNotifyWindow label#body {
font-weight: bold;
animation: blink 1s steps(115, start) infinite;
}
@keyframes blink {
50% {
opacity: 0.0;
color: #00DFFF;
}
}
Ce qui donne au final le nouveau fichier
gtk.css suivant :
#XfceNotifyWindow {
background-color: #111111;
border: 2px solid #00DFFF;
border-radius: 0px;
}
#XfceNotifyWindow .osd {
background-color: #111111;
border: 2px solid #00DFFF;
border-radius: 0px;
}
#XfceNotifyWindow:hover {
background-color: #111111;
border: 2px solid #00DFFF;
border-radius: 0px;
}
#XfceNotifyWindow .osd:hover {
background-color: #111111;
border: 2px solid #00DFFF;
border-radius: 0px;
}
#XfceNotifyWindow label#summary {
font-weight: bold;
border-bottom: 2px solid #00DFFF;
}
#XfceNotifyWindow label#body {
font-weight: bold;
animation: blink 1s steps(115, start) infinite;
}
@keyframes blink {
50% {
opacity: 0.0;
color: #00DFFF;
}
}
#XfceNotifyWindow image {
color: #eeeeee;
animation: bg 0.8s linear infinite;
}
@keyframes bg {
0% {
background-image: url("frames/frame1.png");
}
5% {
background-image: url("frames/frame2.png");
}
10% {
background-image: url("frames/frame3.png");
}
15% {
background-image: url("frames/frame4.png");
}
20% {
background-image: url("frames/frame5.png");
}
25% {
background-image: url("frames/frame6.png");
}
30% {
background-image: url("frames/frame7.png");
}
35% {
background-image: url("frames/frame8.png");
}
40% {
background-image: url("frames/frame9.png");
}
45% {
background-image: url("frames/frame10.png");
}
50% {
background-image: url("frames/frame11.png");
}
55% {
background-image: url("frames/frame12.png");
}
60% {
background-image: url("frames/frame13.png");
}
65% {
background-image: url("frames/frame14.png");
}
70% {
background-image: url("frames/frame15.png");
}
75% {
background-image: url("frames/frame16.png");
}
80% {
background-image: url("frames/frame17.png");
}
85% {
background-image: url("frames/frame18.png");
}
90% {
background-image: url("frames/frame19.png");
}
95% {
background-image: url("frames/frame20.png");
}
100% {
background-image: url("frames/frame21.png");
}
}
#XfceNotifyWindow button {
background-image: none;
background-color: shade(#686868, 0.5);
color: #fcfcfc;
border-color: shade(#fcfcfc, 0.35);
border-radius: 3px;
}
#XfceNotifyWindow progressbar {
border-radius: 1px;
}
#XfceNotifyWindow progressbar progress {
min-height: 8px;
background-image: none;
background-color: shade(#4084D6, 1.2);
}
#XfceNotifyWindow progressbar trough {
min-height: 10px;
background-image: none;
background-color: #000000;
border: 1px solid shade(#000000, 0.6);
border-radius: 1px;
}
Au titre des limites de cette bidouille de clignotement, il m’a fallu renoncer à :
- l’animation
slide-out des messages de notification car elle devient saccadée ;
- à l’inclusion des hyperliens en bas du message affiché pour Compton car sinon ils clignotent en même temps que le nom Compton...
Bon courage à tout le monde pour le confinement !