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

65 Commits

Author SHA1 Message Date
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
3a388fba23
20191215 code improvements (#790)
* Upgrade godo to latest
* Fix a bunch of issues found by
* Running staticcheck on a codebase for the first time is a sobering experience
* go mod tidy
* More static improvements

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-16 20:25:29 -08:00
Chris Cummer
bf85d4b144
IPInfo styling (#744)
* WIP

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

* Fix the colour scheme for IPInfo to match other modules

Now uses standard label and text colours.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-12 20:10:26 -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
Chris Cummer
1bfca29d17
WTF-657 Add spec coverage for cfg/common_settings.go (#728)
* WTF-657 Add spec coverage for cfg/common_settings.go

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

* WTF-657 Add spec coverage for cfg/position_validation.go

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

* WTF-657 Add spec coverage for cfg/validations.go

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

* WTF-657 Add spec coverage for checklist/checklist.go

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

* WTF-657 Add spec coverage for checklist/checklist_item.go

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

* WTF-657 Add spec coverage for utils/conversions.go

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

* WTF-657 Get rid of utils.Home() function

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

* WTF-657 Add spec coverage for utils/homedir.go

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

* WTF-657 Add spec coverage for utils/text.go

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

* WTF-657 Clean up utils/utils.go

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-10-30 17:35:00 -07:00
Ricardo N Feliciano
b90ae573c3 Remove blank line from default config. 2019-10-16 19:21:55 -04:00
Chris Cummer
ca0345a0b4 Fix a bug with subreddit module row colour
Even and odd rows now display as different colours when row colour is
explicitly defined in the module config.
2019-10-02 05:37:31 -07:00
Chris Cummer
bacb661573 WTF-573 Add padding value to default row and col setting
Fixes #573.
2019-10-01 22:52:37 -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
9f81207037 Clean up cfg error handling a bit
Pass in the actual file being used, rather than hardcoded `config.yaml`
Differences between two error messages are not that distinct
Centralize on one and clean up all the `isCustomConfig` tracking
2019-09-12 20:28:24 -04:00
Sean Smith
bb3c24df73
Normalize coloring (#620)
Allow all colors to be configurable on a module level
2019-09-10 21:22:11 -04:00
Chris Cummer
f83e57c0b7 WTF-566 Support GitLab projects as list 2019-09-06 20:52:26 -07:00
Sean Smith
0c8c1989b7 Fix module color config
Make sure we use `moduleConfig` with appropriate path
And `colorsConfig` for appropriate fallback
2019-09-04 21:42:34 -04:00
Sean Smith
146cbb598a Attempt to offer linux transparency
Add 'transparent' as a color option
Default to 'transparent'
Make sure to set color to appropriate things, so transparency is achieved
2019-08-20 22:28:14 -04:00
Chris Cummer
b9d1017754 Remove another panic call 2019-08-03 12:27:38 -07:00
Chris Cummer
4c2b52cdbb Improve the config file handling process
* Don't create a default config if a custom config is being passed in
* Textfile: don't die if the file cannot be found
2019-08-02 01:51:56 -07:00
Chris Cummer
4c0f7650dd Improve error messages 2019-07-29 06:15:51 -07:00
Chris Cummer
50cc9669c5 Explicitly set the default config file's mode to 0600 2019-07-25 10:29:00 -07:00
Chris Cummer
0bc6965681 WTF-504 Improve the default config 2019-07-22 22:54:01 -07:00
Chris Cummer
7a7df7d4a7 Clean up the /cfg files a bit; simplify config handling in main.go 2019-07-21 16:23:45 -07:00
Chris Cummer
5e18538f14 Display a useful error message for custom configuration files 2019-07-20 13:04:13 -07:00
Chris Cummer
452e6f20db WTF-510 Add error messaging if the config directories cannot be created 2019-07-20 12:23:19 -07:00
Chris Cummer
00ccf8a95b WTF-510 Create the ~/.config directory if it is missing 2019-07-20 12:12:04 -07:00
Chris Cummer
c2e240014d Add support for a new 'border' property on widgets
Sets whether or not the widget should be drawn with a border (and by
extension a title).

If 'true', the border is drawn. If 'false', no
border is drawn. Defaults. to 'true'. Optional.
2019-07-10 22:30:36 -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
Chris Cummer
c308d1b6c2 Add help tag to Title in common_settings 2019-07-06 02:10:06 -07:00
Chris Cummer
eff0d55c28 Fix spelling mistake in DefaultFocussedRowColor() name 2019-07-05 22:33:15 -07:00
Chris Cummer
0104f97805 Use a map to return the failed position value and error message 2019-07-05 22:21:50 -07:00
Chris Cummer
774c465f57 WTF-482 More explicit param name in position.go 2019-07-05 21:45:59 -07:00
Chris Cummer
5a39bc00ce WTF-482 Remove commented-out code 2019-07-05 21:45:59 -07:00
Chris Cummer
ca81aa5134 WTF-482 Fix redundant newline warning 2019-07-05 21:45:59 -07:00
Chris Cummer
08c7e768c0 WTF-482 Sanity-check position configuration data for modules
If a module is missing any of the positional data it now informs the
user and exits gracefully with an error.
2019-07-05 21:45:59 -07:00
Chris Cummer
9d38f5439d Improve the error messaging around a mis-configured configuration file 2019-06-30 21:19:36 -07:00
Sean Smith
d8f337884f Add more 'man page' like functionality 2019-05-24 00:06:10 -04:00
Kirill Motkov
f0771cd013 Some code improvements
* Some assignments simplified by using assignment operators
* Rewrite switch statement with only one case as if.
* Rewrite if-else chain as a switch statement.
* go fmt `modules/todoist/project.go` file.
2019-05-21 17:29:09 +03:00
Chris Cummer
a9c5dc3be8 WTF-427 Add KeyboardWidget and switch Todo widget to using it 2019-05-06 12:54:04 -07:00
Sean Smith
fa0edec74b Fix up Unknown widget to work again
Store module Type in common settings to enable this
Simplify the function params to be more inline with existing ones, vs being unique
2019-05-02 23:40:49 -04: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
ce2a9b3301 Get rid of the rest of global config
Pass appropriate config to display/focus tracker
Move open file command to a singular global
Remove global config variable
2019-04-27 22:26:23 -04:00
Sean Smith
bcf899df72 Further reduce usage of global
Bargraph moves to common settings
"Global" config moves out of wtf and into cfg for the few things that need it
We can probably eliminate a global config used across things if we want to
2019-04-27 22:26:23 -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
d0c1a5db96 WTF-413 Fix right-align to account for both widget borders. Closes #413 2019-04-25 19:52:15 -07:00
Chris Cummer
f60ce6967d Clean up TextWidget by simplifying the view creation 2019-04-23 19:59:51 -07:00
Chris Cummer
88fdf9702b WTF-400 Move settings-related functions from util.go into common_settings.go 2019-04-21 21:35:45 -07:00
Chris Cummer
6fd9430ef8 WTF-400 TextWidget properly renders title again 2019-04-19 14:06:55 -07:00
Chris Cummer
a8e3602817 WTF-400 Fix title display in CmdRunner 2019-04-19 09:35:05 -07:00
Chris Cummer
59f0bc6cfc WTF-400 Partial conversion to new Common settings 2019-04-18 19:02:08 -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