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

78 Commits

Author SHA1 Message Date
Chris Cummer
971fcee8db Remove references to 'refreshInterval'
Signed-off-by: Chris Cummer <chriscummer@me.com>
2021-04-11 19:25:02 -07:00
David Bouchare
02db55a136
Fix city key (#1061)
* Fix city

* Trigger Build to see if lint is still failing
2021-03-15 20:27:49 -07:00
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
Jason Schweier
b1022d6d18 Fix typo 2020-10-08 20:29:50 -04:00
Ying Fan Chong
2537a7f49a Fix config file path 2020-10-04 20:53:27 +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
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
Sam Roberts
3c405da087 Use docker-credential-helper to manage secrets
Store service credentials securely in the stores supported by docker:
- https://github.com/docker/docker-credential-helpers#available-programs

Introduces a top-level config property, "secretStore" and additional
command line arguments to manage the stored secrets.

The value of secretStore is used to find a helper command,
`docker-credential-<secretStore>`.

The docker project currently provides 4 store helpers:
- "osxkeychain" (OS X only)
- "secretservice" (Linux only)
- "wincred" (Windows only)
- "pass" (any OS supporting pass, which uses gpg2)

Docker-for-desktop installs the credential helpers above, as well as
"desktop" (docker-credential-desktop).

Generic installation instructions for the helpers:
- https://github.com/docker/docker-credential-helpers#installation

Users could provide additional helpers, the only requirement is that the
helper implements the credential store protocol:
- https://github.com/docker/docker-credential-helpers#development

The credential protocol is open, and new credential stores can be
implemented by any CLI satisfying the protocol:
- https://github.com/docker/docker-credential-helpers#development

The modifications to existing modules is not tested due to lack
of API keys, but demonstrates the unobtrusive changes required to
use the secret store.
2020-05-10 19:26:32 -07:00
Chris Cummer
9cd9a58759 Fix a bunch of minor issues found by running staticcheck
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-05-06 22:44:24 -07:00
Sean Smith
4eeb6d67a9 Support XDG_CONFIG_HOME
Clean up workflow and eliminate a method
One place where we calculate the full dir

Closes #699
2020-01-08 23:40:45 -05: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
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