Outils pour utilisateurs

Outils du site


issue151:tutoriel1

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
issue151:tutoriel1 [2019/11/30 13:47] – créée auntieeissue151:tutoriel1 [2019/12/06 09:16] auntiee
Ligne 1: Ligne 1:
-Welcome back! In this issue, we continue our automation journey. This part will be a short one as I need to break it into two pieces. If you have just joined us, we are automating things in Ubuntu. Last time, I asked you to open your menu with the mouse and click on your terminal to launch that. Did you manage to do it? If not, have a look at what I did.+**Welcome back! In this issue, we continue our automation journey. This part will be a short one as I need to break it into two pieces. If you have just joined us, we are automating things in Ubuntu. Last time, I asked you to open your menu with the mouse and click on your terminal to launch that. Did you manage to do it? If not, have a look at what I did.
  
-My screen is 1600x 900, and my menu button for my Whisker Menu is in the top left. Though 0,0 is the topmost left spot, this does not open my menu, so I move the mouse slightly to 5,5. My menu also has its panels swapped around, so moving my mouse diagonally changes the menu layout as my mouse would move over different sections, changing the other panel. To overcome this, I first move my mouse slightly – onto the menu, then across, then down, before clicking on the terminal. (OR one could use key presses, but I wanted you to see a problem and fix a problem on your own). There are many ways to skin a cat in Linux, so if you did it another way, congratulations. +My screen is 1600x 900, and my menu button for my Whisker Menu is in the top left. Though 0,0 is the topmost left spot, this does not open my menu, so I move the mouse slightly to 5,5. My menu also has its panels swapped around, so moving my mouse diagonally changes the menu layout as my mouse would move over different sections, changing the other panel. To overcome this, I first move my mouse slightly – onto the menu, then across, then down, before clicking on the terminal. (OR one could use key presses, but I wanted you to see a problem and fix a problem on your own). There are many ways to skin a cat in Linux, so if you did it another way, congratulations. **
  
-I know some of you have already figured out that this tool can be used for clicking in farmville or whatever clicker is the rage these daysThat is good; it means you are applying a solution to a problemWe will look at this kind of thing in a later issue; for nowI want to get beginners to Ubuntu, or those of you who have not even heard of ‘xdotool’, up to speedObviouslyI cannot imagine or show you every use case, we have only twelve issues per year. My goal is to spark your imagination and let your creative side take the reigns.+Re-bonjour ! Dans ce numéro, nous continuons notre voyage dans l'automatisationCette partie sera courte car je dois la couper en deuxSi vous venez juste de nous rejoindrenous automatisons des choses dans Ubuntu. La dernière foisje vous ai demandé d'ouvrir votre menu avec la souris et un clic en les lançant à partir de votre terminalL'avez-vous fait ? Si nonregardez ce que j'ai fait.
  
-Up to now we have been using mousepad as an exampleWhat if you do not know the name of the window you want to work with? That is where another tool comes in handy – wmctrl. Your homework: please go to the man page and look at the very first example. That’s what we will be doing to get the info on open windows. This will not only list windowsbut panels and docks toowhich is very handy. The number on the left is the window IDThis will be important laterfor nowjust know where to find itBack to our journey. We have clicked the menu buttonbut we could also open it with a keyboard combination. (In my casectrl+esc on Xubuntu). We can even go directly to the terminal via the terminal shortcut whatever you set it to be in your system.+Mon écran est en 1600 x 900 et le bouton du menu Whisker est en haut à gaucheBien que 0,0 soit le point le plus en haut à gaucheça n'ouvre pas mon menu ; aussi, je déplace légèrement la souris à 5,5Les panneaux du menu permutent aussi, le déplacement de ma souris en diagonale modifie la poindisposition du menu car la souris passera au-dessus de différentes rubriqueschangeant le second panneauPour résoudre cela, je bouge d'abord ma souris légèrement - pour être sur le menu, puis en travers, puis vers le bas, avant de cliquer sur le terminal. (OU, on peut utiliser des appuis sur des touches, mais je voulais que vous voyiez un problème et le résolviez par vous-même). Il y a de nombreuses façons de plumer un canard dans Linux aussi, si vous l'avez fait d'une autre manière, félicitations.
  
