mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 12:07:23 +00:00
Update config to be more uniform
This commit is contained in:
@ -2,23 +2,24 @@ package main
|
|||||||
|
|
||||||
var defaultConfig = `
|
var defaultConfig = `
|
||||||
[basics]
|
[basics]
|
||||||
downloadPath = "/tmp/"
|
download_path = "/tmp/"
|
||||||
colorless = false
|
colorless = false
|
||||||
|
|
||||||
# The prefix before evaluating a command
|
# The prefix before evaluating a command
|
||||||
cmdPrefix = "/"
|
cmd_prefix = "/"
|
||||||
|
|
||||||
[formatting]
|
[formatting]
|
||||||
# BASH-like PS1 variable equivalent
|
# BASH-like PS1 variable equivalent
|
||||||
outputFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
outputStreamFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_stream_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
outputMentionFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_mention_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
pmFormat = "PM from $USER@$DEVICE: $MSG"
|
pm_format = "PM from $USER@$DEVICE: $MSG"
|
||||||
|
|
||||||
# 02 = Day, Jan = Month, 06 = Year
|
# 02 = Day, Jan = Month, 06 = Year
|
||||||
dateFormat = "02Jan06"
|
date_format = "02Jan06"
|
||||||
|
|
||||||
# 15 = hours, 04 = minutes, 05 = seconds
|
# 15 = hours, 04 = minutes, 05 = seconds
|
||||||
timeFormat = "15:04"
|
time_format = "15:04"
|
||||||
|
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
|
|||||||
17
kbtui.toml
17
kbtui.toml
@ -1,21 +1,22 @@
|
|||||||
[basics]
|
[basics]
|
||||||
downloadPath = "/tmp/"
|
download_path = "/tmp/"
|
||||||
colorless = false
|
colorless = false
|
||||||
|
|
||||||
# The prefix before evaluating a command
|
# The prefix before evaluating a command
|
||||||
cmdPrefix = "/"
|
cmd_prefix = "/"
|
||||||
|
|
||||||
[formatting]
|
[formatting]
|
||||||
# BASH-like PS1 variable equivalent
|
# BASH-like PS1 variable equivalent
|
||||||
outputFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
outputStreamFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_stream_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
outputMentionFormat = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
output_mention_format = "┌──[$USER@$DEVICE] [$ID] [$DATE - $TIME]\n└╼ $MSG"
|
||||||
pmFormat = "PM from $USER@$DEVICE: $MSG"
|
pm_format = "PM from $USER@$DEVICE: $MSG"
|
||||||
|
|
||||||
# 02 = Day, Jan = Month, 06 = Year
|
# 02 = Day, Jan = Month, 06 = Year
|
||||||
dateFormat = "02Jan06"
|
date_format = "02Jan06"
|
||||||
|
|
||||||
# 15 = hours, 04 = minutes, 05 = seconds
|
# 15 = hours, 04 = minutes, 05 = seconds
|
||||||
timeFormat = "15:04"
|
time_format = "15:04"
|
||||||
|
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
|
|||||||
37
types.go
37
types.go
@ -20,27 +20,37 @@ type TypeCommand struct {
|
|||||||
|
|
||||||
// Config holds user-configurable values
|
// Config holds user-configurable values
|
||||||
type Config struct {
|
type Config struct {
|
||||||
filepath string `toml:"-"`
|
filepath string `toml:"-"` // filepath is not stored in the config file, but is written to the Config struct so it's known where the config was loaded from
|
||||||
Basics Basics `toml:"basics"`
|
Basics Basics `toml:"basics"`
|
||||||
Formatting Formatting `toml:"formatting"`
|
Formatting Formatting `toml:"formatting"`
|
||||||
Colors Colors `toml:"colors"`
|
Colors Colors `toml:"colors"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basics holds the 'basics' section of the config file
|
||||||
type Basics struct {
|
type Basics struct {
|
||||||
DownloadPath string `toml:"downloadPath"`
|
DownloadPath string `toml:"download_path"`
|
||||||
Colorless bool `toml:"colorless"`
|
Colorless bool `toml:"colorless"`
|
||||||
CmdPrefix string `toml:"cmdPrefix"`
|
CmdPrefix string `toml:"cmd_prefix"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Formatting holds the 'formatting' section of the config file
|
||||||
type Formatting struct {
|
type Formatting struct {
|
||||||
OutputFormat string `toml:"outputFormat"`
|
OutputFormat string `toml:"output_format"`
|
||||||
OutputStreamFormat string `toml:"outputStreamFormat"`
|
OutputStreamFormat string `toml:"output_stream_format"`
|
||||||
OutputMentionFormat string `toml:"outputMentionFormat"`
|
OutputMentionFormat string `toml:"output_mention_format"`
|
||||||
PMFormat string `toml:"pmFormat"`
|
PMFormat string `toml:"pm_format"`
|
||||||
DateFormat string `toml:"dateFormat"`
|
DateFormat string `toml:"date_format"`
|
||||||
TimeFormat string `toml:"timeFormat"`
|
TimeFormat string `toml:"time_format"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Colors holds the 'colors' section of the config file
|
||||||
|
type Colors struct {
|
||||||
|
Channels Channels `toml:"channels"`
|
||||||
|
Message Message `toml:"message"`
|
||||||
|
Feed Feed `toml:"feed"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Style holds basic style information
|
||||||
type Style struct {
|
type Style struct {
|
||||||
Foreground string `toml:"foreground"`
|
Foreground string `toml:"foreground"`
|
||||||
Background string `toml:"background"`
|
Background string `toml:"background"`
|
||||||
@ -51,12 +61,14 @@ type Style struct {
|
|||||||
Inverse bool `toml:"inverse"`
|
Inverse bool `toml:"inverse"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Channels holds the style information for various elements of a channel
|
||||||
type Channels struct {
|
type Channels struct {
|
||||||
Basic Style `toml:"basic"`
|
Basic Style `toml:"basic"`
|
||||||
Header Style `toml:"header"`
|
Header Style `toml:"header"`
|
||||||
Unread Style `toml:"unread"`
|
Unread Style `toml:"unread"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Message holds the style information for various elements of a message
|
||||||
type Message struct {
|
type Message struct {
|
||||||
Body Style `toml:"body"`
|
Body Style `toml:"body"`
|
||||||
Header Style `toml:"header"`
|
Header Style `toml:"header"`
|
||||||
@ -72,13 +84,8 @@ type Message struct {
|
|||||||
Code Style `toml:"code"`
|
Code Style `toml:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Feed holds the style information for various elements of the feed window
|
||||||
type Feed struct {
|
type Feed struct {
|
||||||
Basic Style `toml:"basic"`
|
Basic Style `toml:"basic"`
|
||||||
Error Style `toml:"error"`
|
Error Style `toml:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Colors struct {
|
|
||||||
Channels Channels `toml:"channels"`
|
|
||||||
Message Message `toml:"message"`
|
|
||||||
Feed Feed `toml:"feed"`
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user