aboutsummaryrefslogtreecommitdiffstats
path: root/README.org
blob: c2ed26ecf288960098d2519542a96650ca5fc039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#+TITLE: go2work

*go2work* is a small command-line program to help you get up in the morning
so you can work. You can set custom ringtones and get a cool fortune too.
It is very inspired from
[[https://github.com/jahendrie/shalarm][shalarm]]. I made *go2work* originally to learn
the Go programming language and also because ~shalarm~ didn't work out
of the box on FreeBSD.

*go2work* has several options and is configurable though a configuration file.
Refer to
#+BEGIN_SRC shell
man go2work
#+END_SRC
to get a list of all options.

* Dependencies
- Go
- GNU Make
- fortune (optional)

* Installation
You can get *go2work* through ~git~ and build it from source. The installation
is straight forward:
#+BEGIN_SRC shell
git clone git://jozanofastora.xyz/jozan/go2work.git
cd go2work
make
sudo make install clean
#+END_SRC
Note that on BSD systems you want to use ~gmake~ instead of ~make~:
#+BEGIN_SRC shell
gmake
sudo gmake install clean
#+END_SRC

* Configuration and usage
Here is the default configuration file path:

~/usr/local/etc/go2work/go2work.toml~

It is recommanded to copy it right away to
~/home/your_name/.config/go2work/go2work.toml~.
*go2work* will search for configuration files in this order of importance:

~$XDG_CONFIG_HOME/go2work/go2work.toml~

~$HOME/.config/go2work/go2work.toml~

~/usr/local/etc/go2work/go2work.toml~

Here are some examples of usage.

It is highly recommanded to test your configuration first, unless you
intentionally plan on not waking up. To run a test, use:
#+BEGIN_SRC shell
go2work -t
#+END_SRC

To stop the alarm, use ~Ctrl + C~ to abort the program. If your ringtone is
done playing, it will play again until you wake the fuck up and insert a
~Ctrl + C~ event into *go2work*.

Given time must always be in 24 hours format because it just is better than 12.
When planning to wake up at *06:30 A.M.* use:
#+BEGIN_SRC shell
go2work 06:30
#+END_SRC
or this will work as well:
#+BEGIN_SRC shell
go2work 6:30
#+END_SRC
But when planning on waking up at *06:30 P.M.* use:
#+BEGIN_SRC shell
go2work 18:30
#+END_SRC

When minutes don't matter, for example setting the alarm at *10:00*,
you can format the time as:
#+BEGIN_SRC shell
go2work 10:00
#+END_SRC
or this is valid too:
#+BEGIN_SRC shell
go2work 10:
#+END_SRC
However, this:
#+BEGIN_SRC shell
go2work 10
#+END_SRC
will give you an error. Time must be formatted somewhat properly.

Remaining time before the alarm rings is being displayed to confirm
that *go2work* is engaged.

* Uninstall
If you are unhappy with *go2work* because you don't like to work,
navigate to the ~go2work/~ directory and run the following command:
#+BEGIN_SRC shell
sudo make uninstall
#+END_SRC
Or on BSD systems with ~gmake~:
#+BEGIN_SRC shell
sudo gmake uninstall
#+END_SRC

* End note
Go is fun to learn and play with. I might continue developping *go2work* in
the future by adding a full TUI and more options but this is uncertain.

Please note that *go2work* was tested only on FreeBSD and Linux at the
moment. macOS is not supported but should work just fine, Windows probably won't
work at all. You can report any bug at /bousset.rudy@gmail.com/
or on GitHub at
[[https://github.com/JozanLeClerc/go2work/issues][github.com/JozanLeClerc/go2work/issues]].

Thanks for checking *go2work*