Questions générales sur Manjaro Linux.
S'il vous plaît, avant de poster, essayez la fonction de recherche du forum.
#1Messageil y a 4 ansBonjour,
Je cherche un moyen simple d'avoir un rappel pour des évènements et je suis tombé sur ce script : https://brettterpstra.com/2016/01/22/qu ... -terminal/ et https://gist.github.com/ttscoff/cded212ec4dd457186ca .
Il fonctionne, je peux ajouter un rappel en tapant dans un terminal "dontforget test 1h" ; ce qui est censé me rappeler l'évènement "test" dans une heure.
Cependant, le rappel a une erreur, j'obtiens ceci dans mon terminal au moment du rappel :
/usr/local/bin/dontforget: line 96: /usr/bin/afplay: No such file or directory
/usr/local/bin/dontforget: line 97: say: command not found
Quand je regarde le script je vois :
/usr/bin/afplay /System/Library/Sounds/Glass.aiff
say "$reminder
"
Mais je n'ai pas afplay, d'où l'erreur, comment faire alors ?
Merci. --
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
Dernière modification par
damien674il y a 4 ans, modifié au total 2 fois.
#2Messageil y a 4 ansbonjour,
cette ligne n'est que pour jouer un son donc peut-être commentée si pas utile pour toi
je suppose que tu n'as pas Glass.aiff ni afplay ? tu peux remplacer par pas mal de commandes (si installée) comme par exemple
mpg123 "~/Musique/Linux - my best ring.mp3" &
cvlc "~/Musique/Linux - my best ring.mp3" &
...
-----
Avec le paquet at
installé et service "atd" lancé, il est possible de faire une simple commande pour lancer une notification gui à 13h40
echo 'notify-send -t 9000 "toto"' | at 13:40
Manjaro STABLE - Linux lts - fish - Kde6/x11 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
#3Messageil y a 4 ansMerci!
Comment rendre la notification persistante avec
echo 'notify-send -t 9000 "toto"' | at 14:26
? --
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#4Messageil y a 4 ansAvec at, je ne sais pas faire, mais personnellement, j'utilise ma crontab pour des tâches à répéter périodiquement.
Commande crontab -e
pour ouvrir la crontab en édition.
Ajout des lignes suivantes :
DISPLAY=0.0
XAUTHORITY=$HOME/.Xauthority
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/<id_a_remplacer>/bus
46 14 * * * /usr/bin/notify-send -t 9000 "toto"
donnera la notification "toto" tous les jours à 14h46.
Les 5 1ere champs permettent de jouer avec le temps pour définir le type de répétition (minute, heure, jour du mois, mois, jour de la semaine). Il y a pléthore de combinaison, une recherche internet te donnera moult exemple si cela t'intéresse.
env | grep DBUS_SESSION_BUS_ADDRESS
te donnera la bonne valeur de la variable. Desktop - Manjaro 20.2 Nibia - Xfce4 - x86_64 Linux 5.4
Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
Intel 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
Intel 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
Dual Boot avec W10
#5Messageil y a 4 ans>persistante
il suffit de jouer avec l'option -t (-t 9000 = 9 secondes), avec -t 0
la notification reste
man notify
man fr de at . Avec at pas de répétitions comme cron (pas de répétition avec ton script) Manjaro STABLE - Linux lts - fish - Kde6/x11 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
#6Messageil y a 4 ans il suffit de jouer avec l'option -t (-t 9000 = 9 secondes), avec -t 0 la notification reste
Merci, parfait.--
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#7Messageil y a 4 ans--
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#8Messageil y a 4 ansun script pour faire plus simple à l'utilisation
#!/usr/bin/bash
#set -x
# lancer service "at" si non lancé
systemctl is-active atd -q || sudo systemctl start atd
title="${1:-Entrer un paramètre}"
temps="${2:-60minutes}"
if [[ "$2" =~ ":" ]]; then
verb=""
else
verb="now + "
fi
echo "notify-send -t 0 \"${title}\" -i \"$HOME/.face\" " | at ${verb} ${temps}
# ou avec du son ?
#echo "notify-send -t 0 \"${title}\" -i \"$HOME/.face\" && mpg123 \"$HOME/Musique/Ring.mp3\" " | at ${verb} ${temps}
# verif
at -l
utilisation :
notif "pause film" 21:05
notif "une pause dans peu de temps" 45minutes
notif "(encore) une pause en fin de journée" 2hours
notif "par defaut ici c'est dans une heure si temps non donné en param 2"
Manjaro STABLE - Linux lts - fish - Kde6/x11 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
#9Messageil y a 4 ansEt bien je suis bon pour retourner suivre des cours de français! 
Desktop - Manjaro 20.2 Nibia - Xfce4 - x86_64 Linux 5.4
Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
Intel 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
Intel 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
Dual Boot avec W10
#10Messageil y a 4 ansfbe a écrit : ↑il y a 4 ans
Et bien je suis bon pour retourner suivre des cours de français!

