Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.4 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.4 KB

stock-widget

A basic stock ticker widget for awesome WM.

stock widget

Inspiration taken from deficient widgets.

Installation

First you need an API key from https://www.alphavantage.co/, and place it in /opt/stock-widget/alphavantage

cd ~/.config/awesome/
git clone git@github.com:whwright/stock-widget.git

Then, in your rc.lua:

local stock_widget = require("stock-widget")
stock = stock_widget({symbol = "NYSE:HD"})
-- add the widget to your wibox
{
    -- right widgets
    ...
    stock.widget
    ...
}

Config

The text can be configured with the following properties

stock_widget({
    text_format = "${symbol_color_on}${symbol}${symbol_color_off} ${price_color_on}\$${price}${price_color_off} ${change_color_on}${change}%${change_color_off}",
    symbol_color = "white",
    price_color = nil,
    gain_color = "green",
    loss_color = "red",
    timeout = 60,
    get_stock_price_location = nil
})

get_stock_price_location is used to find the location of get_stock_price.py. By default, it will try to find the script in your awesome config folder, or in the directory stock-widget in your awesome config folder (in case you have cloned this repo as sub module). If that doesn't work for your use case, you can always override the directory containing the script with get_stock_price_location.