-BUT WAIT, THERE'S MORE...+**I know some of you have already figured out that this tool can be used for clicking in farmville or whatever clicker is the rage these days. That is good; it means you are applying a solution to a problem. We will look at this kind of thing in a later issue; for now, I want to get beginners to Ubuntu, or those of you who have not even heard of ‘xdotool’, up to speed. Obviously, I cannot imagine or show you every use case, we have only twelve issues per year. My goal is to spark your imagination and let your creative side take the reigns. 
 + 
 +Up to now we have been using mousepad as an example. What if you do not know the name of the window you want to work with? That is where another tool comes in handy – wmctrl. Your homework: please go to the man page and look at the very first example. That’s what we will be doing to get the info on open windows. This will not only list windows, but panels and docks too, which is very handy. The number on the left is the window ID. This will be important later; for now, just know where to find it. Back to our journey. We have clicked the menu button, but we could also open it with a keyboard combination. (In my case, ctrl+esc on Xubuntu). We can even go directly to the terminal via the terminal shortcut ; whatever you set it to be in your system.** 
 + 
 +Je sais que certains d'entre vous ont déjà compris que cet outil peut être utilisé dans farmville ou je ne sais quel « clicker » en vogue ces jours-ci. C'est bien ; cela signifie que vous mettez en œuvre une solution à un problème. Nous verrons cette sorte de chose dans un prochain numéro ; pour le moment, je veux que les débutants sur Ubuntu, ou ceux d'entre vous qui n'ont jamais entendu parlé de « xdotool » se mettent rapidement à niveau. Bien sûr, je ne peux pas imaginer ou vous montrer tous les cas d'utilisation ; nous n'avons que douze numéros par an. Mon but est de créer l'étincelle dans votre imagination et de laisser votre créativité prendre les commandes. 
 + 
 +Jusqu'ici, nous avons utilisé mousepad comme exemple. Que se passe-t-il si vous ne connaissez pas le nom de la fenêtre avec laquelle vous voulez travailler ? C'est là qu'un autre outil est pratique - wmctrl. Vos devoirs du soir : allez, s'il vous plaît, sur la page man et regardez le tout premier exemple. C'est ce que nous ferons pour obtenir des informations sur les fenêtres ouvertes. Non seulement il liste les fenêtres, mais aussi les panneaux et les docks, ce qui est très pratique. Le numéro à gauche est le numéro d'identification (ID) de la fenêtre. Il aura son importance par la suite ; pour le moment, sachez juste où il se trouve. Revenons à notre voyage. Nous avons cliqué sur le bouton du menu, mais nous pouvons aussi l'ouvrir avec une combinaison de touches. (Dans mon cas, ctrl+esc dans Xubuntu). Nous pouvons même aller directement dans le terminal par le raccourci du terminal (sa valeur dépendant du paramétrage que vous avez fait dans votre système). 
 + 
 +**BUT WAIT, THERE'S MORE...
  
 The ‘xdotool’ can be used to set up mouse gestures and hot corners on your XFCE system to behave like GNOME. Open a terminal and type:  The ‘xdotool’ can be used to set up mouse gestures and hot corners on your XFCE system to behave like GNOME. Open a terminal and type: 
Ligne 16: Ligne 24:
 xdotool behave_screen_edge top-left exec xfce4-popup-whiskermenu& xdotool behave_screen_edge top-left exec xfce4-popup-whiskermenu&
  
-Now , moving the mouse to the top left corner, brings up the whisker menu. We can even automate that by moving the mouse with the command-line to 0,0, ( or the surrounds...).+Now , moving the mouse to the top left corner, brings up the whisker menu. We can even automate that by moving the mouse with the command-line to 0,0, ( or the surrounds...).**
  
