branches with status:
Name Status Last Modified Last Commit
lp:~sprataa/terminator/layoutsonsteroids (Has a merge proposal) 2 Mature 2018-10-23 02:49:37 UTC 2018-10-23
1808. This commit is a PoC on how to improv...

Author: Sérgio Prata Almeida
Revision Date: 2018-10-23 02:24:29 UTC

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.

11 of 1 result