OVH Cloud OVH Cloud

Modifier la taille de la fenetre du terminal par script

26 réponses
Avatar
Bruno CAUSSE
Bonjour,

Comment modifier la taille de la fenetre du terminal par script (bash sous
10.4.5)

La cmd resize -s est non reconnue :-(

Question 2 : Peut on connaître la taille de l'ecran?

Bonne journée
--
Bruno

10 réponses

1 2 3
Avatar
Patrick Stadelmann
In article <1hdgaa2.1gqdwrzsw8dyhN%,
(Laurent Pertois) wrote:

Par contre, je ne comprends pas, dans le dico applescript de Terminal,
comment créer les 4 fenêtres.


do script ""

Patrick
--
Patrick Stadelmann

Avatar
laurent.pertois
Patrick Stadelmann wrote:

Par contre, je ne comprends pas, dans le dico applescript de Terminal,
comment créer les 4 fenêtres.


do script ""


Rhaaahhhhh, je l'ai vu et je suis passé à côté... En plus, ça répond à
ma question suivante, comment lui passer une commande à exécuter :)

Merci, je vais fouiller pour savoir comment créer une nouvelle fenêtre
avec do script, lui donner un nom et du coup l'utiliser avec les
redimensionnements afin de ne pas redimensionner les mauvaises fenêtres.

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.


Avatar
Patrick Stadelmann
In article <1hdgc0l.1cz9wir1raxyt6N%,
(Laurent Pertois) wrote:

Merci, je vais fouiller pour savoir comment créer une nouvelle fenêtre
avec do script, lui donner un nom et du coup l'utiliser avec les
redimensionnements afin de ne pas redimensionner les mauvaises fenêtres.


Pour ça normalement il faudrait un truc genre :

set newWin to make new window

qui permet de référencer la fenêtre crée. Mais "make new window" ne
fonctionne pas (en 10.3.9 en tout cas). Heureusement, "do script" crée
une fenêtre devant toutes les autres, donc :

do script ""
set newWin to front window

permet de s'en sortir.

Patrick
--
Patrick Stadelmann

Avatar
laurent.pertois
Patrick Stadelmann wrote:

In article <1hdgaa2.1gqdwrzsw8dyhN%,
(Laurent Pertois) wrote:

Par contre, je ne comprends pas, dans le dico applescript de Terminal,
comment créer les 4 fenêtres.


do script ""


J'ai fait un truc pas trop mal (enfin, pour ce que je voulais) :

------------------------------------------------------------
-- Define display resolution minus the height of the menu bar and the
-- width of my Dock

set screenSize to {width:1555, height:1178}

set x0 to 0
set y0 to 20

set w to round (screenSize's width) / 2
set h to round (screenSize's height) / 2

tell application "Terminal"
activate
do script ""
tell window frontmost
set size to {w, h}
set custom title to "toto"
set position to {x0, y0}
end tell

do script ""
tell window frontmost
set size to {w, h}
set custom title to "titi"
set position to {x0 + w, y0}
end tell

do script ""
tell window frontmost
set size to {w, h}
set custom title to "tutu"
set position to {x0, y0 + h}
end tell

do script ""
tell window frontmost
set size to {w, h}
set custom title to "tete"
set position to {x0 + w, y0 + h}
end tell

end tell
------------------------------------------------------------

Par contre, je ne vois pas comment récupérer la taille de mon écran pour
automatiser un petit peu tout ça. J'ai bien vu des exemples allant lire
le com.apple.windowserver.plist mais le mien est plein de résolutions...

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.


Avatar
laurent.pertois
Patrick Stadelmann wrote:

Pour ça normalement il faudrait un truc genre :

set newWin to make new window

qui permet de référencer la fenêtre crée. Mais "make new window" ne
fonctionne pas (en 10.3.9 en tout cas).


Pas mieux en 10.4.6 : Terminal got an error: NSInternalScriptError

J'avais essayé ça avant de demander.

Heureusement, "do script" crée
une fenêtre devant toutes les autres, donc :

do script ""
set newWin to front window

permet de s'en sortir


Vivi, j'ai rusé et découpé le script autrement mais ça pourrait aussi le
faire, cf mon message :

Message-ID: <1hdggkz.1pew86y1en0p95N%


Encore merci.

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.

Avatar
patpro ~ patrick proniewski
In article <1hdg6rf.15hm4y11nvmrj8N%,
(Laurent Pertois) wrote:

patpro ~ patrick proniewski wrote:

J'ai jamais cherché à le faire, donc j'ai rien d'immédiat. Le seul cas
où je me sers de ce genre de disposition c'est dans BBEdit, qui
précisément gère ça.


Oui, mais BBEdit gère mal le tail ;-)


c'est faux, il gère même le tail -f :)

(File->New->Shell Worksheet)

mais j'avoue que je ne m'en sers pas pour ça.

patpro


Avatar
Patrick Stadelmann
In article <1hdggkz.1pew86y1en0p95N%,
(Laurent Pertois) wrote:

Par contre, je ne vois pas comment récupérer la taille de mon écran pour
automatiser un petit peu tout ça. J'ai bien vu des exemples allant lire
le com.apple.windowserver.plist mais le mien est plein de résolutions...


Avec Jon's Commands X :

(screen size of item 1 of (screen list))

http://www.seanet.com/~jonpugh/

Patrick
--
Patrick Stadelmann

Avatar
laurent.pertois
patpro ~ patrick proniewski wrote:

c'est faux, il gère même le tail -f :)

(File->New->Shell Worksheet)


Rhaaaaahhhhhhhhhh grandiose, merci

mais j'avoue que je ne m'en sers pas pour ça.


Faudra que je fasse des tests même si je préfère un shell, quand même...

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.

Avatar
laurent.pertois
Patrick Stadelmann wrote:

Avec Jon's Commands X :


Merci, je vais jeter un oeil, mais j'aime bien les solutions portables
qui ne nécessitent pas l'installation de plein de choses (bon, un simple
OSAX ça peut aller).

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.

Avatar
laurent.pertois
Laurent Pertois wrote:

Faudra que je fasse des tests même si je préfère un shell, quand même...


Ca merdoie avec des connexions ssh, dirait-on.

--
Politically Correct Unix - UTILITIES
The "touch" command has been removed from the standard distribution due
to its inappropriate use by high-level managers.

1 2 3