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
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
4a820dd0e5 Make every widget a keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Sean Smith
7643109c63 Fix unlocking bug noticed during refactor 2020-10-08 08:17:52 -04:00
Sean Smith
e23cec2897 Let pty be optional 2020-10-07 19:40:26 -04:00
Sean Smith
34154620f6 Handle error handling better
Don't panic
Add function due to reuse
Catch all errors to appease CI
2020-10-07 19:40:26 -04:00
Sean Smith
57bf5c7417 Have cmdrunner use a tty
This lets us get proper coloring
Fixes #577
2020-10-07 19:40:26 -04:00
Chris Cummer
f0ca3b8a58
Another actions test (#889)
* Another actions test

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

* Add BuildTest action

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

* Remove lint check for the time being (so many issues)

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

* Fix issues found by errcheck

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

* Fix errors found by staticcheck

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

* Fix issues found by goimports

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

* Comment out the  action for the time being

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

* Fix shadowed variables

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

* go mod tidy

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

* Remove buildtest.yml

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

* go mod tidy

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-05-09 12:51:08 -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
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
ed1e6b2508
WTF-784 Fix CmdRunner title spacing issue (#785)
Closes #784.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-13 21:26:53 -08:00
Charlie Wang
f1ed15a8e4 Prevent flickering in cmdRunner widgets (#778)
* Prevent flickering in cmdRunner widgets

This commit removes flickering in the cmdRunner widgets while preserving
the live-update functionality. It amends 45b955 by not redrawing on
every write call. Instead, the logic in Refresh is as follows:

1. If the command is already running, it will not try to re-run the
command. The default case in the select will trigger a re-draw instead
so that new output can be seen. This accommodates long-runing commands
eg. tailing a log.
2. If the command is not already running, it will trigger a new run.
When the command terminates, it will trigger a re-draw. This means the
widget refreshes as soon as possible, to accommodate the original use
case of running a command and displaying its output in the widget.

In all cases, the widget will not re-draw more often than the refresh
interval. This is what eliminates flickering, since the previous
implementation before using goroutines was not redrawing more than once
per refresh interval.

* Remove useless locking in Refresh

Since the Refresh command doesn't actually block on anything, and the
goroutines have their own locking, Refresh shouldn't lock.
2019-12-13 08:47:09 -08:00
Chris Cummer
251e34af22 Explicit default false for CmdRunner.tail setting
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-27 06:35:39 -08:00
Chris Cummer
a18fce88ac
WTF-718 Fixes missing grid issue when running CmdRunner (#740)
Closes #718 and closes #730.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 14:09:13 -08:00
Tim Scheuermann
4e529b49e6 Expose the widget dimensions to commands in cmdrunner 2019-10-09 14:55:23 +02:00
Tim Scheuermann
0629e28105 Set a proper default line limit 2019-10-07 22:15:14 +02:00
Tim Scheuermann
45b9555633 CmdRunner now updates view while running 2019-10-07 22:10:51 +02:00
Chris Cummer
bf877f5fa7 Constantize the defaultFocus value for each module 2019-09-22 18:12:29 -07: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
3a716bcf9a Convert the bulk of modules over to RedrawFunc 2019-08-26 23:07:02 -04:00
Chris Cummer
4e46fff145 Move the utils.go file into the /utils directory 2019-08-05 10:50:12 -07:00
Chris Cummer
dbc047516d Move all components responsible for module composition into /view 2019-08-04 21:42:40 -07:00
Chris Cummer
c17678013d Fix a couple of 'go vet' issues 2019-08-03 17:16:50 -07:00
Chris Cummer
b07f3c5e67 Reimpliments the module configuration validation
Now supports displaying errors from multiple widgets.
2019-07-07 16:04:43 -07:00
Sean Smith
c1eb75de1a Add more settings helpers to widgets 2019-07-03 19:24:17 -04:00
Sean Smith
cff4c061b2 Allow people to substitute a title for cmdrunner
This falls back to existing logic otherwise
2019-07-01 19:44:56 -04:00
Sean Smith
018d2af3ae Add a global Redraw method for TextWidget
Partially addresses #429, by centralizing widget drawing
2019-05-10 08:42:37 -07:00
Sean Smith
14abd422b2 Add default titles, to mimic original behavior
Have the modules set their own titles
If no title is specified, use this title, rather than default to name
2019-04-30 23:38:37 -04:00
Sean Smith
3a96c303a8 Allow duplicates of modules
This leverages the recent config changes, extending it so that config is literally using passed config, rather than
passed config value
Uses cmdRunner as an example for #181
Because config turns into a map, names are the root keys, and an optional type is provided
2019-04-30 23:33:59 -04:00
Sean Smith
5abd701b40 Decouple modules from global config
Rather than referencing wtc.Config, instead pass the global config
Also, look up config for the module early and pass that in sooner, to deal with fewer long paths and get rid of the
ConfigKey variable
2019-04-27 22:26:23 -04:00
Chris Cummer
5445309aa0 WTF-315 Fix race conditions caused by writing to view 2019-04-25 19:39:49 -07:00
Chris Cummer
a1aae6206f Fix race conditions caused by writing to view 2019-04-25 00:11:16 -07:00
Chris Cummer
79733145f4 Gcal widget properly renders title again 2019-04-19 19:10:22 -07:00
Chris Cummer
a8e3602817 WTF-400 Fix title display in CmdRunner 2019-04-19 09:35:05 -07:00
Chris Cummer
f09d08bda2 WTF-400 Common settings implemented 2019-04-18 18:22:19 -07:00
Chris Cummer
b50c762dab WTF-400 Move name and configKey values from widget to settings 2019-04-17 17:16:26 -07:00
Chris Cummer
2807a2200e WTF-400 Fix missed wtf.Config occurrances 2019-04-16 21:52:10 -07:00
Chris Cummer
73e0e18ebc WTF-400 CmdRunner extracted to new config format 2019-04-15 10:05:57 -07:00
Sean Smith
8030380f89 Migrate all modules to their own subfolder
Handles #375
2019-02-18 11:16:34 -05:00