Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Thursday January 17 2019, @01:45AM   Printer-friendly
from the automation++ dept.

Hi all,

I have been learning linux and have a secondary monitor that I wanted to use for showing some sensor data. Currently I need to manually enter in three commands and then arrange my windows each time I want to look at (and start-up, etc). I am using the nethogs, inxi, and lm-sensors libraries:

sudo nethogs
watch -n1 "inxi -s"
watch -n1 "sensors | grep Tdie"

The end result looks something like this:
https://i.ibb.co/TgWXKSn/sensors.png

Is it possible/easy to script the opening of these three terminal windows and position them onto a specific monitor? Or is there a completely different better way to go about this?

Also, is there a way for me to custom arrange the data on the screen? Eg, could I put the sensors "Tdie" data into two columns and remove the "high = +70.0 C" info?

[Beyond this specific case, is there a general solution with, say, a directory containing a separate shell script for launching each program, with a master script that specifies terminal width/height as well as (x,y) coordinates? --Ed.]


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by FatPhil on Monday January 21 2019, @07:44PM (1 child)

    by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Monday January 21 2019, @07:44PM (#789731) Homepage
    Unnecessary use of grep - you can do all of that in the sed (suppress output by default, match only the interesting lines, and print them).
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by boltronics on Monday January 21 2019, @10:20PM

    by boltronics (580) on Monday January 21 2019, @10:20PM (#789809) Homepage Journal

    You're not wrong, and it would even be more efficient, but isn't there a saying that goes something like "don't use awk when you can use sed, don't use sed when you can use grep, don't use grep when you can use tr, don't use tr when you can use cat"? It goes something like that, but I can't find it when I did a search.

    Certainly one of the ideas behind such a saying would be efficiency (and since using sed anyway there would likely be no negative performance impact in continuing to use that - and probably even some improvement), but I suppose part of it is related to the improved readability of the syntax of the more simple tools.

    --
    It's GNU/Linux dammit!