acudovs / terminator-split

Wrapper script for splitting Terminator terminal emulator
MIT License
25 stars 11 forks source link

Great idea but work still required for general use #1

Closed reaperzn closed 7 years ago

reaperzn commented 7 years ago

This is a great idea but still needs a bit of work. 1) The help output does not include the -m flag description that you mention in the README.md

2) This has a dependency on configobj which is not a standard pre-installed package (At least on Ubuntu 16.04). You should a) mention this in the README.md or b) preferably try to rewrite this functionality using built-in functions in python.

3) Currently this does not work for me, it may be because I have adjusted some of my default key bindings but I have not looked into this yet. It may be something you want to look into for your project.

4) This seems to try create a new terminator window with splits which ssh session to the specified hosts in each split. This is a really great idea however this could be set as a separate option (ie --ssh) and have the default option to just open a new terminator session with X number of windows/tty sessions/splits

Overall, This is a great idea and I hope you keep working on it.

For your reference, this is the error message I get when using the "-m" flag:

# ./terminator-split -m localhost localhost -d
args:Namespace(command="ssh '{}'", config='/home/reaper/.config/terminator/config', hostname=['localhost', 'localhost'], level='DEBUG', terminator='/usr/bin/terminator')
unknown_args:['-m']
config:/tmp/tmpWEmTPj:'{'global_config': {'handle_size': '5', 'inactive_color_offset': '1.0'}, 'keybindings': {'broadcast_all': '<Primary><Shift>a', 'broadcast_group': '<Primary><Shift>q', 'broadcast_off': '<Primary><Shift>z', 'close_window': '<Primary><Shift><Alt>k'}, 'layouts': {'default': {'child0': {'type': 'Window', 'parent': ''}, 'child1': {'type': 'HPaned', 'parent': 'child0'}, 'child2': {'type': 'Terminal', 'command': "ssh 'localhost'", 'parent': 'child1'}, 'child3': {'type': 'Terminal', 'command': "ssh 'localhost'", 'parent': 'child1'}}}, 'plugins': {}, 'profiles': {'default': {'background_darkness': '0.92', 'background_image': 'None', 'background_type': 'transparent', 'palette': '#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff', 'scrollback_infinite': 'True'}}}'

This is without the "-m":

./terminator-split localhost localhost -d
args:Namespace(command="ssh '{}'", config='/home/reaper/.config/terminator/config', hostname=['localhost', 'localhost'], level='DEBUG', terminator='/usr/bin/terminator')
unknown_args:[]
config:/tmp/tmp33RcCG:'{'global_config': {'handle_size': '5', 'inactive_color_offset': '1.0'}, 'keybindings': {'broadcast_all': '<Primary><Shift>a', 'broadcast_group': '<Primary><Shift>q', 'broadcast_off': '<Primary><Shift>z', 'close_window': '<Primary><Shift><Alt>k'}, 'layouts': {'default': {'child0': {'type': 'Window', 'parent': ''}, 'child1': {'type': 'HPaned', 'parent': 'child0'}, 'child2': {'type': 'Terminal', 'command': "ssh 'localhost'", 'parent': 'child1'}, 'child3': {'type': 'Terminal', 'command': "ssh 'localhost'", 'parent': 'child1'}}}, 'plugins': {}, 'profiles': {'default': {'background_darkness': '0.92', 'background_image': 'None', 'background_type': 'transparent', 'palette': '#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff', 'scrollback_infinite': 'True'}}}'
reaper@reaper-Desktop:~/Scripts/terminator-split$ 
** (terminator:13453): WARNING **: Binding '<Shift><Control><Alt>a' failed!
Unable to bind hide_window key, another instance/window has it.
acudovs commented 7 years ago
  1. "-m" is one of the TERMINATOR_OPTIONS
$ terminator-split --help
usage: terminator-split [-h] [-d]
                        [-e COMMAND] [-g CONFIG] [-t TERMINATOR]
                        [TERMINATOR_OPTIONS]
                        hostname [hostname ...]
$ terminator --help
  -m, --maximise        Maximise the window

2., 3. Should I expect a pull request from you? :)

  1. I have some aliases in ~/.bashrc
alias tsn='terminator_split_number'

terminator_split_number() {
    local number="${1:-4}"
    for ((i=0; i<${number}; i++)); do
        echo $i
    done | xargs terminator-split -e "bash -l" -m -pdefault8
}

Then execute it like this

$ tsn 2
$ tsn 4
$ tsn 8
$ tsn 16
acudovs commented 7 years ago

Try latest version.

$ terminator-split 2
$ terminator-split 4
$ terminator-split 8
$ terminator-split 16