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

61 Commits

Author SHA1 Message Date
Chris Cummer
c1dc9523a6
Revert "gcal module improvements" 2018-07-11 17:33:49 -07:00
Konstantin Vorobyev
e0b54d9315 gcal module improvements:
- Simplify Google OAuth client creation
- Read OAuth code via text dialog

Same approach can be re-used for gspreadsheets
2018-07-01 21:37:07 +02:00
Chris Cummer
f8dabfb800 Wrap Google's calendar Event in a CalEvent struct 2018-06-29 15:15:51 -07:00
Chris Cummer
3f010f8a9f Refactor GCal calendar code to simplify things 2018-06-29 05:28:08 -07:00
Bryan Austin
09e6061d8c Re-work calendar view
As discussed in issue #223 (which has pictures that better explain
the changes here), this change:
- Removes the date from individual events, instead centering a
  title at the start of each day with the date (which uses a new
  configurable color, `wtf.mods.gcal.colors.day`)
- Consolidates 3 lines per event down to 2, moving timestamp to
  front of each event
- Makes the time-until-event text turn red when under 30 minutes
  (wasn't discussed in the issue but was another thing I added
  locally for this, feel free to discard if unwanted)

New format is:
```
           Monday, Jun 25
 x 13:00 Super Cool Meeting Title 2h
 Event location

 x 14:00 Also Super Cool Meeting 3h
 Event location

          Tuesday, Jun 26
 ...
```
2018-06-22 16:27:50 -07:00
Chris Cummer
1a898b05e3 Remove complexity from a lot of string display statements 2018-06-21 19:32:32 -07:00
Chris Cummer
9eabbd1691 Move GCal item check closer to point of impact 2018-06-20 10:38:31 -07:00
Bryan Austin
1077adbff2 Update GCal module's "time until event" text more frequently
While it's reasonable to have a refresh interval of several minutes
between the GCal module hitting the server, the fact that the module
(helpfully) displays the time until an event means that as times
approach zero, they become relatively inaccurate - "3m" might show
up next to a meeting that you were supposed to be in 2 minutes ago.
(don't worry, that hasn't happened to me yet)

This change introduces a goroutine to the GCal module that will
update the module text using the most recently cached copy of
events. By default, it runs every 30 seconds (this could be changed
to 0 to make it opt-in if desired) or however many seconds is
specified by the new config option `wtf.mods.gcal.textInterval`.

To make sure the goroutine doesn't cause any synchronization issues
if a text update were to trigger at the same time as a module
refresh, this change also adds the use of `sync.Mutex` to gate
setting GCal's text. Since both mutexes and having a goroutine within
individual modules are not the sort of thing any other code in
`wtf` does at this point in time, I'm definitely open to feedback
on whether there might be better ways to do this.

Additionally, the change in `wtf.go` fixes an issue I noticed when
testing if my `Disable()` function worked - the main `Widgets`
array wasn't being cleared out after disabling all widgets before
re-creating new copies of them, so it still held pointers to the
old ones.
2018-06-18 17:45:04 -07:00
Chris Cummer
8a0ace3837 Reset permissions on files that were incorrectly set to executable 2018-06-18 08:48:49 -07:00
Chris Cummer
eb5f09e65c Properly scope Config to the wtf package and remove it as a dependency from everywhere else 2018-06-17 08:06:57 -07:00
Lassi Piironen
96e0606c6a Google Calendar: the client reads all the events the user can write on instead of just the accounts primary events, the timestamp printing of the all-day events is handled 2018-06-16 23:37:02 +03:00
Hossein Mehrabi
f33b756d02 removed useless condition in Refresh 2018-06-08 10:59:47 +04:30
Chris Cummer
218b6937b1 Implement ASCII-only widget titles
Widget titles can now be specified in the config file via a 'title' key.
Example:

  wtf:
    mods:
      todo:
        title: Tada

which can include emoji. No need to force everyone to look at my emoji,
now they can define their own.
2018-06-03 20:54:07 -07:00
Hossein Mehrabi
6443df092f use widget.View.SetText to print 2018-06-03 10:53:26 +04:30
Chris Cummer
a62b910893 Closes #43. Add CommandRunner module to the app.
CommandRunner allows you to define a terminal command and arguments, run
it on a schedule, and view the output.

Examples:

   ping -3 cisco.com
