TermSaver
TermSaver is just a simple library built around the Appscript library to
automate saving the geometry of Mac OS' Terminal.app windows and provide a way
to rebuild them and provide them with initial commands on their creation.
Usage
Arrange your terminal windows however you like. Use the save
command to
generate a file with the saved window states.
termsaver -s saved_state.yml
or
termsaver --save saved_state.yml
You can then edit this file and enter shell commands in the "command" property
of each State
. These commands will be executed once the terminal windows are
re-instated.
Example:
---
- !ruby/object:TermSaver::State
background_color: !ruby/object:TermSaver::Colour
b: 53971
g: 65535
r: 48805
command: "echo 'Sugarnipples.'"
number_of_columns: 80
number_of_rows: 24
position: !ruby/object:TermSaver::Position
x: -614
y: 17
To load in your saved states, use the load
command.
termsaver -l saved_state.yml
or
termsaver --load saved_state.yml
Notes & Limitations
If you do not already have an instance of Terminal.app running, then it seems
that an additional Terminal window will be opened. Currently there is nothing
to handle this.
Currently, the only properties of windows being stored are: position, background
colour, number of rows and number of columns.