summaryrefslogtreecommitdiffstats
path: root/src/constants.rs
blob: 7453c7d5ed24d7f5238a287bbea4d078851a45be (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// How long to store data.
pub const STALE_MAX_MILLISECONDS: u128 = 60 * 1000;
pub const TIME_STARTS_FROM: u64 = 60 * 1000;
pub const TICK_RATE_IN_MILLISECONDS: u64 = 200;
// How fast the screen refreshes
pub const DEFAULT_REFRESH_RATE_IN_MILLISECONDS: u128 = 1000;
pub const MAX_KEY_TIMEOUT_IN_MILLISECONDS: u128 = 1000;
// Number of colours to generate for the CPU chart/table
pub const NUM_COLOURS: i32 = 256;

// Help text
pub const GENERAL_HELP_TEXT: [&str; 15] = [
    "General Keybindings\n\n",
    "q, Ctrl-c      Quit bottom\n",
    "Esc            Close filters, dialog boxes, etc.\n",
    "Ctrl-r         Reset all data\n",
    "f              Freeze display\n",
    "Ctrl-Arrow     Change your selected widget\n",
    "Shift-Arrow    Change your selected widget\n",
    "H/J/K/L        Change your selected widget up/down/left/right\n",
    "Up, k          Move cursor up\n",
    "Down, j        Move cursor down\n",
    "?              Open the help screen\n",
    "gg             Skip to the first entry of a list\n",
    "G              Skip to the last entry of a list\n",
    "Enter          Maximize the currently selected widget\n",
    "/              Filter out graph lines (only CPU at the moment)\n",
];

pub const PROCESS_HELP_TEXT: [&str; 8] = [
    "Process Keybindings\n\n",
    "dd             Kill the highlighted process\n",
    "c              Sort by CPU usage\n",
    "m              Sort by memory usage\n",
    "p              Sort by PID\n",
    "n              Sort by process name\n",
    "Tab            Group together processes with the same name\n",
    "Ctrl-f, /      Open up the search widget\n",
];

pub const SEARCH_HELP_TEXT: [&str; 13] = [
    "Search Keybindings\n\n",
    "Tab            Toggle between searching for PID and name.\n",
    "Esc            Close search widget\n",
    "Ctrl-a         Skip to the start of search widget\n",
    "Ctrl-e         Skip to the end of search widget\n",
    "Ctrl-u         Clear the current search query\n",
    "Backspace      Delete the character behind the cursor\n",
    "Delete         Delete the character at the cursor\n",
    "Left           Move cursor left\n",
    "Right          Move cursor right\n",
    "Alt-c/F1       Toggle whether to ignore case\n",
    "Alt-w/F2       Toggle whether to match the whole word\n",
    "Alt-r/F3       Toggle whether to use regex\n",
];

// Config and flags
pub const DEFAULT_UNIX_CONFIG_FILE_PATH: &str = ".config/bottom/bottom.toml";
pub const DEFAULT_WINDOWS_CONFIG_FILE_PATH: &str = "bottom/bottom.toml";

// Default config file
pub const DEFAULT_CONFIG_CONTENT: &str = r##"
# This is a default config file for bottom.  All of the settings are commented
# out by default; if you wish to change them uncomment and modify as you see
# fit.

# This group of options represents a command-line flag/option.  Flags explicitly
# added when running (ie: btm -a) will override this config file if an option
# is also set here.
[flags]

#avg_cpu = true
#dot_marker = false
#rate = 1000
#left_legend = false
#current_usage = false
#group_processes = false
#case_sensitive = false
#whole_word = true
#regex = true
#show_disabled_data = true

# Defaults to Celsius.  Temperature is one of:
#temperature_type = "k"
#temperature_type = "f"
#temperature_type = "c"
#temperature_type = "kelvin"
#temperature_type = "fahrenheit"
#temperature_type = "celsius"

# Defaults to processes.  Default widget is one of:
#default_widget = "cpu_default"
#default_widget = "memory_default"
#default_widget = "disk_default"
#default_widget = "temperature_default"
#default_widget = "network_default"
#default_widget = "process_default"


# These are all the components that support custom theming.  Currently, it only
# supports taking in a string representing a hex colour.  Note that colour support
# will, at the end of the day, depend on terminal support - for example, the
# macOS default Terminal does NOT like custom colours and it will glitch out.
#
# The default options here are based on gruvbox: https://github.com/morhetz/gruvbox
[colors]

# Represents the colour of table headers (processes, CPU, disks, temperature).
#table_header_color="#458588"

# Represents the colour of the label each widget has.
#widget_title_color="#cc241d"

# Represents the average CPU color
#avg_cpu_color="#d3869b"

# Represents the colour the core will use in the CPU legend and graph.
#cpu_core_colors=["#cc241d", "#98971a"]

# Represents the colour RAM will use in the memory legend and graph.
#ram_color="#fb4934"

# Represents the colour SWAP will use in the memory legend and graph.
#swap_color="#fabd2f"

# Represents the colour rx will use in the network legend and graph.
#rx_color="#458588"

# Represents the colour tx will use in the network legend and graph.
#tx_color="#689d6a"

# Represents the colour of the border of unselected widgets.
#border_color="#ebdbb2"

# Represents the colour of the border of selected widgets.
#highlighted_border_color="#fe8019"

# Represents the colour of most text.
#text_color="#ebdbb2"

# Represents the colour of text that is selected.
#selected_text_color="#282828"

# Represents the background colour of text that is selected.
#selected_bg_color="#458588"

# Represents the colour of the lines and text of the graph.
#graph_color="#ebdbb2"

# Represents the cursor's colour.
#cursor_color="#458588"
"##;