#!/bin/sh
#
# date-menu.sh
#
# This is in the public domain. Honestly, how can you claim anything to something
# this simple?
#
# Outputs a simple openbox pipe menu to display the date, time, and calendar.
# You need 'date' and 'cal'. You should have these. Additionally, the calendar
# only appears properly formated if you use a mono spaced font.
# Outputs the selected row from the calender output.
# If you don't use a mono spaced font, you would have to play with spacing here.
# It would probably involve a very complicated mess. Is there a way to force a
# different font per menu?
function calRow() {
cal | gawk -v row=$1 '{ if (NR==row) { print $0 } }'
}
# Build the menu
cat << EOFMENU
<openbox_pipe_menu>
<separator label="`date +%A\ \ \ \ \ \ \ \ \ \ \ \ %I\:%M\ %p`" />
<item label="`date +%B\ %d,\ %Y`" />
<separator />
<item label="`calRow 2`" />
<item label="`calRow 3`" />
<item label="`calRow 4`" />
<item label="`calRow 5`" />
<item label="`calRow 6`" />
<item label="`calRow 7`" />
<item label="`calRow 8`" />
</openbox_pipe_menu>
EOFMENU
J'ai bien mis le fichier date-menu.sh dans ~/.config/openbox/scripts/ et je l'ai bien passé en exécutable. Pourtant, ça me donne:
Euh... je ne suis pas sûr de comprendre ce que tu veux dire.
Si par hasard c'est : je mets mes scripts dans un répertoire donné et j'attends que ça marche tout seul avec la config d'origine, ben c'est pas ça. N'y vois pas d’offense. Fait voir ton .config/openbox/menu.xml
dans le menu.xml et fais un chmod +x dessus sans que ça ne change rien. Je précise qu'un autre script openbox pour avoir les infos du système fonctionne bien.
KDE Plasma sur
- fixe Intel Core i5-4570 CPU @ 3.20GHz × 4 - RAM 12 Go - Carte graphique GeForce GTX 750 Ti NV117 - Écran 24" et 23" hdmi
- Lenovo IdeaPad 3 15ALC6 - 15.6" - Ryzen 5 5500U - 16 Go RAM - 128 Go SSD + 1 To HDD
- Lenovo Ideapad S130-14IGM
#!/bin/sh
#
# date-menu.sh
#
# This is in the public domain. Honestly, how can you claim anything to something
# this simple?
#
# Outputs a simple openbox pipe menu to display the date, time, and calendar.
# You need 'date' and 'cal'. You should have these. Additionally, the calendar
# only appears properly formated if you use a mono spaced font.
# Outputs the selected row from the calender output.
# If you don't use a mono spaced font, you would have to play with spacing here.
# It would probably involve a very complicated mess. Is there a way to force a
# different font per menu?
function calRow() {
cal | gawk -v row=$1 '{ if (NR==row) { print $0 } }'
}
# Build the menu
cat << EOFMENU
<openbox_pipe_menu>
<separator label="`date +%A\ \ \ \ \ \ \ \ \ \ \ \ %I\:%M\ %p`" />
<item label="`date +%B\ %d,\ %Y`" />
<separator />
<item label="`calRow 2`" />
<item label="`calRow 3`" />
<item label="`calRow 4`" />
<item label="`calRow 5`" />
<item label="`calRow 6`" />
<item label="`calRow 7`" />
<item label="`calRow 8`" />
</openbox_pipe_menu>
EOFMENU
KDE Plasma sur
- fixe Intel Core i5-4570 CPU @ 3.20GHz × 4 - RAM 12 Go - Carte graphique GeForce GTX 750 Ti NV117 - Écran 24" et 23" hdmi
- Lenovo IdeaPad 3 15ALC6 - 15.6" - Ryzen 5 5500U - 16 Go RAM - 128 Go SSD + 1 To HDD
- Lenovo Ideapad S130-14IGM
1) tu utilises exactement le menu que tu nous a passé, rectifié des 2 erreurs signalées ?
2) le chemin vers le script est correct et le script lui-même est exécutable ?
Si tout ça est correct il n'y a aucune raison que ça ne fonctionne pas. Revérifie tout.
le message d'erreur est fichier non trouvé, c'est ça ? C'est le message que j'avais avant d'enlever le < excédentaire.
Quelle est la sortie de /home/christian/.config/openbox/script/date-menu.sh
Tape juste ceci dans un terminal, je ne veux pas le contenu du fichier mais la sortie de cette commande
OK les gars, j'ai trouvé l'erreur. Elle venait de mon date-menu.sh. Je l'ai créé en allant sur la page http://openbox.org/wiki/Openbox:Pipemenus:Date_Menu Là, j'ai sélectionné tout le texte puis copier coller dans mon date-menu.sh et ça ne fonctionnait pas. Le problème est que ce copier/coller m'a laissé un espace en début de chaque ligne. En supprimant cet espace, plus de problème.
Désolé pour le dérangement et merci pour tout.
Erreur stupide
KDE Plasma sur
- fixe Intel Core i5-4570 CPU @ 3.20GHz × 4 - RAM 12 Go - Carte graphique GeForce GTX 750 Ti NV117 - Écran 24" et 23" hdmi
- Lenovo IdeaPad 3 15ALC6 - 15.6" - Ryzen 5 5500U - 16 Go RAM - 128 Go SSD + 1 To HDD
- Lenovo Ideapad S130-14IGM
#!/bin/sh
#
# date-menu.sh
#
# This is in the public domain. Honestly, how can you claim anything to something
# this simple?
#
# Outputs a simple openbox pipe menu to display the date, time, and calendar.
# You need 'date' and 'cal'. You should have these. Additionally, the calendar
# only appears properly formated if you use a mono spaced font.
# Outputs the selected row from the calender output.
# If you don't use a mono spaced font, you would have to play with spacing here.
# It would probably involve a very complicated mess. Is there a way to force a
# different font per menu?
function calRow() {
cal | gawk -v row=$1 '{ if (NR==row) { print $0 } }'
}
# Build the menu
cat << EOFMENU
<openbox_pipe_menu>
<separator label="`date +%A\ \ \ \ \ \ \ \ \ \ \ \ %I\:%M\ %p`" />
<item label="`date +%B\ %d,\ %Y`" />
<separator />
<item label="`calRow 2`" />
<item label="`calRow 3`" />
<item label="`calRow 4`" />
<item label="`calRow 5`" />
<item label="`calRow 6`" />
<item label="`calRow 7`" />
<item label="`calRow 8`" />
</openbox_pipe_menu>
EOFMENU
@benjarobin bientôt ... j'espère!
KDE Plasma sur
- fixe Intel Core i5-4570 CPU @ 3.20GHz × 4 - RAM 12 Go - Carte graphique GeForce GTX 750 Ti NV117 - Écran 24" et 23" hdmi
- Lenovo IdeaPad 3 15ALC6 - 15.6" - Ryzen 5 5500U - 16 Go RAM - 128 Go SSD + 1 To HDD
- Lenovo Ideapad S130-14IGM
# If you don't use a mono spaced font, you would have to play with spacing here.
# It would probably involve a very complicated mess. Is there a way to force a
# different font per menu??
Si je comprends la traduction google, il me faut utiliser une police mono. Question, comment fait-on?
KDE Plasma sur
- fixe Intel Core i5-4570 CPU @ 3.20GHz × 4 - RAM 12 Go - Carte graphique GeForce GTX 750 Ti NV117 - Écran 24" et 23" hdmi
- Lenovo IdeaPad 3 15ALC6 - 15.6" - Ryzen 5 5500U - 16 Go RAM - 128 Go SSD + 1 To HDD
- Lenovo Ideapad S130-14IGM