ericm / stonks

Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal. See how fast your stonks will crash.
https://stonks.icu
GNU General Public License v3.0
548 stars 35 forks source link

[Idea] Maybe add an example with wtfutil? #8

Closed GideonWolfe closed 4 years ago

GideonWolfe commented 4 years ago

wtfutil is an awesome utility that lets you create static terminal dashboards to fit your needs.

You can place different "widgets" in a desired arrangement. You could use the "command runner" agent to display the output of stonks commands in a dashboard format!

I did the same thing here.

ericm commented 4 years ago

Good idea :)

GideonWolfe commented 4 years ago

Here is a sample config of wtfutil

wtf:
  colors:
    background: black
    border:
      focusable: darkslateblue
      focused: blue
      normal: gray
    checked: yellow
    highlight: 
      fore: black
      back: gray
    rows:
      even: yellow
      odd: white
  grid:
    # How _wide_ the columns are, in terminal characters. In this case we have
    # four columns, each of which are 35 characters wide.
    columns: [33, 33, 33]
    # How _high_ the rows are, in terminal lines. In this case we have four rows
    # that support ten line of text and one of four.
    rows: [20, 20, 20, 20, 20, 20, 20, 20]
  refreshInterval: 1

  mods:
    tech:
      type: cmdrunner
      args: ["tsla", "intc", "--theme", "dot"]
      cmd: "stonks"
      enabled: true
      position:
        top: 0
        left: 0
        height: 2
        width: 3
      refreshinterval: 30
      title: "🤖 Tech"
    financial:
      type: cmdrunner
      args: ["jpm", "v", "--theme", "dot"]
      cmd: "stonks"
      enabled: true
      position:
        top: 2
        left: 0
        height: 2
        width: 3
      refreshinterval: 30
      title: "💰 Financial"

It ends up looking like

stonks

While I was setting up stonks, I noticed that setting a "default value" for the line type does not work, hence why I launched with --theme dot.

Additionally, I suggest the config be moved to $HOME/.config/stonks/config.yml or something similar. This would allow multiple configurations to coexist without polluting the base $XDG_CONFIG directory.

ericm commented 4 years ago

Thanks for the sample, I think I'll add something like that to the README. The issue with setting the default theme should have been fixed in the master branch if you want to try reinstall.

ericm commented 4 years ago

https://github.com/ericm/stonks#usage-with-wtfutil