Tilix: terminix - how to execute command using session / json file?

Created on 19 Aug 2016  路  5Comments  路  Source: gnunn1/tilix

cat ~/ssh.json

{
    "child": {
        "child1": {
            "directory": "",
            "height": 700,
            "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
            "type": "Terminal",
            "execute": "pwd",
            "width": 658
        },
        "child2": {
            "directory": "",
            "height": 700,
            "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
            "type": "Terminal",
            "execute": "ls",
            "width": 656
        },
        "orientation": 0,
        "position": 50,
        "type": "Paned"
    },
    "height": 700,
    "name": "Default",
    "type": "Session",
    "version": "1.0",
    "width": 1315
}

The above "execute":"ls" does not execute; I want to launch split views with ssh. Please guide. Thanks.

question

Most helpful comment

In the terminal menu, go to _Layout Options_ and specify the override command. This override command is what is used to execute a command. In the json file it appears as follows:

{
    "child": {
        "directory": "\/home\/gnunn",
        "height": 579,
        "overrideCommand": "yaourt -Syua",
        "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
        "readOnly": false,
        "synchronizedInput": true,
        "title": "${id}: ${title}",
        "type": "Terminal",
        "width": 1094
    },
    "height": 579,
    "name": "Default",
    "synchronizedInput": false,
    "type": "Session",
    "version": "1.0",
    "width": 1094
}

All 5 comments

In the terminal menu, go to _Layout Options_ and specify the override command. This override command is what is used to execute a command. In the json file it appears as follows:

{
    "child": {
        "directory": "\/home\/gnunn",
        "height": 579,
        "overrideCommand": "yaourt -Syua",
        "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
        "readOnly": false,
        "synchronizedInput": true,
        "title": "${id}: ${title}",
        "type": "Terminal",
        "width": 1094
    },
    "height": 579,
    "name": "Default",
    "synchronizedInput": false,
    "type": "Session",
    "version": "1.0",
    "width": 1094
}

OK, the Layout menu is accessible from "Right-Clicking" in the window. I was looking at 3-dots menu. Thank you!

I'm having the same problem but getting a different message:

Could not load session due to unexpected error.
Found '"' when expecting '}'. (Line 12:13)

{
    "child": {
        "child1": {
            "directory": "\/home\/vaskark",
            "height": 406,
            "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
            "readOnly": false,
            "synchronizedInput": true,
            "type": "Terminal",
            "uuid": "5c0c0041-cfc7-4e69-8a89-be37f02ea6a7",
            "width": 690
            "overrideCommand": "ncmpcpp",   
        },
        "child2": {
            "child1": {
                "directory": "\/home\/vaskark",
                "height": 203,
                "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
                "readOnly": false,
                "synchronizedInput": true,
                "type": "Terminal",
                "uuid": "42d00b7f-82ec-4df2-9e49-97f9b8cd7e8b",
                "width": 690
            },
            "child2": {
                "directory": "\/home\/vaskark",
                "height": 205,
                "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
                "readOnly": false,
                "synchronizedInput": true,
                "type": "Terminal",
                "uuid": "bf2f3655-025e-42c5-a5dc-d55df6a9c006",
                "width": 690
            },
            "orientation": 1,
            "position": 24,
            "ratio": 0.496332518337408324,
            "type": "Paned"
        },
        "orientation": 1,
        "position": 49,
        "ratio": 0.497549019607843146,
        "type": "Paned"
    },
    "height": 816,
    "name": "Default",
    "synchronizedInput": false,
    "type": "Session",
    "uuid": "3217f968-3110-4887-888a-ed7b9a263187",
    "version": "1.0",
    "width": 690
}

I went to Layout Options and added 'overrideCommand' under Session Load. Is this correct? Please advise. I'm kinda new at this.

Thanks.

The issue is that it's not valid json, the comma needs to be after width, so instead of this:

"width": 690
"overrideCommand": "ncmpcpp",

It should be:

"width": 690,
"overrideCommand": "ncmpcpp"

Thanks for getting back so quickly. It works now, although I'm having trouble getting it to honour the height of each term as it was saved. Oh well. The important part's done :)

Many thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

viniciusban picture viniciusban  路  4Comments

huti26 picture huti26  路  3Comments

pkkid picture pkkid  路  3Comments

gregflynn picture gregflynn  路  4Comments

yodatak picture yodatak  路  4Comments