j'apprécie le menu contextuel d'XFCE "Ouvrir dans un terminal"
j'aimerais ajouter un item à ce menu contextuel "Ouvrir dans un navigateur".
le script prendrait le PATH de l'élément sélectionné et enverrait :
- file://<LE PATH> si le fichier n'est pas "sous Apache2" ;
- http://localhost/<LE" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/<LE PATH relatif sous Apache2> dans le cas contraire.
à xdg-open.
Comment fait-on ça ?
j'apprécie le menu contextuel d'XFCE "Ouvrir dans un terminal"
j'aimerais ajouter un item à ce menu contextuel "Ouvrir dans un navigateur".
le script prendrait le PATH de l'élément sélectionné et enverrait :
- file://<LE PATH> si le fichier n'est pas "sous Apache2" ;
- http://localhost/<LE PATH relatif sous Apache2> dans le cas contraire.
à xdg-open.
Comment fait-on ça ?
j'apprécie le menu contextuel d'XFCE "Ouvrir dans un terminal"
j'aimerais ajouter un item à ce menu contextuel "Ouvrir dans un navigateur".
le script prendrait le PATH de l'élément sélectionné et enverrait :
- file://<LE PATH> si le fichier n'est pas "sous Apache2" ;
- http://localhost/<LE" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/<LE PATH relatif sous Apache2> dans le cas contraire.
à xdg-open.
Comment fait-on ça ?
Essaye ceci :
*base*
nom : ce que tu veux
description : ce que tu veux
commande :
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/')
en supposant que ta racine pour apache soit bien varwwwhtdocs sinon
ajuster en conséquence
*conditions d'apparition*
sélectionner tous les cas
Essaye ceci :
*base*
nom : ce que tu veux
description : ce que tu veux
commande :
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/')
en supposant que ta racine pour apache soit bien varwwwhtdocs sinon
ajuster en conséquence
*conditions d'apparition*
sélectionner tous les cas
Essaye ceci :
*base*
nom : ce que tu veux
description : ce que tu veux
commande :
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/')
en supposant que ta racine pour apache soit bien varwwwhtdocs sinon
ajuster en conséquence
*conditions d'apparition*
sélectionner tous les cas
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/')
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
Le 14/12/2012 00:55, mcc a écrit :firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
encore merci, ça marche super bien.
j'ai juste un peu modifié pour avoir le butineur par défaut :
xdg-open $(echo %f |sed 's//home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
bon, question subsidiaire :
si je veux ouvrir une page html dans un butineur mais une page qui n'est
pas dans le rép de mon site ('/home/yt/Sites'), je peux l'ouvrir par :
file:///path/absolu/du/fichier.html
est-ce qu'avec sed, que je ne connais pas je peux faire ça aussi, avec
la même commande.
Une astuce à laquelle je pense :
ajouter systématiquement à %f "file://" et changer le sed en :
xdg-open $(echo %f |sed 's/file:///home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
mais je ne sais pas manipuler %f, ça se fait comme une variable de login
script, du genre :
xdg-open $(echo file://%f |sed 's//home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
ça marcherait ça ?
Le 14/12/2012 00:55, mcc a écrit :
firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/')
encore merci, ça marche super bien.
j'ai juste un peu modifié pour avoir le butineur par défaut :
xdg-open $(echo %f |sed 's//home/yt/Sites/http://localhost/')
bon, question subsidiaire :
si je veux ouvrir une page html dans un butineur mais une page qui n'est
pas dans le rép de mon site ('/home/yt/Sites'), je peux l'ouvrir par :
file:///path/absolu/du/fichier.html
est-ce qu'avec sed, que je ne connais pas je peux faire ça aussi, avec
la même commande.
Une astuce à laquelle je pense :
ajouter systématiquement à %f "file://" et changer le sed en :
xdg-open $(echo %f |sed 's/file:///home/yt/Sites/http://localhost/')
mais je ne sais pas manipuler %f, ça se fait comme une variable de login
script, du genre :
xdg-open $(echo file://%f |sed 's//home/yt/Sites/http://localhost/')
ça marcherait ça ?
Le 14/12/2012 00:55, mcc a écrit :firefox $(echo %f |sed 's//var/www/htdocs/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
encore merci, ça marche super bien.
j'ai juste un peu modifié pour avoir le butineur par défaut :
xdg-open $(echo %f |sed 's//home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
bon, question subsidiaire :
si je veux ouvrir une page html dans un butineur mais une page qui n'est
pas dans le rép de mon site ('/home/yt/Sites'), je peux l'ouvrir par :
file:///path/absolu/du/fichier.html
est-ce qu'avec sed, que je ne connais pas je peux faire ça aussi, avec
la même commande.
Une astuce à laquelle je pense :
ajouter systématiquement à %f "file://" et changer le sed en :
xdg-open $(echo %f |sed 's/file:///home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
mais je ne sais pas manipuler %f, ça se fait comme une variable de login
script, du genre :
xdg-open $(echo file://%f |sed 's//home/yt/Sites/http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://localhost/')
ça marcherait ça ?
Tu peux tout simplement l'ouvrir avec un clic droit et "ouvrir avec" ou
encore plus simplement, directement avec un clic gauche si c'est avec le
navigateur par défaut.
Mais on parle bien d'une page html (ou d'une image), pas d'une page php.
Si tu utilises la commande précédente xdg-open... avec une page qui
n'est pas dans le chemin du serveur Apache tu constates que celà
l'ouvre avecfile:///home/...
Tu peux tout simplement l'ouvrir avec un clic droit et "ouvrir avec" ou
encore plus simplement, directement avec un clic gauche si c'est avec le
navigateur par défaut.
Mais on parle bien d'une page html (ou d'une image), pas d'une page php.
Si tu utilises la commande précédente xdg-open... avec une page qui
n'est pas dans le chemin du serveur Apache tu constates que celà
l'ouvre avecfile:///home/...
Tu peux tout simplement l'ouvrir avec un clic droit et "ouvrir avec" ou
encore plus simplement, directement avec un clic gauche si c'est avec le
navigateur par défaut.
Mais on parle bien d'une page html (ou d'une image), pas d'une page php.
Si tu utilises la commande précédente xdg-open... avec une page qui
n'est pas dans le chemin du serveur Apache tu constates que celà
l'ouvre avecfile:///home/...