Pourquoi ? Je ne comprends pas...--
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#11Messageil y a 4 anspapajoke a écrit : ↑il y a 4 ans
un script pour faire plus simple à l'utilisation
Merci beaucoup @papajoke , ça marche très bien!--
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#12Messageil y a 4 ansdamien674 a écrit : ↑il y a 4 ans
Pourquoi ? Je ne comprends pas...
comme fbe je n'étais pas sûr de ta demande ...
Tu désirais la persistance des popup de notification ou la persistance de la demande (il était dit dans ton article que la fermeture du terminal annulait la demande)
Puisque fbe à compris une chose, j'ai simplement répondu (au cas où) à une autre pour être complémentaire avec fbe
Pour moi, avec cron, nous sommes plus dans la gestion d'un calendrier et cela existe comme applicationManjaro STABLE - Linux lts - fish - Kde6/x11 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
#13Messageil y a 4 ansAh, je vois. Je souhaitais la persistance de la popup de notification. C'est assez pratique ton script, car souvent j'ai des rappels d'évènements tout au long de la journée et je peux ainsi les ajouter facilement. Merci encore. --
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#14Messageil y a 1 moisBonjour,
Je rouvre ce sujet car le script de @papajoke
#!/usr/bin/bash
#set -x
# lancer service "at" si non lancé
systemctl is-active atd -q || sudo systemctl start atd
title="${1:-Entrer un paramètre}"
temps="${2:-60minutes}"
if [[ "$2" =~ ":" ]]; then
verb=""
else
verb="now + "
fi
echo "notify-send -t 0 \"${title}\" -i \"$HOME/.face\" " | at ${verb} ${temps}
# ou avec du son ?
#echo "notify-send -t 0 \"${title}\" -i \"$HOME/.face\" && mpg123 \"$HOME/Musique/Ring.mp3\" " | at ${verb} ${temps}
# verif
at -l
ne marche plus depuis deux jours et ce sans aucune raison.
Il m'était bien pratique pour ajouter, par exemple, un rappel en tapant dans un terminal :
notif "ouvrir cave" 16:50
Merci de vos conseils.
Actuellement, quand je tape :
notif "ouvrir cave" 16:50
j'obtiens dans le terminal :
~ > notif "ouvrir cave" 16:50
warning: commands will be executed using /bin/sh
job 77 at Sun Mar 16 16:50:00 2025
71 Mon Mar 17 12:08:00 2025 a arnauld
75 Mon Mar 17 12:17:00 2025 a arnauld
77 Sun Mar 16 16:50:00 2025 a arnauld
~ >
Mais la notification à l'heure demandée ne s'affiche plus. --
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]
#15Messageil y a 1 moisManjaro STABLE - Linux lts - fish - Kde6/x11 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
#16Messageil y a 1 moisMerci beaucoup @papajoke !
Malheureusement cela ne fonctionne toujours pas pour moi et là je n'ai pas le temps de m'en occuper, je chercherai plus tard... si je trouve…
Incroyable d'être notifié également par SMS ! Mais je suis chez Orange, j'imagine qu'avec Orange, c'est niet.
Bonne journée. --
damien
System: hppaviliondv7notebookpc Kernel: 5.9.3-1-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4
Machine: HP Pavilion dv7
BIOS: Hewlett-Packard v: F.13 date: 12/03/2009
CPU: Dual Core model: Intel Core i3 M 330
Graphics: NVIDIA GT218M [GeForce G 105M]