-The above examples are XFCE specific, but it will work on other DE’s - where your command does not conflict with an existing hot corner. Feel free to replace ‘xfdashboard’ with an application of your choice, as it was only meant to be an example of what is possible. You can now put these hot corner commands into a shell script and add it to your start-up list. +MAIS ATTENDEZ ! IL Y A PLUS... 
 + 
 +« xdtool » peut aussi être utilisé pour paramétrer les gestes de la souris et les angles sensibles de votre système XFCE pour qu'il se comporte comme GNOME. Ouvrez un terminal et saisissez : 
 + 
 +xdotool behave_screen_edge bottom-right exec /usr/bin/xfdashboard& 
 + 
 +Maintenant, déplacez votre souris vers le coin et regardez. C'est une autre façon de tester votre code avant de faire le script. Nous pouvons maintenant remplacer toute cette saisie dans votre exemple d'apprentissage par moins de code - avec tout ce que nous avons appris jusqu'à maintenant. 
 + 
 +xdotool behave_screen_edge top-left exec xfce4-popup-whiskermenu& 
 + 
 +Maintenant, en déplaçant la souris vers le coin en haut à gauche, le menu whisker s'ouvre. Nous pouvons même l'automatiser en déplaçant la souris vers 0,0 (ou les environs...) avec la ligne de commande. 
 + 
 +**The above examples are XFCE specific, but it will work on other DE’s - where your command does not conflict with an existing hot corner. Feel free to replace ‘xfdashboard’ with an application of your choice, as it was only meant to be an example of what is possible. You can now put these hot corner commands into a shell script and add it to your start-up list. 
  
 The beauty of ‘xdotool’ is that it also works over SSH, so if you need to do something repetitive, or automate some task on a remote computer, this is possible. We will delve into this in a future issue. You can also move and resize windows with this versatile tool; very handy if you use a tiling window manager (hint-hint). We will look at how to do this in the next issue.  The beauty of ‘xdotool’ is that it also works over SSH, so if you need to do something repetitive, or automate some task on a remote computer, this is possible. We will delve into this in a future issue. You can also move and resize windows with this versatile tool; very handy if you use a tiling window manager (hint-hint). We will look at how to do this in the next issue. 
  
-If you have any suggestions or queries, please let us know. You can also send us your clever scripts of tweaks with ‘xdotool’, and we will make you famous! (Not quite, but it will get your name in print).+If you have any suggestions or queries, please let us know. You can also send us your clever scripts of tweaks with ‘xdotool’, and we will make you famous! (Not quite, but it will get your name in print).** 
 + 
 +Les exemples ci-dessus sont spécifiques à XFCE, mais ça marche aussi avec les autres bureaux - si votre commande n'entre pas en conflit avec un coin sensible déjà existant.  N'hésitez pas à remplacer « xfdashboard » par l'application de votre choix, car ce n'était qu'un exemple de ce qui est possible. Vous pouvez maintenant mettre ces commandes d'angles sensibles dans un script shell et l'ajouter à votre liste de démarrage. 
 + 
 +La beauté de « xdotool » vient de ce qu'il fonctionne aussi par SSH, de sorte que, si vous avez besoin de faire quelque chose de répétitif ou d'automatiser une certaine tâche sur un ordinateur distant, c'est possible. Nous nous plongerons dans ce sujet dans un futur numéro. Vous pouvez aussi déplacer et redimensionner des fenêtres avec cet outil versatile ; c'est très pratique si vous utilisez un gestionnaire de fenêtres en carrelage (petit indice). Nous verrons comment le faire dans le prochain numéro. 
 + 
 +Si vous avez des suggestions ou des questions, merci de nous le faire savoir. Vous pouvez aussi nous envoyer vos astucieux scripts ou réglages avec « xdotool » et nous vous rendrons célèbre ! (Pas tout à fait, mais votre nom apparaîtra dans la revue.)
  
issue151/tutoriel1.txt · Dernière modification : 2019/12/06 16:45 de andre_domenech