about summary refs log tree commit diff stats
path: root/config/config.go
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2019-08-29 15:30:35 -1000
committerDrew DeVault <sir@cmpwn.com>2019-08-30 10:32:28 +0900
commite4104a867401e383ef2b45f4c449b8b3fa25e69b (patch)
tree74a0ec139b3630e1f9963122d3ffa2809aaf0616 /config/config.go
parentf13f9a86849ff8b4616aa7b462ed171833e02a95 (diff)
downloadaerc-e4104a867401e383ef2b45f4c449b8b3fa25e69b.tar.gz
Allow custom spinner via config file
Allows to set `ui.spinner=` to a string which is then split by
`ui.spinner-delimiter=` (Default: comma) instead of having a hard coded
animation.

This implementation doesn't use INIs capabilities to split strings as
it trims whitespaces breaking the default animation.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 5736678..06caec1 100644
--- a/config/config.go
+++ b/config/config.go
@@ -33,6 +33,8 @@ type UIConfig struct {
 	EmptyDirlist      string   `ini:"empty-dirlist"`
 	MouseEnabled      bool     `ini:"mouse-enabled"`
 	NewMessageBell    bool     `ini:"new-message-bell"`
+	Spinner           string   `ini:"spinner"`
+	SpinnerDelimiter  string   `ini:"spinner-delimiter"`
 }
 
 const (
@@ -347,6 +349,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
 			EmptyDirlist:      "(no folders)",
 			MouseEnabled:      false,
 			NewMessageBell:    true,
+			Spinner:
+				 "[..]    , [..]   ,  [..]  ,   [..] ,    [..],   [..] ,  [..]  , [..]   ",
+			SpinnerDelimiter: ",",
 		},
 
 		Viewer: ViewerConfig{