From e0b454304ef50c2795eba4d3437f6f8fbf84b113 Mon Sep 17 00:00:00 2001 From: Ray Andrew Date: Sun, 30 Nov 2025 01:48:41 -0600 Subject: [PATCH] theme in sketchybar --- config/nvim/lua/raytheme.lua | 8 +- config/sketchybar/config/colors.lua | 135 +++++++++++++++++++------- config/sketchybar/config/settings.lua | 5 +- config/sketchybar/constants.lua | 3 + darwin/default.nix | 6 ++ 5 files changed, 118 insertions(+), 39 deletions(-) diff --git a/config/nvim/lua/raytheme.lua b/config/nvim/lua/raytheme.lua index 76ccd32..28f9e57 100644 --- a/config/nvim/lua/raytheme.lua +++ b/config/nvim/lua/raytheme.lua @@ -73,7 +73,7 @@ local function apply_highlights(c, opts) hi('NormalFloat', { fg = c.fg, bg = c.bg_float }) hi('FloatBorder', { fg = c.border, bg = c.bg_float }) hi('Cursor', { fg = c.bg, bg = c.cursor }) - hi('CursorLine', { bg = c.bg_float }) + hi('CursorLine', { bg = c.bg_highlight }) hi('CursorColumn', { bg = c.bg_float }) hi('ColorColumn', { bg = bg_dark }) hi('LineNr', { fg = c.fg_gutter }) @@ -111,8 +111,8 @@ local function apply_highlights(c, opts) hi('TabLine', { fg = c.fg_dark, bg = bg_darker }) hi('TabLineFill', { bg = bg_darker }) hi('TabLineSel', { fg = c.fg, bg = bg }) - hi('WinBar', { fg = c.fg, bg = bg_darker }) - hi('WinBarNC', { fg = c.fg_dark, bg = bg_darker }) + hi('WinBar', { fg = c.fg, bg = c.bg_float }) + hi('WinBarNC', { fg = c.fg_dark, bg = c.bg_float }) -- Messages hi('ModeMsg', { fg = c.fg, bold = true }) @@ -329,6 +329,8 @@ local function apply_highlights(c, opts) hi('OilMove', { fg = c.warning }) hi('OilCopy', { fg = c.info }) hi('OilChange', { fg = c.misc }) + hi('OilTitle', { fg = c.tag, bg = c.bg_float, bold = true }) + hi('OilWinbar', { fg = c.fg, bg = c.bg_float }) -- Grapple hi('GrappleTitle', { fg = c.tag, bold = true }) diff --git a/config/sketchybar/config/colors.lua b/config/sketchybar/config/colors.lua index 9029d24..e1e7fda 100644 --- a/config/sketchybar/config/colors.lua +++ b/config/sketchybar/config/colors.lua @@ -1,38 +1,103 @@ -local colors = { - black = 0xff181819, - white = 0xfff8f8f2, - red = 0xf1FD6592, - green = 0xff007692, - blue = 0xff5199ba, - yellow = 0xffffff81, - orange = 0xfff4c07b, - magenta = 0xd3fc7ebd, - purple = 0xff796fa9, - other_purple = 0xff302c45, - cyan = 0xff7bf2de, - grey = 0xff7f8490, - dirty_white = 0xc8cad3f5, - dark_grey = 0xff2b2736, - transparent = 0x00000000, - bar = { - bg = 0xf1151320, - border = 0xff2c2e34, - }, - popup = { - bg = 0xf1151320, - border = 0xff2c2e34, - }, - slider = { - bg = 0xf1151320, - border = 0xff2c2e34, - }, - bg1 = 0xd322212c, - bg2 = 0xff302c45, +-- Color palettes for sketchybar +-- Hex colors are converted to 0xAARRGGBB format for sketchybar - with_alpha = function(color, alpha) - if alpha > 1.0 or alpha < 0.0 then return color end - return (color & 0x00ffffff) | (math.floor(alpha * 255.0) << 24) - end, +local function hex_to_sketchybar(hex, alpha) + alpha = alpha or 0xff + local r, g, b = hex:match '#(%x%x)(%x%x)(%x%x)' + if not r then return 0x00000000 end + return (alpha << 24) | (tonumber(r, 16) << 16) | (tonumber(g, 16) << 8) | tonumber(b, 16) +end + +local palettes = { + default = { + -- UI backgrounds + bg = '#181819', + bg_dark = '#151320', + bg_darker = '#151320', + bg_float = '#302c45', + bg_highlight = '#2b2736', + -- Foreground + fg = '#f8f8f2', + fg_dark = '#cad3f5', + fg_gutter = '#7f8490', + -- Accent colors + red = '#fd6592', + green = '#007692', + blue = '#5199ba', + yellow = '#ffff81', + magenta = '#fc7ebd', + cyan = '#7bf2de', + orange = '#f4c07b', + purple = '#796fa9', + -- Semantic + border = '#2c2e34', + }, + noctis_azureus = { + -- UI backgrounds + bg = '#051b29', + bg_dark = '#041520', + bg_darker = '#030f18', + bg_float = '#07273b', + bg_highlight = '#0c3f5f', + -- Foreground + fg = '#becfda', + fg_dark = '#aec3d0', + fg_gutter = '#475e6c', + -- Accent colors + red = '#e66533', + green = '#49e9a6', + blue = '#49ace9', + yellow = '#e4b781', + magenta = '#df769b', + cyan = '#49d6e9', + orange = '#e97749', + purple = '#60b6eb', + -- Semantic + border = '#28353e', + }, } -return colors +local M = {} + +function M.load(palette_name) + local palette = palettes[palette_name] + if not palette then error('Unknown palette: ' .. palette_name) end + + return { + black = hex_to_sketchybar(palette.bg), + white = hex_to_sketchybar(palette.fg), + red = hex_to_sketchybar(palette.red), + green = hex_to_sketchybar(palette.green), + blue = hex_to_sketchybar(palette.blue), + yellow = hex_to_sketchybar(palette.yellow), + orange = hex_to_sketchybar(palette.orange), + magenta = hex_to_sketchybar(palette.magenta), + cyan = hex_to_sketchybar(palette.cyan), + purple = hex_to_sketchybar(palette.purple), + grey = hex_to_sketchybar(palette.fg_gutter), + dirty_white = hex_to_sketchybar(palette.fg_dark, 0xc8), + dark_grey = hex_to_sketchybar(palette.bg_float), + transparent = 0x00000000, + bar = { + bg = hex_to_sketchybar(palette.bg_darker, 0xf1), + border = hex_to_sketchybar(palette.border), + }, + popup = { + bg = hex_to_sketchybar(palette.bg_darker, 0xf1), + border = hex_to_sketchybar(palette.border), + }, + slider = { + bg = hex_to_sketchybar(palette.bg_darker, 0xf1), + border = hex_to_sketchybar(palette.border), + }, + bg1 = hex_to_sketchybar(palette.bg_dark, 0xd3), + bg2 = hex_to_sketchybar(palette.bg_float), + + with_alpha = function(color, alpha) + if alpha > 1.0 or alpha < 0.0 then return color end + return (color & 0x00ffffff) | (math.floor(alpha * 255.0) << 24) + end, + } +end + +return M diff --git a/config/sketchybar/config/settings.lua b/config/sketchybar/config/settings.lua index be373ac..aa49884 100644 --- a/config/sketchybar/config/settings.lua +++ b/config/sketchybar/config/settings.lua @@ -1,8 +1,11 @@ -local colors = require 'config.colors' +local constants = require 'constants' +local colors_module = require 'config.colors' local fonts = require 'config.fonts' local icons = require 'config.icons' local dimens = require 'config.dimens' +local colors = colors_module.load(constants.color_palette) + return { fonts = fonts, dimens = dimens, diff --git a/config/sketchybar/constants.lua b/config/sketchybar/constants.lua index 17c2bc2..408cd12 100644 --- a/config/sketchybar/constants.lua +++ b/config/sketchybar/constants.lua @@ -1,3 +1,5 @@ +local color_palette = 'noctis_azureus' + local events = { AEROSPACE_WORKSPACE_CHANGED = 'aerospace_workspace_changed', AEROSPACE_SWITCH = 'aerospace_switch', @@ -34,4 +36,5 @@ return { events = events, aerospace_cmd = aerospace_cmd, aerospace = aerospace, + color_palette = color_palette, } diff --git a/darwin/default.nix b/darwin/default.nix index 1641d28..4472469 100644 --- a/darwin/default.nix +++ b/darwin/default.nix @@ -3,6 +3,7 @@ config, pkgs, user, + host, ... }: { @@ -151,6 +152,11 @@ LaunchServices.LSQuarantine = false; }; + networking = { + hostName = host; + computerName = host; + }; + environment.systemPackages = with pkgs; [