I want to start Konsole in Split View which is possible using the --layout command but then also run a command like htop in one of the sessions. How do I do that?

  • wallybeavis@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    8 months ago

    Off the top of my head, you could write a small function and place it in your shell’s start up file (ex: .bashrc). The function would check to see if htop is running under your userid, and if not start it…although depending on the timing you may end up with htop in both sessions.

    A second option would be to create a bookmark and set the location to something such as ssh://youruserid@localhost “htop” <- I’ve not tested this, I’ve only bookmarks to ssh into remote systems

    It may just be easier to associate the command you need to a 2 or 3 letter alias and simply type that in

    • mikazuki@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      As for timing, one could use the flock function to ensure only one process starts. Something like this (untested): flock -n ~/.htop.lock -c htop