aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_go2work.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_go2work.go')
-rw-r--r--src/c_go2work.go28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/c_go2work.go b/src/c_go2work.go
index 073fb43..079d133 100644
--- a/src/c_go2work.go
+++ b/src/c_go2work.go
@@ -56,18 +56,6 @@ import (
"strings"
)
-const (
- PROGNAME = "go2work"
- VERSION = "0.1.0"
- HOURS = 0
- MINS = 1
- SECS = 2
- INTERVAL = 500
- USE_FORTUNE = true
- MEDIA_PLAYER = "mpv"
- LOG_FORMAT = "bad time format"
-)
-
func main() {
var curr_t [3]byte
var dest_t [3]byte
@@ -92,7 +80,7 @@ func main() {
dest_t = get_test_time()
default:
if strings.Contains(os.Args[1], ":") == false {
- log.Fatal("bad time format")
+ log.Fatal(LOG_FORMAT)
}
str_dest_t := strings.Split(os.Args[1], ":")
tmp, _ = strconv.Atoi(str_dest_t[HOURS])
@@ -101,15 +89,15 @@ func main() {
dest_t[MINS] = byte(tmp)
dest_t[SECS] = 0
}
- if check_media_player(MEDIA_PLAYER) == false {
- log.Fatal("media player (" + MEDIA_PLAYER + ") not found")
+ if check_media_player(DEF_MEDIA_PLAYER) == false {
+ log.Fatal("media player (" + DEF_MEDIA_PLAYER + ") not found")
return
}
- if USE_FORTUNE == true && check_fortune() == false {
+ if DEF_USE_FORTUNE == true && check_fortune() == false {
fmt.Println("Beware, fortune is set on but was not found")
}
if check_time_format(dest_t) == false {
- log.Fatal("bad time format")
+ log.Fatal(LOG_FORMAT)
return
}
curr_t = get_time()
@@ -125,10 +113,10 @@ func main() {
curr_t[MINS] == dest_t[MINS] &&
curr_t[SECS] == dest_t[SECS] {
exec_player(
- USE_FORTUNE,
- MEDIA_PLAYER,
+ DEF_USE_FORTUNE,
+ DEF_MEDIA_PLAYER,
"--no-video",
- "/usr/home/jozan/mu/progressive/progressive_black_metal/deathspell_omega/2010_paracletus/02_wings_of_predation.flac",
+ DEF_FILES,
)
return
}