theme in sketchybar

This commit is contained in:
Ray Andrew 2025-11-30 01:48:41 -06:00
parent c119257a02
commit e0b454304e
Signed by: rayandrew
SSH key fingerprint: SHA256:XYrYrxF0Z3A72n8P/p6mqPRNQZT22F88XcLsG+kX4xw
5 changed files with 118 additions and 39 deletions

View file

@ -73,7 +73,7 @@ local function apply_highlights(c, opts)
hi('NormalFloat', { fg = c.fg, bg = c.bg_float }) hi('NormalFloat', { fg = c.fg, bg = c.bg_float })
hi('FloatBorder', { fg = c.border, bg = c.bg_float }) hi('FloatBorder', { fg = c.border, bg = c.bg_float })
hi('Cursor', { fg = c.bg, bg = c.cursor }) 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('CursorColumn', { bg = c.bg_float })
hi('ColorColumn', { bg = bg_dark }) hi('ColorColumn', { bg = bg_dark })
hi('LineNr', { fg = c.fg_gutter }) 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('TabLine', { fg = c.fg_dark, bg = bg_darker })
hi('TabLineFill', { bg = bg_darker }) hi('TabLineFill', { bg = bg_darker })
hi('TabLineSel', { fg = c.fg, bg = bg }) hi('TabLineSel', { fg = c.fg, bg = bg })
hi('WinBar', { fg = c.fg, bg = bg_darker }) hi('WinBar', { fg = c.fg, bg = c.bg_float })
hi('WinBarNC', { fg = c.fg_dark, bg = bg_darker }) hi('WinBarNC', { fg = c.fg_dark, bg = c.bg_float })
-- Messages -- Messages
hi('ModeMsg', { fg = c.fg, bold = true }) hi('ModeMsg', { fg = c.fg, bold = true })
@ -329,6 +329,8 @@ local function apply_highlights(c, opts)
hi('OilMove', { fg = c.warning }) hi('OilMove', { fg = c.warning })
hi('OilCopy', { fg = c.info }) hi('OilCopy', { fg = c.info })
hi('OilChange', { fg = c.misc }) 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 -- Grapple
hi('GrappleTitle', { fg = c.tag, bold = true }) hi('GrappleTitle', { fg = c.tag, bold = true })

View file

@ -1,38 +1,103 @@
local colors <const> = { -- Color palettes for sketchybar
black = 0xff181819, -- Hex colors are converted to 0xAARRGGBB format for sketchybar
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,
with_alpha = function(color, alpha) local function hex_to_sketchybar(hex, alpha)
if alpha > 1.0 or alpha < 0.0 then return color end alpha = alpha or 0xff
return (color & 0x00ffffff) | (math.floor(alpha * 255.0) << 24) local r, g, b = hex:match '#(%x%x)(%x%x)(%x%x)'
end, 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

View file

@ -1,8 +1,11 @@
local colors <const> = require 'config.colors' local constants <const> = require 'constants'
local colors_module <const> = require 'config.colors'
local fonts <const> = require 'config.fonts' local fonts <const> = require 'config.fonts'
local icons <const> = require 'config.icons' local icons <const> = require 'config.icons'
local dimens <const> = require 'config.dimens' local dimens <const> = require 'config.dimens'
local colors <const> = colors_module.load(constants.color_palette)
return { return {
fonts = fonts, fonts = fonts,
dimens = dimens, dimens = dimens,

View file

@ -1,3 +1,5 @@
local color_palette <const> = 'noctis_azureus'
local events <const> = { local events <const> = {
AEROSPACE_WORKSPACE_CHANGED = 'aerospace_workspace_changed', AEROSPACE_WORKSPACE_CHANGED = 'aerospace_workspace_changed',
AEROSPACE_SWITCH = 'aerospace_switch', AEROSPACE_SWITCH = 'aerospace_switch',
@ -34,4 +36,5 @@ return {
events = events, events = events,
aerospace_cmd = aerospace_cmd, aerospace_cmd = aerospace_cmd,
aerospace = aerospace, aerospace = aerospace,
color_palette = color_palette,
} }

View file

@ -3,6 +3,7 @@
config, config,
pkgs, pkgs,
user, user,
host,
... ...
}: }:
{ {
@ -151,6 +152,11 @@
LaunchServices.LSQuarantine = false; LaunchServices.LSQuarantine = false;
}; };
networking = {
hostName = host;
computerName = host;
};
environment.systemPackages = environment.systemPackages =
with pkgs; with pkgs;
[ [