lp:~sprataa/terminator/layoutsonsteroids

Created by Sérgio Prata Almeida on 2018-10-23 and last modified on 2018-10-23

This commit is a PoC on how to improve Layout Saving mechanism further and allow automation;

Changelog:

Added virtualenvwrapper Virtual Environment setting to Terminal Layout;
Added Save Layout shortcut to Popup/Context Menu;
Saving a Layout now detects shell child processes and saves it in "Custom Command" field;
Changed "Custom Command" mechanism in order to be ran in child shell via input instead of using -c "command";
Improved PWD/CWD detection;
Added save_layout and push_environment to IPC/DBus Methods;

-----------------------------------------------

Example DBUS shell functions and usage:

function push_environment {
 if [ TERMINATOR_UUID ]
 then
  env=`env | egrep "TERMINATOR_UUID|VIRTUAL_ENV|PWD"`
  dbus-send --session --type=method_call --dest=$TERMINATOR_DBUS_NAME /net/tenshu/Terminator2 $TERMINATOR_DBUS_NAME.push_environment string:"$env" &>/dev/null
 fi
}

function save_layout {
 if [ TERMINATOR_UUID ]
 then
  push_environment
  dbus-send --session --type=method_call --dest=$TERMINATOR_DBUS_NAME /net/tenshu/Terminator2 $TERMINATOR_DBUS_NAME.save_layout &>/dev/null
 fi
}

push_environment needs to be called from each terminal's child shell in order to inform terminator of the current environment.
The only place where you can access the current shell's environment. TERMINATOR_UUID needs to be sent in order to determine where it came from.

I currently have push_environment ran every time my shell's prompt is redrawn but this is optional.
You can run push_environment on each terminal you wish to update Virtual Environment and Working Directory.
Be advised that you still need to call save_layout function, "Save Layout" via the context menu or press "Save" in Layout Preferences window.

Get this branch:
bzr branch lp:~sprataa/terminator/layoutsonsteroids
Only Sérgio Prata Almeida can upload to this branch. If you are Sérgio Prata Almeida please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Sérgio Prata Almeida
Project:
Terminator
Status:
Mature

Recent revisions

1808. By Sérgio Prata Almeida on 2018-10-23

This commit is a PoC on how to improve Layout Saving mechanism further and allow automation;

Changelog:

Added virtualenvwrapper Virtual Environment setting to Terminal Layout;
Added Save Layout shortcut to Popup/Context Menu;
Saving a Layout now detects shell child processes and saves it in "Custom Command" field;
Changed "Custom Command" mechanism in order to be ran in child shell via input instead of using -c "command";
Improved PWD/CWD detection;
Added save_layout and push_environment to IPC/DBus Methods;

-----------------------------------------------

Example DBUS shell functions and usage:

function push_environment {
    if [ TERMINATOR_UUID ]
    then
        env=`env | egrep "TERMINATOR_UUID|VIRTUAL_ENV|PWD"`
        dbus-send --session --type=method_call --dest=$TERMINATOR_DBUS_NAME /net/tenshu/Terminator2 $TERMINATOR_DBUS_NAME.push_environment string:"$env" &>/dev/null
    fi
}

function save_layout {
    if [ TERMINATOR_UUID ]
    then
        push_environment
        dbus-send --session --type=method_call --dest=$TERMINATOR_DBUS_NAME /net/tenshu/Terminator2 $TERMINATOR_DBUS_NAME.save_layout &>/dev/null
    fi
}

push_environment needs to be called from each terminal's child shell in order to inform terminator of the current environment.
The only place where you can access the current shell's environment. TERMINATOR_UUID needs to be sent in order to determine where it came from.

I currently have push_environment ran every time my shell's prompt is redrawn but this is optional.
You can run push_environment on each terminal you wish to update Virtual Environment and Working Directory.
Be advised that you still need to call save_layout function, "Save Layout" via the context menu or press "Save" in Layout Preferences window.

1807. By Launchpad Translations on behalf of gnome-terminator on 2018-10-10

Launchpad automatic translations update.

1806. By Launchpad Translations on behalf of gnome-terminator on 2018-10-08

Launchpad automatic translations update.

1805. By Launchpad Translations on behalf of gnome-terminator on 2018-08-24

Launchpad automatic translations update.

1804. By Launchpad Translations on behalf of gnome-terminator on 2018-08-23

Launchpad automatic translations update.

1803. By Launchpad Translations on behalf of gnome-terminator on 2018-07-26

Launchpad automatic translations update.

1802. By Launchpad Translations on behalf of gnome-terminator on 2018-06-14

Launchpad automatic translations update.

1801. By Launchpad Translations on behalf of gnome-terminator on 2018-05-18

Launchpad automatic translations update.

1800. By Launchpad Translations on behalf of gnome-terminator on 2018-05-17

Launchpad automatic translations update.

1799. By Launchpad Translations on behalf of gnome-terminator on 2018-05-13

Launchpad automatic translations update.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:terminator
This branch contains Public information 
Everyone can see this information.