Home>

The OS is Linux.
Each time I start development, I manually start up multiple editors with multiple terminals and execute commands on the development server on one terminal and on the other terminal, but cd to the project directory one by one. Tedious.
Specifically, you do not want to do the troublesome task of launching a development server, launching a browser, accessing it, launching an editor, editing it, and executing the necessary commands during development in another terminal.
I do the same thing for multiple projects, so I want to switch.
Can I do this automatically using a shell script?
Are there other good methods or dedicated tools?
I want to switch multiple projects at the same time.

  • Answer # 1

    If terminal work is main, installscreenortmuxon the OS to which you are logged in, and work via it.
    When you log in today, run thescreencommand to work, and when finished, drop the terminal software on the client side without logging out. If you log in tomorrow andscreen -r, the state of the previous day will be restored (restore, or the server side is still in progress and- rto reconnect).
    There are many other functions.

    Isn't it an operation like dropping a server every day?

  • Answer # 2

    While writing from the beginning, do you know that editors and terminals can be started by hitting the command name from the shell prompt instead of starting from the menu with the mouse?

    The basic idea is

    #!/bin/sh
    cd project directory
    Terminal activation&
    Terminal activation&
    Start editor&
    Launch web browser&


    Just write a shell script like this and run it.
    Is this the answer to what you want to do?

    However, this method cannot move the target project to a terminal or editor that has already been started. There will be as many shell scripts as there are projects.

    You can also specify the window size and appearance position on the screen with command line options such as terminal. You can also open a terminal and run another program instead of the shell.

    Is it true that you want to launch a web browser?
    It seems that the gnome-open command or xdg-open can be used to make a web browser access a specific URL (if it has not been started yet).

    For linux
    nohup terminal start&
    It might be better to say.

  • Answer # 3

    Please consider using an integrated development environment (Eclipse etc).

    If there are any restrictions or restrictions on using the terminal,
    A little familiarity with operation is necessary, but how about Vim?
    One screen can be divided into multiple and commands can be issued.
    You can do the above with standard functions, but by introducing a plug-in
    It can be expanded more conveniently. After a degree
    After all, it will be closer to the integrated development environment. . .
    However, it is lighter than GUI and has a lot of shortcuts
    I prefer to use this one.

  • Answer # 4

    You can automate almost all manual tasks with xdotool. (Security sensitive applications such as Java and browsers do not normally accept operations)

    But if the automation effort doesn't fall below the mess, the automation itself may end up being annoying.

  • Answer # 5

    What do you want to do?
    https://shinodogg.com/?p=3419