2023-09-27 22:55:13 -04:00
|
|
|
{- Types to define a conky configuration.
|
|
|
|
|
|
|
|
Key terms:
|
|
|
|
- widget: the components of a module (dials, bars, plots, etc)
|
|
|
|
- module: a monitor for some aspect of the system to be displayed
|
|
|
|
- column: a vertical arrangement of modules
|
|
|
|
- panel: a horizontal arrangement of columns
|
|
|
|
- layout: a horizontal arrangement of panels
|
|
|
|
- geometry: the 'dimensions' of a widget
|
|
|
|
- pattern: the color/gradient to be used in widgets
|
|
|
|
|
|
|
|
NOTE: geometry is defined on a global level and at the module level. The global
|
|
|
|
level is defined in the theme type (see below) and applies to all widgets
|
|
|
|
equally. Some dimensions are not defined globally and are instead delegated to
|
|
|
|
each module to define themselves (these are not overrides so they must be
|
|
|
|
specified, although most modules have sensible defaults hardcoded)
|
|
|
|
|
|
|
|
See the 'fallback' config for an example of how to use these types.
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
let Vector2 = \(a : Type) -> { x : a, y : a }
|
|
|
|
|
|
|
|
let Point = Vector2 Natural
|
|
|
|
|
|
|
|
let Margin = Vector2 Natural
|
|
|
|
|
2022-08-11 00:05:06 -04:00
|
|
|
let FSPath = { name : Text, path : Text }
|
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
let TextGeo =
|
|
|
|
{-
|
|
|
|
Defines text dimensions for multiline visuals
|
2022-08-15 23:23:15 -04:00
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
text_spacing: gap between lines of text
|
|
|
|
-}
|
|
|
|
{ Type = { text_spacing : Natural }, default.text_spacing = 20 }
|
|
|
|
|
|
|
|
let SepGeo =
|
|
|
|
{-
|
|
|
|
Defines separator dimensions
|
|
|
|
|
|
|
|
sep_spacing: gap between the separator and either above or below
|
|
|
|
-}
|
|
|
|
{ Type = { sep_spacing : Natural }, default.sep_spacing = 20 }
|
2022-08-15 23:23:15 -04:00
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
let PlotGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines plot dimensions
|
|
|
|
|
|
|
|
sec_break: gap between the plot label and the plot itself
|
|
|
|
height: height of the plot (without the label)
|
|
|
|
ticks_y: number of ticks on the y axis
|
|
|
|
-}
|
2022-08-16 23:49:13 -04:00
|
|
|
{ Type = { sec_break : Natural, height : Natural, ticks_y : Natural }
|
|
|
|
, default = { sec_break = 20, height = 56, ticks_y = 4 }
|
2022-08-15 23:23:15 -04:00
|
|
|
}
|
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
let PlotGeo_ = { Type = { plot : PlotGeo.Type }, default.plot = PlotGeo::{=} }
|
2022-08-16 00:14:04 -04:00
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
let TableGeo =
|
|
|
|
{-
|
|
|
|
Defines table dimensions
|
|
|
|
|
|
|
|
sec_break: spacing between header and the first table row
|
|
|
|
-}
|
|
|
|
{ Type = { sec_break : Natural }, default.sec_break = 20 }
|
2022-08-16 00:14:04 -04:00
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
let TableGeo_ =
|
|
|
|
{ Type = { table : TableGeo.Type }, default.table = TableGeo::{=} }
|
2022-08-16 00:14:04 -04:00
|
|
|
|
|
|
|
let FSGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Filesystem module dimensions
|
|
|
|
|
|
|
|
bar_spacing: spacing between percent usage bars
|
|
|
|
bar_pad: spacing between usage bars and the left edge of the panel
|
|
|
|
-}
|
2022-08-16 00:14:04 -04:00
|
|
|
{ Type = { bar_spacing : Natural, bar_pad : Natural } //\\ SepGeo.Type
|
|
|
|
, default = { bar_spacing = 20, bar_pad = 100 } /\ SepGeo::{=}
|
|
|
|
}
|
|
|
|
|
2022-08-15 23:23:15 -04:00
|
|
|
let GfxGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Graphics module dimensions
|
|
|
|
|
|
|
|
See PlotGeo, TextGeo, and SepGeo for options included here
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = SepGeo.Type //\\ PlotGeo_.Type //\\ TextGeo.Type
|
|
|
|
, default = SepGeo::{=} /\ PlotGeo_::{=} /\ TextGeo::{=}
|
2022-08-16 00:14:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
let MemGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Memory module dimensions
|
|
|
|
|
|
|
|
See PlotGeo, TextGeo, and TableGeo for options included here
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = TextGeo.Type //\\ PlotGeo_.Type //\\ TableGeo_.Type
|
|
|
|
, default = TextGeo::{=} /\ PlotGeo_::{=} /\ TableGeo_::{=}
|
2022-08-16 00:14:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
let ProcGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Processor module dimensions
|
|
|
|
|
|
|
|
See GfxGeo and TableGeo for options included here
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = GfxGeo.Type //\\ TableGeo_.Type
|
|
|
|
, default = GfxGeo::{=} /\ TableGeo_::{=}
|
2022-08-16 00:14:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
let PwrGeo =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Processor module dimensions
|
|
|
|
|
|
|
|
See TextGeo and PlotGeo for options included here
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = TextGeo.Type //\\ PlotGeo_.Type
|
|
|
|
, default = TextGeo::{=} /\ PlotGeo_::{=}
|
2022-08-16 00:14:04 -04:00
|
|
|
}
|
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
let AllGeo =
|
|
|
|
{ TextGeo, PlotGeo, TableGeo, FSGeo, GfxGeo, MemGeo, ProcGeo, PwrGeo }
|
|
|
|
|
2022-08-16 00:14:04 -04:00
|
|
|
let FileSystem =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Filesystem module configuration
|
|
|
|
|
|
|
|
show_smart: show SMART daemon indicator
|
|
|
|
show_seafile: show seafile daemon indicator
|
|
|
|
fs_paths: list of filesystem paths to monitor for percent usage
|
|
|
|
geometry: dimensional data for this module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
{ Type =
|
2023-01-08 12:12:57 -05:00
|
|
|
{ show_smart : Bool
|
|
|
|
, show_seafile : Bool
|
|
|
|
, fs_paths : List FSPath
|
|
|
|
, geometry : FSGeo.Type
|
|
|
|
}
|
2022-08-16 00:14:04 -04:00
|
|
|
, default.geometry = FSGeo::{=}
|
2022-08-15 23:23:15 -04:00
|
|
|
}
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-28 23:25:11 -04:00
|
|
|
let GPUPower =
|
|
|
|
{-
|
|
|
|
Controls how the GPU will be queries so it can go to sleep when 'idle'.
|
|
|
|
|
|
|
|
freq_limit: only query the GPU every 'cycle_seconds' when frequency is below
|
|
|
|
this value; this should be a sensible value representing and
|
2023-09-28 23:26:58 -04:00
|
|
|
'idle' gpu state. Set to 0 to disable this check entirely.
|
2023-09-28 23:25:11 -04:00
|
|
|
cycle_seconds: the number of seconds to query the GPU when below the idle
|
|
|
|
frequency limit; note that this must be long enough to let
|
|
|
|
the GPU go to sleep when it actually is ready to sleep, but
|
|
|
|
not so long that the next query will miss too much activity
|
|
|
|
in the case the GPU doesn't shut off
|
|
|
|
-}
|
|
|
|
{ Type = { freq_limit : Natural, cycle_seconds : Natural }
|
|
|
|
, default = { freq_limit = 250, cycle_seconds = 10 }
|
|
|
|
}
|
|
|
|
|
2022-08-10 22:22:50 -04:00
|
|
|
let Graphics =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Graphics module configuration
|
|
|
|
|
|
|
|
dev_power: show a power indicator
|
|
|
|
show_temp: show temperature in celsius
|
|
|
|
show_clock: show clock speed
|
|
|
|
show_gpu_util: show percent utilization
|
|
|
|
show_mem_util: show percent memory utilized
|
|
|
|
show_vid_util: show percent video utilized
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
{ Type =
|
|
|
|
{ dev_power : Text
|
|
|
|
, show_temp : Bool
|
|
|
|
, show_clock : Bool
|
|
|
|
, show_gpu_util : Bool
|
|
|
|
, show_mem_util : Bool
|
|
|
|
, show_vid_util : Bool
|
|
|
|
, geometry : GfxGeo.Type
|
2023-09-28 23:25:11 -04:00
|
|
|
, power : GPUPower.Type
|
2022-08-15 23:23:15 -04:00
|
|
|
}
|
2023-09-28 23:25:11 -04:00
|
|
|
, default = { geometry = GfxGeo::{=}, power = GPUPower::{=} }
|
2022-08-15 23:23:15 -04:00
|
|
|
}
|
|
|
|
|
2022-08-10 22:22:50 -04:00
|
|
|
let Memory =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Memory module configuration
|
|
|
|
|
|
|
|
show_stats: show total memory gauge, cache, buffers, shared, and slab
|
|
|
|
show_plot: show memory utilization plot
|
|
|
|
show_swap: show swap utilization gauge (only if 'show_stats' is true)
|
|
|
|
table_rows: top processes by memory to display in table (max 10)
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
{ Type =
|
|
|
|
{ show_stats : Bool
|
|
|
|
, show_plot : Bool
|
|
|
|
, show_swap : Bool
|
|
|
|
, table_rows : Natural
|
|
|
|
, geometry : MemGeo.Type
|
|
|
|
}
|
|
|
|
, default.geometry = MemGeo::{=}
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
|
2022-08-15 23:23:15 -04:00
|
|
|
let Network =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Network module configuration
|
|
|
|
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = { geometry : PlotGeo_.Type }, default.geometry = PlotGeo_::{=} }
|
2022-08-15 23:23:15 -04:00
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
let CoreGroup =
|
|
|
|
{-
|
|
|
|
Defines a processor group for the Processor module
|
|
|
|
|
|
|
|
threads: the number of threads for each core in this group (usually 1 or 2)
|
|
|
|
rows: the number of rows over which to display the cores in this group
|
|
|
|
padding: the spacing to the left and right of the gauges in this group
|
|
|
|
-}
|
|
|
|
{ threads : Natural, rows : Natural, padding : Natural }
|
2023-09-26 00:55:39 -04:00
|
|
|
|
2022-08-10 22:22:50 -04:00
|
|
|
let Processor =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Network module configuration
|
|
|
|
|
|
|
|
core_groups: a list of core groups to display
|
|
|
|
show_stats: show frequency for each core group and HWP status
|
|
|
|
show_plot: show percent utilization plot
|
|
|
|
table_rows: top processes by cpu percent to display in table (max 10)
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
{ Type =
|
2023-09-26 00:55:39 -04:00
|
|
|
{ core_groups : List CoreGroup
|
2022-08-15 23:23:15 -04:00
|
|
|
, show_stats : Bool
|
|
|
|
, show_plot : Bool
|
|
|
|
, table_rows : Natural
|
|
|
|
, geometry : ProcGeo.Type
|
|
|
|
}
|
|
|
|
, default.geometry = ProcGeo::{=}
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
|
2022-08-15 23:23:15 -04:00
|
|
|
let Pacman =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Pacman module configuration
|
|
|
|
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-16 00:14:04 -04:00
|
|
|
{ Type = { geometry : TextGeo.Type }, default.geometry = TextGeo::{=} }
|
2022-08-15 23:23:15 -04:00
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
let RaplSpec =
|
|
|
|
{-
|
|
|
|
Defines a RAPL endpoint to display in the Power module
|
|
|
|
|
|
|
|
name: nice name to display above plot
|
|
|
|
address: sysfs address to the directory containing the 'energy_uj' file
|
|
|
|
-}
|
|
|
|
{ name : Text, address : Text }
|
|
|
|
|
2022-08-15 23:23:15 -04:00
|
|
|
let Power =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines Power module configuration
|
|
|
|
|
|
|
|
battery: sysfs path to the battery to display
|
|
|
|
rapl_specs: list of RAPL endpoints to display
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
{ Type =
|
|
|
|
{ battery : Text, rapl_specs : List RaplSpec, geometry : PwrGeo.Type }
|
|
|
|
, default.geometry = PwrGeo::{=}
|
|
|
|
}
|
|
|
|
|
|
|
|
let ReadWrite =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines ReadWrite module configuration
|
|
|
|
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
2022-08-28 23:52:09 -04:00
|
|
|
{ Type = { devices : List Text, geometry : PlotGeo_.Type }
|
|
|
|
, default.geometry = PlotGeo_::{=}
|
2022-08-15 23:23:15 -04:00
|
|
|
}
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 00:40:37 -04:00
|
|
|
let System =
|
|
|
|
{-
|
|
|
|
Defines System module configuration
|
|
|
|
|
|
|
|
geometry: dimensional configuration for this module
|
|
|
|
-}
|
|
|
|
Pacman
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
let AllModules =
|
|
|
|
{ FileSystem
|
|
|
|
, Graphics
|
|
|
|
, Memory
|
|
|
|
, Network
|
|
|
|
, Pacman
|
|
|
|
, Power
|
|
|
|
, Processor
|
|
|
|
, ReadWrite
|
|
|
|
, System
|
|
|
|
}
|
|
|
|
|
2022-08-10 22:22:50 -04:00
|
|
|
let ModType =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Wrapper type for each module
|
|
|
|
-}
|
2022-08-15 23:23:15 -04:00
|
|
|
< filesystem : FileSystem.Type
|
|
|
|
| graphics : Graphics.Type
|
|
|
|
| memory : Memory.Type
|
|
|
|
| network : Network.Type
|
|
|
|
| pacman : Pacman.Type
|
|
|
|
| processor : Processor.Type
|
|
|
|
| power : Power.Type
|
|
|
|
| readwrite : ReadWrite.Type
|
|
|
|
| system : System.Type
|
2022-08-10 22:22:50 -04:00
|
|
|
>
|
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Annotated =
|
|
|
|
{- Helper to ensure yaml is formatted in a parsable manner for union types
|
|
|
|
|
|
|
|
The intent is to make a block like:
|
|
|
|
|
|
|
|
parent:
|
|
|
|
type: <constructor_name>
|
|
|
|
data: <stuff_in_the_union_type>
|
|
|
|
-}
|
|
|
|
\(a : Type) -> { type : Text, data : a }
|
|
|
|
|
|
|
|
let Block =
|
|
|
|
{- Either vertical padding or a module -}
|
|
|
|
< Pad : Natural | Mod : Annotated ModType >
|
|
|
|
|
|
|
|
let Column_ =
|
|
|
|
{- A column of modules to display
|
|
|
|
|
|
|
|
blocks: a list of blocks (either padding or a module)
|
|
|
|
width: the width of the column (and consequently everything in said column)
|
|
|
|
-}
|
|
|
|
{ blocks : List Block, width : Natural }
|
2022-08-12 00:20:01 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Column =
|
|
|
|
{- Either a column with modules or padding between columns -}
|
|
|
|
< CPad : Natural | CCol : Column_ >
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Panel_ =
|
|
|
|
{- A panel definition.
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
columns: a list of columns to show (must be at least one)
|
|
|
|
margins: space between the panel border and the columns
|
|
|
|
-}
|
|
|
|
{ columns : List Column, margins : Margin }
|
2022-08-11 00:27:16 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Panel =
|
|
|
|
{- Wrapper type for either a panel or horizontal padding between panels -}
|
|
|
|
< PPad : Natural | PPanel : Panel_ >
|
2022-08-11 00:27:16 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Layout =
|
|
|
|
{- The layout of the display
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
'anchor' is the coordinate of the upper-left corner, and 'panels' contains
|
|
|
|
the specifications of each panel (ie modules to show).
|
|
|
|
-}
|
|
|
|
{ anchor : Point, panels : List Panel }
|
2022-08-10 22:22:50 -04:00
|
|
|
|
|
|
|
let Sizes =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- The font sizes to use for various widgets
|
|
|
|
|
|
|
|
plot_label: the text above the plot
|
|
|
|
table: the text in a table (headers and rows)
|
|
|
|
header: the text of each module header
|
|
|
|
normal: all other text (excluding plot axes)
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type =
|
|
|
|
{ normal : Natural
|
|
|
|
, plot_label : Natural
|
|
|
|
, table : Natural
|
|
|
|
, header : Natural
|
|
|
|
}
|
|
|
|
, default = { normal = 13, plot_label = 8, table = 11, header = 15 }
|
|
|
|
}
|
|
|
|
|
|
|
|
let Font =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- A complete font specification -}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type = { family : Text, sizes : Sizes.Type }
|
|
|
|
, default = { family = "Neuropolitical", sizes = Sizes::{=} }
|
|
|
|
}
|
|
|
|
|
|
|
|
let PlotGeometry =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Global dimensions for a plot
|
|
|
|
|
|
|
|
seconds: number of seconds to display on the x axis
|
|
|
|
ticks_x: the number of ticks to display on the x axis
|
|
|
|
-}
|
2022-08-16 23:53:45 -04:00
|
|
|
{ Type = { seconds : Natural, ticks_x : Natural }
|
|
|
|
, default = { seconds = 90, ticks_x = 9 }
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
let TableGeometry =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Global dimensions for a table
|
|
|
|
|
|
|
|
name_chars: the max number of characters a cell can have before being truncated
|
|
|
|
padding: the margins between the border and the interior text
|
|
|
|
header_padding: the distance between the header and the first row of text
|
|
|
|
row_spacing: the distance between each row
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type =
|
|
|
|
{ name_chars : Natural
|
|
|
|
, padding : Margin
|
|
|
|
, header_padding : Natural
|
|
|
|
, row_spacing : Natural
|
|
|
|
}
|
|
|
|
, default =
|
|
|
|
{ name_chars = 8
|
|
|
|
, padding = { x = 6, y = 15 }
|
|
|
|
, header_padding = 20
|
2022-08-11 00:27:16 -04:00
|
|
|
, row_spacing = 16
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let HeaderGeometry =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Global dimensions for the header of a module
|
|
|
|
|
|
|
|
underline_offset: distance between bottom edge of text and the line below
|
|
|
|
padding: the distance between the underline and the first widget in the module
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type = { underline_offset : Natural, padding : Natural }
|
|
|
|
, default = { underline_offset = 26, padding = 19 }
|
|
|
|
}
|
|
|
|
|
|
|
|
let Geometry =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Global config for dimensions of various widgets -}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type =
|
|
|
|
{ plot : PlotGeometry.Type
|
|
|
|
, table : TableGeometry.Type
|
|
|
|
, header : HeaderGeometry.Type
|
|
|
|
}
|
|
|
|
, default =
|
|
|
|
{ plot = PlotGeometry::{=}
|
|
|
|
, table = TableGeometry::{=}
|
|
|
|
, header = HeaderGeometry::{=}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Color =
|
|
|
|
{- Alias for a solid color represented as a single hex number -}
|
|
|
|
Natural
|
|
|
|
|
|
|
|
let Alpha =
|
|
|
|
{- Alias for alpha channel as a fraction between 0 and 1 -}
|
|
|
|
Double
|
|
|
|
|
|
|
|
let Stop =
|
|
|
|
{- Alias for the position of a color in a gradient (between 0 and 1) -}
|
|
|
|
Double
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let StopRGB =
|
|
|
|
{- A solid color with a position in a gradiant -}
|
|
|
|
{ color : Color, stop : Stop }
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let StopRGBA =
|
|
|
|
{- A transparent color with a position in a gradiant -}
|
|
|
|
{ color : Color, stop : Stop, alpha : Alpha }
|
|
|
|
|
|
|
|
let ColorAlpha =
|
|
|
|
{- A solid transparent color -}
|
|
|
|
{ color : Color, alpha : Alpha }
|
2022-08-10 22:22:50 -04:00
|
|
|
|
|
|
|
let Pattern =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Wrapper for different pattern types -}
|
|
|
|
< RGB : Color
|
2022-08-10 22:22:50 -04:00
|
|
|
| RGBA : ColorAlpha
|
|
|
|
| GradientRGB : List StopRGB
|
|
|
|
| GradientRGBA : List StopRGBA
|
|
|
|
>
|
|
|
|
|
2022-08-12 00:20:01 -04:00
|
|
|
let annotatePattern =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Helper function to ensure patterns are parsable in yaml
|
|
|
|
|
|
|
|
This will create entries in the yaml config like:
|
|
|
|
|
|
|
|
parent:
|
|
|
|
type: <pattern_type>
|
|
|
|
date:
|
|
|
|
<field1>: ...
|
|
|
|
<field2>: ...
|
|
|
|
-}
|
2022-08-11 23:03:33 -04:00
|
|
|
\(a : Pattern) ->
|
|
|
|
{ type = showConstructor a, data = a } : Annotated Pattern
|
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let mod =
|
|
|
|
{- Helper function to ensure modules are parsable in yaml
|
|
|
|
|
|
|
|
This will create entries in the yaml config like:
|
|
|
|
|
|
|
|
parent:
|
|
|
|
type: <module name>
|
|
|
|
date:
|
|
|
|
<field1>: ...
|
|
|
|
<field2>: ...
|
|
|
|
-}
|
|
|
|
\(a : ModType) -> Block.Mod { type = showConstructor a, data = a }
|
2022-08-12 00:20:01 -04:00
|
|
|
|
2022-08-11 23:03:33 -04:00
|
|
|
let APattern = Annotated Pattern
|
|
|
|
|
|
|
|
let symGradient =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Make a symmetric gradient between two colors.
|
|
|
|
|
|
|
|
c0 will be the color of either edge and c1 will be the color in the center
|
|
|
|
-}
|
2022-08-11 23:03:33 -04:00
|
|
|
\(c0 : Natural) ->
|
|
|
|
\(c1 : Natural) ->
|
2022-08-12 00:20:01 -04:00
|
|
|
annotatePattern
|
2022-08-11 23:03:33 -04:00
|
|
|
( Pattern.GradientRGB
|
|
|
|
[ { color = c0, stop = 0.0 }
|
|
|
|
, { color = c1, stop = 0.5 }
|
|
|
|
, { color = c0, stop = 1.0 }
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2022-08-10 22:22:50 -04:00
|
|
|
let Patterns =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- All patterns for a given theme
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type =
|
2022-08-11 23:03:33 -04:00
|
|
|
{ header : APattern
|
|
|
|
, panel : { bg : APattern }
|
|
|
|
, text :
|
|
|
|
{ active : APattern, inactive : APattern, critical : APattern }
|
|
|
|
, border : APattern
|
2022-08-10 22:22:50 -04:00
|
|
|
, plot :
|
2022-08-11 23:03:33 -04:00
|
|
|
{ grid : APattern
|
|
|
|
, outline : APattern
|
|
|
|
, data : { border : APattern, fill : APattern }
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
, indicator :
|
2022-08-11 23:03:33 -04:00
|
|
|
{ bg : APattern, fg : { active : APattern, critical : APattern } }
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
, default =
|
2022-08-12 00:20:01 -04:00
|
|
|
{ header = annotatePattern (Pattern.RGB 0xefefef)
|
|
|
|
, panel.bg
|
|
|
|
= annotatePattern (Pattern.RGBA { color = 0x121212, alpha = 0.7 })
|
2022-08-10 22:22:50 -04:00
|
|
|
, text =
|
2022-08-12 00:20:01 -04:00
|
|
|
{ active = annotatePattern (Pattern.RGB 0xbfe1ff)
|
|
|
|
, inactive = annotatePattern (Pattern.RGB 0xc8c8c8)
|
|
|
|
, critical = annotatePattern (Pattern.RGB 0xff8282)
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
2022-08-12 00:20:01 -04:00
|
|
|
, border = annotatePattern (Pattern.RGB 0x888888)
|
2022-08-10 22:22:50 -04:00
|
|
|
, plot =
|
2022-08-12 00:20:01 -04:00
|
|
|
{ grid = annotatePattern (Pattern.RGB 0x666666)
|
|
|
|
, outline = annotatePattern (Pattern.RGB 0x777777)
|
2022-08-10 22:22:50 -04:00
|
|
|
, data =
|
|
|
|
{ border =
|
2022-08-12 00:20:01 -04:00
|
|
|
annotatePattern
|
2022-08-11 23:03:33 -04:00
|
|
|
( Pattern.GradientRGB
|
|
|
|
[ { color = 0x003f7c, stop = 0.0 }
|
|
|
|
, { color = 0x1e90ff, stop = 1.0 }
|
|
|
|
]
|
|
|
|
)
|
2022-08-10 22:22:50 -04:00
|
|
|
, fill =
|
2022-08-12 00:20:01 -04:00
|
|
|
annotatePattern
|
2022-08-11 23:03:33 -04:00
|
|
|
( Pattern.GradientRGBA
|
|
|
|
[ { color = 0x316ece, stop = 0.2, alpha = 0.5 }
|
|
|
|
, { color = 0x8cc7ff, stop = 1.0, alpha = 1.0 }
|
|
|
|
]
|
|
|
|
)
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
, indicator =
|
2022-08-11 23:03:33 -04:00
|
|
|
{ bg = symGradient 0x565656 0xbfbfbf
|
2022-08-10 22:22:50 -04:00
|
|
|
, fg =
|
2022-08-11 23:03:33 -04:00
|
|
|
{ active = symGradient 0x316BA6 0x99CEFF
|
|
|
|
, critical = symGradient 0xFF3333 0xFFB8B8
|
2022-08-10 22:22:50 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let Theme =
|
2023-09-27 00:40:37 -04:00
|
|
|
{-
|
|
|
|
Defines the theme for displaying the window
|
|
|
|
|
|
|
|
font: the font to use
|
|
|
|
geometry: the global dimensions to use for each panel and widget (for
|
|
|
|
everything not define by individual modules)
|
|
|
|
patterns: colors and gradient definitions
|
|
|
|
-}
|
2022-08-10 22:22:50 -04:00
|
|
|
{ Type =
|
|
|
|
{ font : Font.Type
|
|
|
|
, geometry : Geometry.Type
|
|
|
|
, patterns : Patterns.Type
|
|
|
|
}
|
|
|
|
, default =
|
|
|
|
{ font = Font::{=}, geometry = Geometry::{=}, patterns = Patterns::{=} }
|
|
|
|
}
|
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Bootstrap =
|
|
|
|
{- Defines minimal options to start conky prior to calling any lua code.
|
|
|
|
-}
|
|
|
|
{ update_interval : Natural, dimensions : Point }
|
2022-08-11 00:05:06 -04:00
|
|
|
|
2023-09-27 22:55:13 -04:00
|
|
|
let Config =
|
|
|
|
{- Global config type -}
|
|
|
|
{ bootstrap : Bootstrap, theme : Theme.Type, layout : Layout }
|
2022-08-10 22:22:50 -04:00
|
|
|
|
2022-08-11 00:05:06 -04:00
|
|
|
let toConfig =
|
2023-09-27 22:55:13 -04:00
|
|
|
{- Helper function to generate a config -}
|
|
|
|
\(update_interval : Natural) ->
|
|
|
|
\(width : Natural) ->
|
|
|
|
\(height : Natural) ->
|
|
|
|
\(theme : Theme.Type) ->
|
|
|
|
\(layout : Layout) ->
|
|
|
|
{ bootstrap =
|
|
|
|
{ update_interval, dimensions = { x = width, y = height } }
|
|
|
|
, theme
|
|
|
|
, layout
|
2022-08-11 00:05:06 -04:00
|
|
|
}
|
|
|
|
: Config
|
|
|
|
|
2022-08-28 23:52:09 -04:00
|
|
|
in { toConfig, Block, Column, ModType, Layout, Panel, FSPath, Theme, mod }
|
|
|
|
/\ AllModules
|
|
|
|
/\ AllGeo
|