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

35 Commits

Author SHA1 Message Date
Chris Cummer
d7da659b8b
Add support for user-configuration language tag specification. (#1038)
Adds a new top-level configuration key called "language":

```yaml
wtf:
  langauge: "ja-JP"
```

Users can now define which BCP 47 language tag to use to format any
text or numbers that currently support localization. Defaults to
"en-CA".

Acceptible values: any BCP 47 language tag recognized by the Go
"language" package.

Good luck to you figuring out what that cannonical list is. After a
morning of trying to suss it out, I have no idea.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-29 12:14:20 -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
3521ebf6e8 Rename SigilStr to PaginationMarker
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:07:30 -08:00
Chris Cummer
d672f57c14 Fix warning with type conversion from rune + int to string
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-09-25 06:47:28 -07: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
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
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
bb3c24df73
Normalize coloring (#620)
Allow all colors to be configurable on a module level
2019-09-10 21:22:11 -04: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
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
5a39bc00ce WTF-482 Remove commented-out code 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
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
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
Chris Cummer
cf661e7e15 WTF-400 Todo extracted to new config format 2019-04-15 10:05:57 -07:00