From 43e85d3d2b5a04f62bbcec3cd0eab5465fa625a6 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Wed, 17 Aug 2022 00:27:41 -0400 Subject: [PATCH] ENH use conky dhall config --- .symlinks/conky-configs/conky-laptop.dhall | 99 +++++++++++++++ .symlinks/conky-configs/conky-laptop.yml | 116 ------------------ ...onky.yml.tmpl => symlink_conky.dhall.tmpl} | 2 +- 3 files changed, 100 insertions(+), 117 deletions(-) create mode 100644 .symlinks/conky-configs/conky-laptop.dhall delete mode 100644 .symlinks/conky-configs/conky-laptop.yml rename dot_config/{symlink_conky.yml.tmpl => symlink_conky.dhall.tmpl} (71%) diff --git a/.symlinks/conky-configs/conky-laptop.dhall b/.symlinks/conky-configs/conky-laptop.dhall new file mode 100644 index 0000000..216e6dc --- /dev/null +++ b/.symlinks/conky-configs/conky-laptop.dhall @@ -0,0 +1,99 @@ +let C = ./conky/config/config.dhall + +let filesystem = + C.ModType.filesystem + C.FileSystem::{ + , show_smart = True + , fs_paths = + [ { path = "/", name = "root" } + , { path = "/boot", name = "boot" } + , { path = "/home", name = "home" } + , { path = "/mnt/data", name = "data" } + , { path = "/mnt/dcache", name = "dcache" } + , { path = "/tmp", name = "tmpfs" } + ] + } + +let graphics = + C.ModType.graphics + C.Graphics::{ + , dev_power = "/sys/bus/pci/devices/0000:01:00.0/power/control" + , show_temp = True + , show_clock = True + , show_gpu_util = True + , show_mem_util = True + , show_vid_util = True + } + +let memory = + C.ModType.memory + C.Memory::{ + , show_stats = True + , show_swap = True + , show_plot = True + , table_rows = 5 + } + +let power = + C.ModType.power + C.Power::{ + , battery = "BAT0" + , rapl_specs = + [ { name = "PKG0", address = "intel-rapl:0" } + , { name = "DRAM", address = "intel-rapl:0:2" } + ] + } + +let processor = + C.ModType.processor + C.Processor::{ + , core_rows = 1 + , core_padding = 0 + , show_stats = True + , show_plot = True + , table_rows = 5 + } + +let readwrite = + C.ModType.readwrite C.ReadWrite::{ devices = [ "sda", "nvme0n1" ] } + +let toCol = \(bs : List C.Block) -> C.Column.CCol { blocks = bs, width = 436 } + +let toPanel = + \(cs : List C.Column) -> + C.Panel.PPanel { columns = cs, margins = { x = 20, y = 10 } } + +let layout = + { anchor = { x = 12, y = 11 } + , panels = + [ toPanel + [ toCol + [ C.mod (C.ModType.system C.System::{=}) + , C.Block.Pad 19 + , C.mod graphics + , C.Block.Pad 20 + , C.mod processor + ] + ] + , C.Panel.PPad 10 + , toPanel + [ toCol [ C.mod readwrite ] + , C.Column.CPad 20 + , toCol [ C.mod (C.ModType.network C.Network::{=}) ] + ] + , C.Panel.PPad 10 + , toPanel + [ toCol + [ C.mod (C.ModType.pacman C.Pacman::{=}) + , C.Block.Pad 24 + , C.mod filesystem + , C.Block.Pad 23 + , C.mod power + , C.Block.Pad 19 + , C.mod memory + ] + ] + ] + } + +in C.toConfig 1 1920 1080 C.Theme::{=} layout diff --git a/.symlinks/conky-configs/conky-laptop.yml b/.symlinks/conky-configs/conky-laptop.yml deleted file mode 100644 index 0b0f2f3..0000000 --- a/.symlinks/conky-configs/conky-laptop.yml +++ /dev/null @@ -1,116 +0,0 @@ -bootstrap: - update_interval: 1 - dimensions: [1920, 1080] -modules: - filesystem: - show_smart: true - fs_paths: - - {path: /, name: root} - - {path: /boot, name: boot} - - {path: /home, name: home} - - {path: /mnt/data, name: data} - - {path: /mnt/dcache, name: dcache} - - {path: /tmp, name: tmpfs} - graphics: - dev_power: /sys/bus/pci/devices/0000:01:00.0/power/control - show_temp: true - show_clock: true - show_gpu_util: true - show_mem_util: true - show_vid_util: true - memory: - show_stats: true - show_swap: true - show_plot: true - table_rows: 5 - power: - battery: BAT0 - rapl_specs: - - {name: PKG0, address: intel-rapl:0} - - {name: DRAM, address: intel-rapl:0:2} - processor: - core_rows: 1 - core_padding: 0 - show_stats: true - show_plot: true - table_rows: 5 - readwrite: - devices: [sda, nvme0n1] - -layout: - anchor: [12, 11] - panels: - - columns: - - {blocks: [system, 19, graphics, 16, processor], width: 436} - margins: [20, 10] - - 10 - - columns: - - {blocks: [readwrite], width: 436} - - 20 - - {blocks: [network], width: 436} - margins: [20, 10] - - 10 - - columns: - - {blocks: [pacman, 24, filesystem, 23, power, 19, memory], width: 436} - margins: [20, 10] - -theme: - font: - family: Neuropolitical - sizes: - normal: 13 - plot_label: 8 - table: 11 - header: 15 - geometry: - plot: - seconds: 90 - ticks: [9, 4] - height: 56 - spacing: 20 - table: - name_chars: 8 - padding: [6, 15] - header_padding: 20 - row_spacing: 16 - header: - underline_offset: 26 - padding: 19 - patterns: - header: 0xefefef - panel: - bg: {color: 0x121212, alpha: 0.7} - text: - active: 0xbfe1ff - inactive: 0xc8c8c8 - critical: 0xff8282 - border: 0x888888 - plot: - grid: 0x666666 - outline: 0x777777 - data: - border: - gradient: - - {stop: 0, color: 0x003f7c} - - {stop: 1, color: 0x1e90ff} - fill: - gradient_alpha: - - {stop: 0.2, color: 0x316ece, alpha: 0.5} - - {stop: 1, color: 0x8cc7ff, alpha: 1.0} - indicator: - bg: - gradient: - - {stop: 0, color: 0x565656} - - {stop: 0.5, color: 0xbfbfbf} - - {stop: 1, color: 0x565656} - fg: - active: - gradient: - - {stop: 0, color: 0x316BA6} - - {stop: 0.5, color: 0x99CEFF} - - {stop: 1, color: 0x316BA6} - critical: - gradient: - - {stop: 0, color: 0xFF3333} - - {stop: 0.5, color: 0xFFB8B8} - - {stop: 1, color: 0xFF3333} diff --git a/dot_config/symlink_conky.yml.tmpl b/dot_config/symlink_conky.dhall.tmpl similarity index 71% rename from dot_config/symlink_conky.yml.tmpl rename to dot_config/symlink_conky.dhall.tmpl index 5a94269..7fed23f 100644 --- a/dot_config/symlink_conky.yml.tmpl +++ b/dot_config/symlink_conky.dhall.tmpl @@ -1 +1 @@ -{{ .chezmoi.sourceDir }}/.symlinks/conky-configs/conky-{{ .features.conky_alias }}.yml \ No newline at end of file +{{ .chezmoi.sourceDir }}/.symlinks/conky-configs/conky-{{ .features.conky_alias }}.dhall