2018-05-17 17:15:03 -07:00
Chris Cummer
40ca748b8d More documentation for Clocks, GCal, and Jira. 2018-05-16 19:37:23 -07:00
Chris Cummer
27107fcd37 Closes #33. Creates .wtf dir and config.yml if they don't exist. 2018-05-16 10:23:46 -07:00
Chris Cummer
a729b33ea9 Closes #41. Add option to display user's calendar response status 2018-05-15 11:31:50 -07:00
Chris Cummer
5353d6ddf7 Closes #37. Help into Git and Github modules 2018-05-14 21:04:37 -07:00
Chris Cummer
b5e88d5c16 Can set custom calendar title colors from config 2018-05-04 16:31:10 -07:00
Chris Cummer
da75e116c1 Fix merge conflict in todo/widget.go 2018-04-29 07:56:02 -07:00
Chris Cummer
037c90db85 Widget#focus now a thing
Widgets can inform whether or not they should get tab focus.

Widgets that provide additional functionality should return true.

Widgets that have no extra capability should return false.

This allows the FocusTracker to only tab through and focus on widgets
for which it provides value.
2018-04-28 23:41:51 -07:00
Chris Cummer
bef57d799b Rudimentary modal showing up for Todo on 'e' 2018-04-27 15:48:54 -07:00
Chris Cummer
e90b62e2e5 Better calendar event collision detection 2018-04-19 09:58:26 -07:00
Chris Cummer
3175b8d9cc Quick run through to add some documentation comments 2018-04-17 15:55:36 -07:00
Chris Cummer
693a04b5e1 Removed a bunch of common boilerplate code from widget initialization 2018-04-15 13:08:17 -07:00
Chris Cummer
84ecf296a5 RefreshedAt moved to the end of the refresh (because that makes more sense, doesn't it?) 2018-04-13 16:14:57 -07:00
Chris Cummer
3a3efbd59f Flexible 1on1 lookup (need to move this sort of thing into Config) 2018-04-13 13:50:12 -07:00
Chris Cummer
31e17da358 Hack to fix a unicode rendering issue in iTerm 2018-04-12 18:18:54 -07:00
Chris Cummer
00ec46bfed Fix a bug in GCal with current event display 2018-04-12 14:18:29 -07:00
Chris Cummer
04c3effcea Mark calendar start time conflicts 2018-04-11 16:06:49 -07:00
Chris Cummer
27a267b123 Cleaner config format and added simple_config.yml example 2018-04-10 11:28:48 -07:00
Chris Cummer
79bc8216d6 Don't display disabled widgets 2018-04-07 14:36:13 -07:00
Chris Cummer
ae13d52665 Enabled half-measure: widgets won't run if disabled (still need to not display) 2018-04-07 14:20:21 -07:00
Chris Cummer
b4bc6d4509 Remove a ton of duplication around TextView widget creation 2018-04-07 13:55:08 -07:00
Chris Cummer
42734a502c Widget text spacing 2018-04-06 21:55:44 -07:00
Chris Cummer
fb637700b1 Displays Github review requests and PRs 2018-04-05 21:16:55 -07:00
Chris Cummer
32b395a19e Indicate division between days in calendar widget
Also Clean up gcal's contentFrom() function
2018-04-05 21:16:55 -07:00
Chris Cummer
71f8fc789f A ton of cleanup around how config is handled and go rountines are executed 2018-04-04 18:02:59 -07:00
Chris Cummer
c3f1d7ee36 Configuration used throughout the app 2018-04-04 15:38:29 -07:00
Chris Cummer
45d88c6700 Don't display time until in past calendar events 2018-04-04 11:58:55 -07:00
Chris Cummer
22a9f7b194 Gracefully handle calendar connection failures 2018-04-03 17:49:38 -07:00
Chris Cummer
faa4a915c4 Don't display calendar until() time if in the past 2018-04-03 16:33:26 -07:00
Chris Cummer
12e6b2a9f2 Mark the current calendar event if there is one 2018-04-03 14:51:21 -07:00
Chris Cummer
ef10ac5d0c Refresh the calendar every five minutes 2018-04-03 09:10:52 -07:00
Chris Cummer
7555ae3b5c Border color on the widgets 2018-04-02 22:09:01 -07:00
Chris Cummer
278bf583c4 Remove the common refresher() code into BaseWidget 2018-04-02 04:38:55 -07:00
Chris Cummer
f6e7a2c030 WIP Git widget 2018-03-31 20:04:09 -07:00
Chris Cummer
7b5d06c670 Tweaks to the widget presentation 2018-03-31 13:59:23 -07:00
Chris Cummer
9756e1885f Calendar displays number of days/hours/minutes until the listed meeting 2018-03-31 13:43:03 -07:00