1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

38 Commits

Author SHA1 Message Date
Chris Cummer
fd794707cd
☢️ WTF-1031 Support multiple simultaneous configurations (#1032)
* WTF-1031 Rename WtfApp.app to WtfApp.tviewApp

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 Add scaffolding for main to support multiple WtfApp instances

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove common functionality from KeyboardWidget and into Base

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Augment with some descriptive comments

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Add full support for multiple app instances via the AppManager.

Still to do:

* Config support for multiple apps/multiple config files
* The ability to switch between apps

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Move SetTerminal out of main and into its own file

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-21 03:25:41 -08:00
Chris Cummer
d6a0797bf2 Simplify the inclusion of the Common config settings into each module
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:18:46 -08:00
Chris Cummer
f9a06540f1 Simplify the view loading for the keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Chris Cummer
4a820dd0e5 Make every widget a keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Chris Cummer
2430fe9f56 Opening docs in browser is working, but only for keyboard modules
This needs to work for all modules, which means effectively
every module just became a keyboard module, if it is focusable.

That's an interesting development.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Todd Trimble
38e21605a4
Add tests for specified min column width (#990) 2020-10-07 14:56:20 -07:00
Chris Cummer
f7d99c5eff Don't trim whitespace from beginning of widget
Some widgets format the output using whitespace padding
at the beginning.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-10-06 20:00:50 -07:00
Todd Trimble
4192a02594
Add info table tests (#985)
* Add info table tests

* Fix lint error about initialization
2020-10-06 19:41:44 -07:00
Ying Fan Chong
0f36063696 Prevent extra empty line in highlightable text 2020-10-02 20:53:33 +08:00
Sam Roberts
4bb725db9e golangci-lint configuration file
golangci-lint can run all the currently enabled linters, and as far as I
can tell, does it in under 5 seconds as opposed to over 180 seconds
(compare `time make cilint` and `time make lint`).

Some of the linters that are listed in the "enabled" section but
commented out looked like a good idea to me, and fairly low hanging
fruit to fix, but they are not passing at the moment.

All the linters covered in the current Makefile are run.

TODO:
- replace lint target in Makefile with golangci-lint
- remove .github/workflow/errcheck.yml
2020-05-16 12:34:57 -07:00
Chris Cummer
10f761dbcb
20191217 gosec (#796)
* Add gosec to the Makefile

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix some issues found by gosec

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 14:59:16 -08:00
Chris Cummer
58299c2efa
WTF-484 DigitalOcean module (#782)
* WTF-484 DigitalOcean module stubbed out
* WTF-484 Delete droplets via Ctrl-d
* WTF-484 Rebasing off master after a long time away
* WTF-484 Improve DigitalOcean display
* WTF-484 Can shutdown and restart the selected droplet
* WTF-484 Display info about the selected droplet using the ? key
* WTF-484 Display info about the selected droplet using the Return key
* WTF-484 Greatly improve the utils.Truncate function
* WTF-484 Display a droplet's features in the info modal
* WTF-484 Change reboot key from r to b to not conflict with refresh
* WTF-484 Panic if a keyboard control is mapped to the same character more than once
* WTF-484 Colorize droplet status indicator
* WTF-484 Extract view.InfoTable out into a reusable component
2019-12-13 11:33:29 -08:00
Chris Cummer
c6a10295c1
Set Twitter Stats wrap to false (#745)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-12 20:10:39 -08:00
Chris Cummer
200dbcc03c
WTF-730 Fix missing color key config error (#738)
* WTF-730 Fix missing color key config error

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Add Subheading color formatting to modules

Users can now set a `subheading` color in their config to change the
color of subheadings in widget display.

Defaults to `red`.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix oustanding color issues

Clean up missing color config changes not addressed in earlier commits.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove unused dependency

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Base cleanup

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix a few bugs related to color config changes

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix issues with PagerDuty subheading display

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix bug with Todo list colour rendering

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 11:21:45 -08:00
hmuar
20e30fdefc rename tests to be consistent with other test files 2019-10-22 23:53:21 -07:00
hmuar
b934096832 add tests for keyboard_widget 2019-10-22 23:52:58 -07:00
hmuar
0fd763805a Add tests for bargraph view for full coverage 2019-10-20 18:15:22 -07:00
Chris Cummer
bf877f5fa7 Constantize the defaultFocus value for each module 2019-09-22 18:12:29 -07:00
Chris Cummer
d6208b4730 Add a focusable over-ride setting for widgets that are non-focusable by
default

For widgets that are non-focusable by default, you can now specify

    focusable: true

in their config to over-ride the default 'false' value.
2019-09-22 17:51:06 -07:00
Sean Smith
e28bdac0ee Make default color sub. Also use default as defaults 2019-09-14 14:00:09 -04:00
Sean Smith
9fccd721e0 Expand and fix test
Add an extra color
Fix empty case. This shows up as white/whatever color the rest of the widget is like
2019-09-13 19:22:20 -04:00
Sean Smith
56975bc80a Improve bargraph view so bar colors are configurable
Inspired by #624
Update the view object so that widget developers can configure bar color
2019-09-12 20:01:08 -04:00
Sean Smith
26ca1618ab Fix config reload race
Race condition is around the usage of `enabled`
Wrap access in a mutex to eliminate race
Fixes #422
2019-09-10 21:49:40 -04:00
Chris Cummer
e059eeb625 Add the ability to display no title 2019-09-10 16:18:00 -07:00
Sean Smith
f2c10902b3 Fix delete/close of todoist
Currently, when deleting, we jump 2 positions, since we are calling next.
However, the next item becomes the current selected position, so handle better
Properly set selected in some edge cases where we may go from a list to 0
2019-08-31 19:02:56 -04:00
Sean Smith
14e7619075 Renormalize the redraw function
Have all instances take a function
Update the remaining modules to take this into account
Numerous smaller refactors to make some widgets work more or less the same
2019-08-27 21:51:37 -04:00
Sean Smith
264f49fd2c Fix race with HighlightableHelper
GetRect can lead to a race condition
Add a RenderFunc method so that we can call try to
wrap even more of our rendering in the thread safe
`QueueUpdateDraw` method
2019-08-24 22:15:35 -04:00
Chris Cummer
523a0bec2c Remove the need for every module to define a widget.Refresh keyboard control 2019-08-23 21:18:51 -07:00
Chris Cummer
5337656c58 Remove the need for every module to define a widget.ShowHelp keyboard control
This common functionality is moved up to KeyboardWidget. Modules now
include widget.InitializeCommonControls() instead.
2019-08-23 21:18:51 -07:00
Chris Cummer
4e46fff145 Move the utils.go file into the /utils directory 2019-08-05 10:50:12 -07:00
Chris Cummer
06a785d770 Rename 2019-08-05 08:01:21 -07:00
Chris Cummer
d372e1029f Rename addView() to createView() 2019-08-04 23:21:46 -07:00
Chris Cummer
787d1a3ba9 BarGraph supports customizable titles in config 2019-08-04 23:14:44 -07:00
Chris Cummer
b6b695290c Extract common funcitons from BarGraph and TextWidget into Base 2019-08-04 23:00:09 -07:00
Chris Cummer
275ea37a01 Extract common attributes from BarGraph and TextWidget into Base 2019-08-04 22:10:00 -07:00
Chris Cummer
98eb3c9013 Bring BarGraph constructor up to parity with TextWidget 2019-08-04 22:02:14 -07:00
Chris Cummer
dbc047516d Move all components responsible for module composition into /view 2019-08-04 21:42:40 -07:00
Chris Cummer
94d63306d4 Move Bargraph functionality into /view 2019-08-04 21:21:16 -07:00