From a11fdb60ce2b2299d57c75a1b8cc3fed592848b4 Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Wed, 8 Jul 2020 02:11:59 -0500
Subject: [PATCH] Conky: Rework setup into two modules

---
 .config/conky/conky-clock.conf | 50 ++++++++++++++++++++++++++++++++++
 .config/conky/gen.sh           |  5 ++--
 .config/firestarter/clock      |  7 +++++
 3 files changed, 59 insertions(+), 3 deletions(-)
 create mode 100644 .config/conky/conky-clock.conf
 create mode 100644 .config/firestarter/clock

diff --git a/.config/conky/conky-clock.conf b/.config/conky/conky-clock.conf
new file mode 100644
index 00000000..a6c5e1e9
--- /dev/null
+++ b/.config/conky/conky-clock.conf
@@ -0,0 +1,50 @@
+-- vim: ts=4 sw=4 noet ai cindent syntax=lua
+conky.config = {
+	own_window = true,
+	own_window_title = 'Conky',
+	own_window_class = 'Conky',
+	own_window_type = 'desktop',
+	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+	own_window_argb_visual = true,
+	own_window_transparent = true,
+	own_window_colour = '000000',
+
+	double_buffer = true,
+	cpu_avg_samples = 2,
+	net_avg_samples = 2,
+	no_buffers = true,
+	update_interval = 1,
+
+	use_xft = true,
+	font = 'Roboto:style=Light:size=9',
+	default_color = '#fffcf6',
+	color1 = '383c4a', -- Background
+	color2 = 'fffcf6', -- Foreground
+	color3 = '4b5162', -- Background-alt
+
+	alignment = 'bottom_right',
+	xinerama_head = 0,
+	minimum_height = 0,
+	minimum_width = 304,
+	border_width = 0,
+	border_outer_margin = 1,
+	border_inner_margin = 16,
+	gap_x = 32,
+	gap_y = 48,
+
+	format_human_readable = true,
+	temperature_unit = "celsius",
+	if_up_strictness = "link",
+
+	default_bar_height = 11,
+	default_bar_width = 130,
+	default_graph_height = 36,
+	draw_borders = true,
+	draw_outline = false,
+	draw_graph_borders = true,
+	draw_shades = false
+}
+conky.text = [[
+${font Roboto:style=Light:size=96}$alignr${time %I:%M %p}$font
+${font Roboto:style=Light:size=32}$alignr${time %A, %B %d, %Y}$font
+]]
diff --git a/.config/conky/gen.sh b/.config/conky/gen.sh
index 1465af02..4ebe65f3 100755
--- a/.config/conky/gen.sh
+++ b/.config/conky/gen.sh
@@ -131,7 +131,7 @@ conky.config = {
 	color8 = '1d99f3', -- Blue (CPU)
 	color9 = '9b59b6', -- Magenta (Memory)
 
-	alignment = 'bottom_right',
+	alignment = 'bottom_left',
 	xinerama_head = 0,
 	minimum_height = 0,
 	minimum_width = 304,
@@ -161,8 +161,7 @@ step_text() {
 	# Header
 	cat <<- 'EOF' >> "$_optout"
 	conky.text = [[
-	${font Roboto:style=Light:size=30}$alignr${no_update $nodename_short}$font
-	${font Roboto:style=Light:size=17}$alignr${time %I:%M %p}$font
+	${font Roboto:style=Light:size=24}$alignr${no_update $nodename_short}$font
 	${font Roboto:style=Light:size=12}${acpitemp}°C$alignr${time %A, %B %d, %Y}$font
 	EOF
 
diff --git a/.config/firestarter/clock b/.config/firestarter/clock
new file mode 100644
index 00000000..8b9a3ab6
--- /dev/null
+++ b/.config/firestarter/clock
@@ -0,0 +1,7 @@
+#.fsdefaults
+[ -z "$DISPLAY" ]
+:
+# Note: the dumb sleep hack is because Conky crashes with window_type override if the WM hasn't loaded yet
+# This gives the WM ample time to load up
+command -v conky && [ -r "${XDG_CONFIG_HOME:-/home/salt/.config}/conky/conky-clock.conf" ]
+sleep 5 && conky -c "${XDG_CONFIG_HOME:-/home/salt/.config}/conky/conky-clock.conf"