krok
Posts: 6
Joined: Fri Apr 16, 2021 2:19 pm

Lxterminal new tab and run sh script

Fri Apr 16, 2021 2:22 pm

Hello,
How to open a new Tab inside the current lxterminal and run .sh script in this new Tab?

If I call

Code: Select all

 lxterminal --tabs=1,2 -e ./script.sh
it will open a new lxterminal with a tab and runs the script there, but I want to open only a new Tab in current lxterminal and run it here.

Something like this:

Code: Select all

this lxterminal --tab --title="newTabName" -e "./script.sh"
Thank you.

klricks
Posts: 7731
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Lxterminal new tab and run sh script

Sat Apr 17, 2021 1:55 pm

I don't believe lxterminal supports that. It's not in the man page.
One option is to install and use xdotool scripting to send keyboard /mouse commands.
Or maybe a different terminal program can be used?
Why not just open a 2nd lxterminal window?
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

GlowInTheDark
Posts: 1613
Joined: Sat Nov 09, 2019 12:14 pm

Re: Lxterminal new tab and run sh script

Sat Apr 17, 2021 2:12 pm

Or user screen or tmux...

This is, of course, a totally different approach to the problem, so maybe not what OP is looking for, but it will give you much the same visual effect as having things running in multiple tabs, and a lot more control than you would get trying to scale Mt. Lxterminal.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

Loves Linux; loves to dance.

krok
Posts: 6
Joined: Fri Apr 16, 2021 2:19 pm

Re: Lxterminal new tab and run sh script

Sat Apr 17, 2021 3:00 pm

klricks wrote:
Sat Apr 17, 2021 1:55 pm
I don't believe lxterminal supports that. It's not in the man page.
One option is to install and use xdotool scripting to send keyboard /mouse commands.
Or maybe a different terminal program can be used?
Why not just open a 2nd lxterminal window?

Code: Select all

Why not just open a 2nd lxterminal window?
I need to open about 20 windows :(

Code: Select all

Or maybe a different terminal program can be used?
Sure, do you have any tip for raspberry pi 8gb? (Raspbian GNU/Linux 10 (buster))

Thank you.

    User avatar
    rpdom
    Posts: 18517
    Joined: Sun May 06, 2012 5:17 am
    Location: Chelmsford, Essex, UK

    Re: Lxterminal new tab and run sh script

    Sat Apr 17, 2021 3:08 pm

    I use xfce4-terminal. The --tab option just opens another tab in the current window.
    Unreadable squiggle

    User avatar
    RaspbianUser1
    Posts: 823
    Joined: Thu Mar 05, 2020 6:34 pm
    Location: ~/

    Re: Lxterminal new tab and run sh script

    Sat Apr 17, 2021 7:35 pm

    I use terminator, it allows you to have multiple terminals in 1 windows and in tabs of them

    ALL in the same app/process
    Running with a Raspberry Pi 4B 4GB with Raspberry Pi OS with MATE Desktop
    Why not overclock, push some more performance out of your computer!
    Think before you delete something a stranger on the internet told you to.

    krok
    Posts: 6
    Joined: Fri Apr 16, 2021 2:19 pm

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 1:50 pm

    RaspbianUser1 wrote:
    Sat Apr 17, 2021 7:35 pm
    I use terminator, it allows you to have multiple terminals in 1 windows and in tabs of them

    ALL in the same app/process
    Is there a way how to set a name (title) for the new Tab?

    User avatar
    RaspbianUser1
    Posts: 823
    Joined: Thu Mar 05, 2020 6:34 pm
    Location: ~/

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 9:16 pm

    krok wrote:
    Fri Apr 23, 2021 1:50 pm
    RaspbianUser1 wrote:
    Sat Apr 17, 2021 7:35 pm
    I use terminator, it allows you to have multiple terminals in 1 windows and in tabs of them

    ALL in the same app/process
    Is there a way how to set a name (title) for the new Tab?
    Create the tab, double click on the name (where you click to change tab), type new name them
    Running with a Raspberry Pi 4B 4GB with Raspberry Pi OS with MATE Desktop
    Why not overclock, push some more performance out of your computer!
    Think before you delete something a stranger on the internet told you to.

    krok
    Posts: 6
    Joined: Fri Apr 16, 2021 2:19 pm

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 10:03 pm

    I mean from the command line 😉

    User avatar
    RaspbianUser1
    Posts: 823
    Joined: Thu Mar 05, 2020 6:34 pm
    Location: ~/

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 10:27 pm

    Ctrl+Alt+A but that closes the window for me so I remapped the keybind to ctrl+ alt+N
    Running with a Raspberry Pi 4B 4GB with Raspberry Pi OS with MATE Desktop
    Why not overclock, push some more performance out of your computer!
    Think before you delete something a stranger on the internet told you to.

    krok
    Posts: 6
    Joined: Fri Apr 16, 2021 2:19 pm

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 10:42 pm

    No no... I mean
    terminator --new-tab "newTabName" -e ./my script.sh

    User avatar
    RaspbianUser1
    Posts: 823
    Joined: Thu Mar 05, 2020 6:34 pm
    Location: ~/

    Re: Lxterminal new tab and run sh script

    Fri Apr 23, 2021 11:11 pm

    The man page references using -T “words” to set a title

    Maybe you can do some personal research
    Running with a Raspberry Pi 4B 4GB with Raspberry Pi OS with MATE Desktop
    Why not overclock, push some more performance out of your computer!
    Think before you delete something a stranger on the internet told you to.

    krok
    Posts: 6
    Joined: Fri Apr 16, 2021 2:19 pm

    Re: Lxterminal new tab and run sh script

    Sat Apr 24, 2021 6:48 am

    That -T is not working -it is for window, not for tab- that is why why I'm asking...

    Return to “Beginners”