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

6 réponses

1 2 3
Avatar
patpro ~ patrick proniewski
In article <1hdh8p9.9axwkk6v363eN%,
(Laurent Pertois) wrote:

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.


oui, c'est clairement pas fait pour ça.

patpro


Avatar
laurent.pertois
patpro ~ patrick proniewski wrote:

Ca merdoie avec des connexions ssh, dirait-on.


oui, c'est clairement pas fait pour ça.


J'ai vu, bon, je continue avec mon script :)

--
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 <1hdh824.qrncdb1rn5bt4N%,
(Laurent Pertois) wrote:

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).


OK, voici un moyen de déterminer la taille à disposition :

tell application "Terminal"
do script ""
set zoomed of front window to true
size of front window
end tell

Patrick
--
Patrick Stadelmann


Avatar
laurent.pertois
Patrick Stadelmann wrote:

OK, voici un moyen de déterminer la taille à disposition :


Tant que j'y suis, j'abuse vu que je n'ai pas de grandes connaissances
en AS, j'obtiens bien un résultat cohérent (encore qu'il semble
soustraire la taille des barres de titre mais ça doit jouer) mais il
faut maintenant affecter width et height par rapport à ton premier
script, une idée ?

Promis, après je ne t'embête plus ;-)

--
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 <1hdhlkw.1txzkayholk6uN%,
(Laurent Pertois) wrote:

Patrick Stadelmann wrote:

OK, voici un moyen de déterminer la taille à disposition :


Tant que j'y suis, j'abuse vu que je n'ai pas de grandes connaissances
en AS, j'obtiens bien un résultat cohérent (encore qu'il semble
soustraire la taille des barres de titre mais ça doit jouer) mais il
faut maintenant affecter width et height par rapport à ton premier
script, une idée ?

Promis, après je ne t'embête plus ;-)


Pas de problème :-) Voilà une version qui se base se la position et la
taille d'une fenêtre "zoomée" :

tell application "Terminal"

do script ""
set zoomed of front window to true

set S to size of front window
set w0 to item 1 of S
set h0 to item 2 of S

set P to position of front window
set x0 to item 1 of P
set y0 to item 2 of P

set w to round w0 / 2
set h to round h0 / 2

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

activate

end tell

Patrick
--
Patrick Stadelmann


Avatar
laurent.pertois
Patrick Stadelmann wrote:

Pas de problème :-) Voilà une version qui se base se la position et la
taille d'une fenêtre "zoomée" :


Merveilleux, merci beaucoup.

--
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