GithubHelp home page GithubHelp logo

daltonmenezes / hyper-init Goto Github PK

View Code? Open in Web Editor NEW
75.0 3.0 5.0 4.25 MB

:zap: The ultimate and most complete extension to initialize commands before and after Hyper terminal starts.

License: MIT License

JavaScript 100.00%
hyper hyperterm hyper-plugin hyper-extension hyper-init startup launcher run terminal terminal-app

hyper-init's People

Contributors

daltonmenezes avatar jenhausu avatar nightmarlin avatar wushuo894 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hyper-init's Issues

Problem when you have more than one cross-platform task/shells

Running Commands

I love to personalize my stuff, and one of them is my Hyper terminal, thanks to this plugin I can execute commands at the Init of my Terminal and when I open/split a new tab, showing my system info or ASCII art.

My Init Code
init: [
      {
        rule: "once",
        commands: [
          "Set-Prompt",
          "Set-Theme Material",
          "clear",          
          "Write-Host -ForegroundColor Green '                      Welcome Back                     '",
          "$Model = (Get-CimInstance win32_computersystem).Model",
          "$Manu = (Get-CimInstance win32_computersystem).Manufacturer",
          "$PC = (Get-CimInstance win32_computersystem).Name",
          "$User = (Get-CimInstance win32_computersystem).PrimaryOwnerName",
          "Write-Host -ForegroundColor DarkRed '                                                        ' -NoNewline;Write-Host -ForegroundColor Blue $PC -NoNewLine; Write-Host -ForegroundColor DarkYellow '@' -NoNewLine; Write-Host -ForegroundColor Blue $User",
          "Write-Host -ForegroundColor DarkRed ' ██ ▄█▀▓██   ██▓ ▒█████   ███▄    █  ▄▄▄      ▒██   ██▒ ' -NoNewline;Write-Host -ForegroundColor Blue 'Manufacturer: ' -NoNewline;Write-Host -ForegroundColor DarkYellow $Manu",
          "Write-Host -ForegroundColor DarkRed ' ██▄█▒  ▒██  ██▒▒██▒  ██▒ ██ ▀█   █ ▒████▄    ▒▒ █ █ ▒░ ' -NoNewline;Write-Host -ForegroundColor Blue 'Model: ' -NoNewline;Write-Host -ForegroundColor DarkYellow $Model",
          "Write-Host -ForegroundColor DarkRed '▓███▄░   ▒██ ██░▒██░  ██▒▓██  ▀█ ██▒▒██  ▀█▄  ░░  █   ░ '",
          "Write-Host -ForegroundColor DarkRed '▓██ █▄   ░ ▐██▓░▒██   ██░▓██▒  ▐▌██▒░██▄▄▄▄██  ░ █ █ ▒  '",
          "Write-Host -ForegroundColor DarkRed '▒██▒ █▄  ░ ██▒▓░░ ████▓▒░▒██░   ▓██░ ▓█   ▓██▒▒██▒ ▒██▒ '",
          "Write-Host -ForegroundColor DarkRed '▒ ▒▒ ▓▒   ██▒▒▒ ░ ▒░▒░▒░ ░ ▒░   ▒ ▒  ▒▒   ▓▒█░▒▒ ░ ░▓ ░ '",
          "Write-Host -ForegroundColor DarkRed '░ ░▒ ▒░ ▓██ ░▒░   ░ ▒ ▒░ ░ ░░   ░ ▒░  ▒   ▒▒ ░░░   ░▒ ░ '",
          "Write-Host -ForegroundColor DarkRed '░ ░░ ░  ▒ ▒ ░░  ░ ░ ░ ▒     ░   ░ ░   ░   ▒    ░    ░   '",
          "Write-Host -ForegroundColor DarkRed '░  ░    ░ ░         ░ ░           ░       ░  ░ ░    ░   '",
          "Write-Host -ForegroundColor DarkRed '        ░ ░                                             '",
          "Write-Host -ForegroundColor DarkRed '                                                        '",
        ],
      },
      {
        rule: ["windows", "tabs", "splitted"],
        commands: ["Set-Prompt", "Set-Theme Material"],
      },
    ],

Issue

The problem is that when I open a new tab on Wsl or CMD or using another cross-platform task, the commands are still executed, no matter If I put "windows", on the rule init.

image

Question

Exist a config or what I need to do, to validate the cross-platforms task/shells when the terminal has to execute the commands?

Can't make this work on Windows 10

Am I doing something wrong?
I've added the configuration, just an example to see working but I only see this:

terminal

plugins: ["hyper-init"],
...
init: [
    {
      rule: 'once',
      commands: ['echo This is only executed on New Windows!']
    }
  ],
...

I've removed all others plugins just to make sure but still.

Command to open new tabs and have hyper-init act on them

First, thank you for the extension - it is fantastic! I was wondering whether there's a way for hyper-init to basically set all my initial tabs. Right now, all commands are executed in the same pane. Can they be executed in different panes? For example:

  • When Hyper is opened
    • cd of the current tab (command 1)
    • Open a new tab (automatically)
    • Execute another command (command 2)

Setting multiple rules for one command

Is there no way of setting multiple rules for one command?

e.g.

init: [
  {
    rule: 'once',
    commands: ['command 1']
  },
  {
    rule: ['splitted', 'once'],
    commands: ['command 2']
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.