Skip to content

Commit

Permalink
WIP: Darwin theming
Browse files Browse the repository at this point in the history
  • Loading branch information
shajra committed Jan 14, 2024
1 parent ea54619 commit dcd098e
Show file tree
Hide file tree
Showing 30 changed files with 700 additions and 131 deletions.
3 changes: 3 additions & 0 deletions build/nixpkgs/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ let
lieer
moneydance
pointless-xcompose
sf-symbols
sketchybar-font
sketchybar-lua
xcompose;
};
};
Expand Down
21 changes: 21 additions & 0 deletions build/nixpkgs/packages/sf-symbols/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ stdenvNoCC
, sources
, p7zip
}:

stdenvNoCC.mkDerivation {
pname = "sf-symbols";
version = "5";
src = sources.sf-symbols;
dontUnpack = true;
nativeBuildInputs = [ p7zip ];
installPhase = ''
7z x "$src"
cd SFSymbols
7z x "SF Symbols.pkg"
7z x "Payload~"
mkdir -p "$out/share/fonts/opentype" "$out/share/fonts/truetype"
mv Library/Fonts/*.otf "$out/share/fonts/opentype"
mv Library/Fonts/*.ttf "$out/share/fonts/truetype"
'';
}
15 changes: 15 additions & 0 deletions build/nixpkgs/packages/sketchybar-font/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ stdenvNoCC
, sources
}:

stdenvNoCC.mkDerivation {
pname = "sketchybar-font";
version = "1.0.21";
src = sources.sketchybar-font;
dontUnpack = true;
installPhase = ''
runHook preInstall
install -Dm644 "$src" "$out/share/fonts/truetype/sketchybar-app-font.ttf"
runHook postInstall
'';
}
17 changes: 17 additions & 0 deletions build/nixpkgs/packages/sketchybar-lua/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ stdenv
, sources
, clang
, gcc
, readline
}:

stdenv.mkDerivation {
pname = "sketchybar-lua";
version = "0.0.0.0";
src = sources.sketchybar-lua;
nativeBuildInputs = [ clang gcc ];
buildInputs = [ readline ];
installPhase = ''
mv bin "$out"
'';
}
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
lieer = { url = github:gauteh/lieer; flake = false; };
moneydance = { url = tarball+https://infinitekind.com/stabledl/current/moneydance-linux.tar.gz; flake = false; };
pointless-xcompose = { url = github:leoboiko/pointless-xcompose; flake = false; };
sf-symbols = { url = https://devimages-cdn.apple.com/design/resources/download/SF-Symbols-5.dmg; flake = false; };
sketchybar-font = { url = https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v1.0.21/sketchybar-app-font.ttf; flake = false; };
sketchybar-lua = { url = github:FelixKratz/SbarLua; flake = false; };
xcompose = { url = github:kragen/xcompose; flake = false; };
};

Expand Down
3 changes: 2 additions & 1 deletion home/modules/base/gui/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ in {
../../tui/darwin
];

home.file = import home/file config pkgs;
home.extraPackages = build.pkgs.lists.base.tui.darwin;

programs.fish = import programs/fish pkgs;
programs.kitty = import programs/kitty config kitty;

xdg.configFile = import xdg/configFile config pkgs;
}
12 changes: 0 additions & 12 deletions home/modules/base/gui/darwin/home/file/default.nix

This file was deleted.

54 changes: 0 additions & 54 deletions home/modules/base/gui/darwin/home/file/yabai/yabairc

This file was deleted.

35 changes: 35 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
config: pkgs:

let

kitty = "${config.programs.kitty.package}/bin/kitty";
jq = "${pkgs.jq}/bin/jq";

format = f: x: pkgs.lib.colors.format "0xff%R%G%B" (f x);
id = x: x;
foregroundFor = config.theme.colors.nominal.foregroundFor;
colors = pkgs.lib.colors.transformColors (format id) config.theme.colors;
foreground = pkgs.lib.colors.transformColors (format foregroundFor) config.theme.colors;

in {
"sketchybar".source = pkgs.runCommandNoCC "sketchybarrc" {} ''
cp -r "${./sketchybar}" "$out"
substituteInPlace "$out/sketchybarrc" \
--replace @@LUA@@ "${pkgs.lua5_4}" \
--replace @@SKETCHYBAR_LUA_SO@@ "${pkgs.sketchybar-lua}"
substituteInPlace "$out/colors.lua" \
--replace @@COLORS_UNIFYING@@ ${colors.semantic.unifying} \
--replace @@COLORS_PRIMARY_BG@@ ${colors.semantic.background} \
--replace @@COLORS_PRIMARY_FG@@ ${colors.semantic.foreground} \
--replace @@COLORS_SECONDARY_BG@@ ${colors.semantic.background_highlighted} \
--replace @@COLORS_SECONDARY_FG@@ ${colors.semantic.foreground} \
--replace @@COLORS_UNSELECTED_BG@@ ${colors.window.unselected.background} \
--replace @@COLORS_UNSELECTED_FG@@ ${colors.window.unselected.text} \
--replace @@COLORS_SELECTED_BG@@ ${colors.window.selected.focused.background} \
--replace @@COLORS_SELECTED_FG@@ ${colors.window.selected.focused.text}
chmod +x "$out/sketchybarrc"
'';
"skhd/skhdrc".text = import skhd/skhdrc.nix kitty jq;
"yabai/yabairc".source = yabai/yabairc;
"yabai/yabairc".executable = true;
}
17 changes: 17 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/sketchybar/bar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local colors = require("colors")

-- Equivalent to the --bar domain
sbar.bar({
blur_radius=20,
border_color = colors.unifying,
border_width = 4,
color = colors.primary.background,
corner_radius = 9,
height = 36,
margin = 4,
padding_left = 10,
padding_right = 10,
shadow = false, sticky = true,
topmost="window",
y_offset = 4,
})
19 changes: 19 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/sketchybar/colors.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
return {
unifying = @@COLORS_UNIFYING@@,
primary = {
background = @@COLORS_PRIMARY_BG@@,
foreground = @@COLORS_PRIMARY_FG@@,
},
secondary = {
background = @@COLORS_SECONDARY_BG@@,
foreground = @@COLORS_SECONDARY_FG@@,
},
selected = {
background = @@COLORS_SELECTED_BG@@,
foreground = @@COLORS_SELECTED_FG@@,
},
unselected = {
background = @@COLORS_UNSELECTED_BG@@,
foreground = @@COLORS_UNSELECTED_FG@@,
},
}
44 changes: 44 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/sketchybar/default.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
local settings = require("settings")
local colors = require("colors")

-- Equivalent to the --default domain
sbar.default({
updates = "when_shown",
icon = {
font = {
family = settings.font.family,
style = "Bold",
size = settings.font.size
},
color = colors.primary.foreground,
padding_left = settings.paddings,
padding_right = settings.paddings,
},
label = {
font = {
family = settings.font.family,
style = "Semibold",
size = settings.font.size
},
color = colors.primary.foreground,
padding_left = settings.paddings,
padding_right = settings.paddings,
},
background = {
height = 26,
border_width = 4,
},
popup = {
background = {
border_width = 2,
corner_radius = 9,
border_color = colors.unifying,
color = colors.secondary.background,
shadow = { drawing = true },
},
blur_radius = 20,
},
padding_left = 5,
padding_right = 5
})

14 changes: 14 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/sketchybar/emojis.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
[".kitty-wrapped"] = ":terminal:",
["Alacritty"] = ":terminal:",
["Discord"] = ":discord:",
["Emacs"] = ":emacs:",
["Firefox"] = ":firefox:",
["Google Chrome Beta"] = ":google_chrome:",
["Google Chrome"] = ":google_chrome:",
["Microsoft Edge"] = ":microsoft_edge:",
["Terminal"] = ":terminal:",
["iTerm2"] = ":terminal:",
["kitty"] = ":terminal:",
["zoom.us"] = ":zoom:",
}
21 changes: 21 additions & 0 deletions home/modules/base/gui/darwin/xdg/configFile/sketchybar/icons.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
return {
loading = "􀖇",
apple = "􀣺",
preferences = "􀺽",

volume = {
_100="􀊩",
_66="􀊧",
_33="􀊥",
_10="􀊡",
_0="􀊣",
},
battery = {
_100 = "􀛨",
_75 = "􀺸",
_50 = "􀺶",
_25 = "􀛩",
_0 = "􀛪",
charging = "􀢋"
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require("bar")
require("default")
require("items")
Loading

0 comments on commit dcd098e

Please sign in to comment.