Compare commits

...

40 commits
julia ... main

Author SHA1 Message Date
10d8cda843 fix fish nvim shortcut 2025-07-05 21:20:10 -07:00
fda999db96
we stop redirecting to 2 2025-07-05 21:13:42 -07:00
512a87da53
fix silly typo :p 2025-07-05 21:11:55 -07:00
4c139f1a7a
moved nvim config options upstream 2025-07-05 21:04:38 -07:00
e6df94da34
Merge branch 'main' of paperclover.dev:nix/config 2025-07-05 20:35:03 -07:00
b808a79ab2 fixing things 2025-07-05 20:33:02 -07:00
db93fc5149
Merge branch 'main' of paperclover.dev:nix/config 2025-07-05 20:31:55 -07:00
454a26a85a Merge remote-tracking branch 'origin/julia' 2025-07-05 17:11:51 -07:00
fe54e9b0c9 i am a meower and i forgot what i did 2025-07-05 17:08:16 -07:00
4502f0036f
removed R 2025-07-05 09:25:26 -07:00
300d20bdee remove sample.keys 2025-07-04 23:06:29 -07:00
171bdea72d remove lix 2025-07-04 22:51:18 -07:00
90fa812e6a Merge remote-tracking branch 'origin/nats' into chloe 2025-07-04 21:47:29 -07:00
680b809062
update flake inputs 2025-07-04 21:30:20 -07:00
ac6a001967 Merge paperclover.dev:clo/config into chloe 2025-07-04 21:29:59 -07:00
d6ce08fa89
added devenv 2025-07-02 15:45:43 -07:00
381a06acdf
various things i forgot to commit 2025-06-12 15:14:43 -07:00
bef0fb01c2
remove aws-sdk from lix deps 2025-05-28 12:33:47 -07:00
40840a8084
run format 2025-05-28 12:06:37 -07:00
800f63b000
made config work on nixos 2025-05-28 08:31:42 -07:00
b9e231d72f
remove stylix, add lix 2025-05-27 22:30:34 -07:00
b3d5a28141
removed stylix, updated nvf 2025-05-27 19:56:17 -07:00
926f53011d fun neovim things 2025-05-27 19:12:01 -07:00
73902bf700 laptop adjustments 2025-05-27 12:53:32 -07:00
5260bb9b1b update readme file 2025-05-27 12:53:32 -07:00
27be81d914
override more defaults 2025-05-21 15:35:29 -07:00
b6f59a300d
add diagnostics 2025-05-21 15:25:56 -07:00
0ea9675fc4
add helpview.nvim 2025-05-21 13:56:17 -07:00
212098b6e7
got folding range to work 2025-05-21 13:05:29 -07:00
56f3aa2982
we dow a little trolling 2025-05-21 12:15:39 -07:00
ad6cd527cf
move signal to homebrew bc it keeps getting outdated (ugh) 2025-05-21 11:56:42 -07:00
fa17ce8f5b
update flake 2025-05-21 11:55:34 -07:00
6fea0a1f4e
nearly at parity with lua-based config 2025-05-21 10:44:59 -07:00
10453abfb1
commiting for posterity 2025-05-20 21:30:54 -07:00
69e9b167cb
add custom nvf stuff and merge 2025-05-19 21:42:58 -07:00
3449484e73
Merge branch 'paperclover-chloe' 2025-05-19 17:37:00 -07:00
1a6ac2017d
update sketchybar 2025-05-19 17:17:16 -07:00
be3db5e095 some more little treats for clo 2025-05-15 17:42:32 -07:00
844318f221
update color scheme for sketchybar 2025-05-08 12:59:38 -07:00
6284571ffe
remove sketchybar reundent files 2025-05-08 12:31:48 -07:00
71 changed files with 1566 additions and 2736 deletions

1
.gitignore vendored
View file

@ -1,5 +1,4 @@
flake.lock
.DS_STORE
**/.DS_STORE
result
result-*

View file

@ -0,0 +1,114 @@
float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b)
{
vec2 d = abs(p - xy) - b;
return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
}
// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/
// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching
float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) {
vec2 e = b - a;
vec2 w = p - a;
vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0);
float segd = dot(p - proj, p - proj);
d = min(d, segd);
float c0 = step(0.0, p.y - a.y);
float c1 = 1.0 - step(0.0, p.y - b.y);
float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x);
float allCond = c0 * c1 * c2;
float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2);
float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond));
s *= flip;
return d;
}
float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) {
float s = 1.0;
float d = dot(p - v0, p - v0);
d = seg(p, v0, v3, s, d);
d = seg(p, v1, v0, s, d);
d = seg(p, v2, v1, s, d);
d = seg(p, v3, v2, s, d);
return s * sqrt(d);
}
vec2 normalize(vec2 value, float isPosition) {
return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y;
}
float antialising(float distance) {
return 1. - smoothstep(0., normalize(vec2(2., 2.), 0.).x, distance);
}
float determineStartVertexFactor(vec2 a, vec2 b) {
// Conditions using step
float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y
float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y
// If neither condition is met, return 1 (else case)
return 1.0 - max(condition1, condition2);
}
vec2 getRectangleCenter(vec4 rectangle) {
return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.));
}
float ease(float x) {
return pow(1.0 - x, 3.0);
}
const vec4 TRAIL_COLOR = vec4(0.0, 0.2, 0.5, 0.1);
const float DURATION = 0.15; //IN SECONDS
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
#if !defined(WEB)
fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy);
#endif
// Normalization for fragCoord to a space of -1 to 1;
vec2 vu = normalize(fragCoord, 1.);
vec2 offsetFactor = vec2(-.5, 0.5);
// Normalization for cursor position and size;
// cursor xy has the postion in a space of -1 to 1;
// zw has the width and height
vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.));
vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.));
// When drawing a parellelogram between cursors for the trail i need to determine where to start at the top-left or top-right vertex of the cursor
float vertexFactor = determineStartVertexFactor(currentCursor.xy, previousCursor.xy);
float invertedVertexFactor = 1.0 - vertexFactor;
// Set every vertex of my parellogram
vec2 v0 = vec2(currentCursor.x + currentCursor.z * vertexFactor, currentCursor.y - currentCursor.w);
vec2 v1 = vec2(currentCursor.x + currentCursor.z * invertedVertexFactor, currentCursor.y);
vec2 v2 = vec2(previousCursor.x + currentCursor.z * invertedVertexFactor, previousCursor.y);
vec2 v3 = vec2(previousCursor.x + currentCursor.z * vertexFactor, previousCursor.y - previousCursor.w);
float sdfCurrentCursor = getSdfRectangle(vu, currentCursor.xy - (currentCursor.zw * offsetFactor), currentCursor.zw * 0.5);
float sdfTrail = getSdfParallelogram(vu, v0, v1, v2, v3);
float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0);
float easedProgress = ease(progress);
// Distance between cursors determine the total length of the parallelogram;
vec2 centerCC = getRectangleCenter(currentCursor);
vec2 centerCP = getRectangleCenter(previousCursor);
float lineLength = distance(centerCC, centerCP);
vec4 newColor = vec4(fragColor);
// Compute fade factor based on distance along the trail
float fadeFactor = 1.0 - smoothstep(lineLength, sdfCurrentCursor, easedProgress * lineLength);
// Apply fading effect to trail color
vec4 fadedTrailColor = TRAIL_COLOR * fadeFactor;
// Blend trail with fade effect
newColor = mix(newColor, fadedTrailColor, antialising(sdfTrail));
// Draw current cursor
newColor = mix(newColor, TRAIL_COLOR, antialising(sdfCurrentCursor));
newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.));
fragColor = mix(fragColor, newColor, step(sdfCurrentCursor, easedProgress * lineLength));
}

View file

@ -0,0 +1,114 @@
float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b)
{
vec2 d = abs(p - xy) - b;
return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
}
// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/
// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching
float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) {
vec2 e = b - a;
vec2 w = p - a;
vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0);
float segd = dot(p - proj, p - proj);
d = min(d, segd);
float c0 = step(0.0, p.y - a.y);
float c1 = 1.0 - step(0.0, p.y - b.y);
float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x);
float allCond = c0 * c1 * c2;
float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2);
float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond));
s *= flip;
return d;
}
float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) {
float s = 1.0;
float d = dot(p - v0, p - v0);
d = seg(p, v0, v3, s, d);
d = seg(p, v1, v0, s, d);
d = seg(p, v2, v1, s, d);
d = seg(p, v3, v2, s, d);
return s * sqrt(d);
}
vec2 normalize(vec2 value, float isPosition) {
return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y;
}
float antialising(float distance) {
return 1. - smoothstep(0., normalize(vec2(2., 2.), 0.).x, distance);
}
float determineStartVertexFactor(vec2 a, vec2 b) {
// Conditions using step
float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y
float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y
// If neither condition is met, return 1 (else case)
return 1.0 - max(condition1, condition2);
}
vec2 getRectangleCenter(vec4 rectangle) {
return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.));
}
float ease(float x) {
return pow(1.0 - x, 3.0);
}
const vec4 TRAIL_COLOR = vec4(0.8, 1.0, 1.0, 0.1);
const float DURATION = 0.1; //IN SECONDS
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
#if !defined(WEB)
fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy);
#endif
// Normalization for fragCoord to a space of -1 to 1;
vec2 vu = normalize(fragCoord, 1.);
vec2 offsetFactor = vec2(-.5, 0.5);
// Normalization for cursor position and size;
// cursor xy has the postion in a space of -1 to 1;
// zw has the width and height
vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.));
vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.));
// When drawing a parellelogram between cursors for the trail i need to determine where to start at the top-left or top-right vertex of the cursor
float vertexFactor = determineStartVertexFactor(currentCursor.xy, previousCursor.xy);
float invertedVertexFactor = 1.0 - vertexFactor;
// Set every vertex of my parellogram
vec2 v0 = vec2(currentCursor.x + currentCursor.z * vertexFactor, currentCursor.y - currentCursor.w);
vec2 v1 = vec2(currentCursor.x + currentCursor.z * invertedVertexFactor, currentCursor.y);
vec2 v2 = vec2(previousCursor.x + currentCursor.z * invertedVertexFactor, previousCursor.y);
vec2 v3 = vec2(previousCursor.x + currentCursor.z * vertexFactor, previousCursor.y - previousCursor.w);
float sdfCurrentCursor = getSdfRectangle(vu, currentCursor.xy - (currentCursor.zw * offsetFactor), currentCursor.zw * 0.5);
float sdfTrail = getSdfParallelogram(vu, v0, v1, v2, v3);
float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0);
float easedProgress = ease(progress);
// Distance between cursors determine the total length of the parallelogram;
vec2 centerCC = getRectangleCenter(currentCursor);
vec2 centerCP = getRectangleCenter(previousCursor);
float lineLength = distance(centerCC, centerCP);
vec4 newColor = vec4(fragColor);
// Compute fade factor based on distance along the trail
float fadeFactor = 1.0 - smoothstep(lineLength, sdfCurrentCursor, easedProgress * lineLength);
// Apply fading effect to trail color
vec4 fadedTrailColor = TRAIL_COLOR * fadeFactor;
// Blend trail with fade effect
newColor = mix(newColor, fadedTrailColor, antialising(sdfTrail));
// Draw current cursor
newColor = mix(newColor, TRAIL_COLOR, antialising(sdfCurrentCursor));
newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.));
fragColor = mix(fragColor, newColor, step(sdfCurrentCursor, easedProgress * lineLength));
}

View file

@ -1,26 +0,0 @@
#!/usr/bin/env sh
# Color Palette
export BLACK=0xff4c4f69
export WHITE=0xffeff1f5
export RED=0xffd20f39
export GREEN=0xff40a02b
export BLUE=0xff1e66f5
export YELLOW=0xffdf8e1d
export ORANGE=0xfffe640b
export MAGENTA=0xffea76cb
export GREY=0xff9ca0b0
export TRANSPARENT=0xff000000
export BLUE2=0xff7287fd
# General bar colors
export BAR_COLOR=0xeff1f5ff # Color of the bar
export ICON_COLOR=0xff4c4f69
export LABEL_COLOR=0xff4c4f69 # Color of all labels
export BACKGROUND_1=0xffbcc0cc
export BACKGROUND_2=0xffbcc0cc
export POPUP_BACKGROUND_COLOR=$BLACK
export POPUP_BORDER_COLOR=$WHITE
export SHADOW_COLOR=$BLACK

View file

@ -1,73 +0,0 @@
#!/usr/bin/env sh
source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
source "$HOME/.config/sketchybar/icons.sh" # Loads all defined icons
ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured
PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored
FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants
PADDINGS=3 # All paddings use this value (icon, label, background)
# Setting up and starting the helper process
HELPER=git.felix.helper
killall helper
cd $HOME/.config/sketchybar/helper && make
$HOME/.config/sketchybar/helper/helper $HELPER > /dev/null 2>&1 &
# Unload the macOS on screen indicator overlay for volume change
launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 &
# Setting up the general bar appearance and default values
sketchybar --bar height=50 \
color=$BAR_COLOR \
shadow=off \
position=top \
sticky=on \
padding_right=7 \
padding_left=7 \
corner_radius=12 \
y_offset=20 \
margin=40 \
blur_radius=0 \
notch_width=0 \
\
--default updates=when_shown \
icon.font="$FONT:Bold:14.0" \
icon.color=$ICON_COLOR \
icon.padding_left=$PADDINGS \
icon.padding_right=$PADDINGS \
label.font="$FONT:Semibold:13.0" \
label.color=$LABEL_COLOR \
label.padding_left=$PADDINGS \
label.padding_right=$PADDINGS \
background.padding_right=$PADDINGS \
background.padding_left=$PADDINGS \
background.height=26 \
background.corner_radius=9 \
popup.background.border_width=2 \
popup.background.corner_radius=11 \
popup.background.border_color=$POPUP_BORDER_COLOR \
popup.background.color=$POPUP_BACKGROUND_COLOR \
popup.background.shadow.drawing=on
# Left
source "$ITEM_DIR/apple.sh"
source "$ITEM_DIR/spaces.sh"
source "$ITEM_DIR/front_app.sh"
# Center
# source "$ITEM_DIR/spotify.sh"
source "$ITEM_DIR/calendar.sh"
# Right
source "$ITEM_DIR/brew.sh"
# source "$ITEM_DIR/github.sh"
source "$ITEM_DIR/volume.sh"
source "$ITEM_DIR/divider.sh"
# source "$ITEM_DIR/cpu.sh"
# Forcing all item scripts to run (never do this outside of sketchybarrc)
sketchybar --update
echo "sketchybar configuation loaded.."

View file

@ -1,120 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <mach/mach.h>
#include <stdbool.h>
#include <time.h>
static const char TOPPROC[32] = { "/bin/ps -Aceo pid,pcpu,comm -r" };
static const char FILTER_PATTERN[16] = { "com.apple." };
struct cpu {
host_t host;
mach_msg_type_number_t count;
host_cpu_load_info_data_t load;
host_cpu_load_info_data_t prev_load;
bool has_prev_load;
char command[256];
};
static inline void cpu_init(struct cpu* cpu) {
cpu->host = mach_host_self();
cpu->count = HOST_CPU_LOAD_INFO_COUNT;
cpu->has_prev_load = false;
snprintf(cpu->command, 100, "");
}
static inline void cpu_update(struct cpu* cpu) {
kern_return_t error = host_statistics(cpu->host,
HOST_CPU_LOAD_INFO,
(host_info_t)&cpu->load,
&cpu->count );
if (error != KERN_SUCCESS) {
printf("Error: Could not read cpu host statistics.\n");
return;
}
if (cpu->has_prev_load) {
uint32_t delta_user = cpu->load.cpu_ticks[CPU_STATE_USER]
- cpu->prev_load.cpu_ticks[CPU_STATE_USER];
uint32_t delta_system = cpu->load.cpu_ticks[CPU_STATE_SYSTEM]
- cpu->prev_load.cpu_ticks[CPU_STATE_SYSTEM];
uint32_t delta_idle = cpu->load.cpu_ticks[CPU_STATE_IDLE]
- cpu->prev_load.cpu_ticks[CPU_STATE_IDLE];
double user_perc = (double)delta_user / (double)(delta_system
+ delta_user
+ delta_idle);
double sys_perc = (double)delta_system / (double)(delta_system
+ delta_user
+ delta_idle);
double total_perc = user_perc + sys_perc;
FILE* file;
char line[1024];
file = popen(TOPPROC, "r");
if (!file) {
printf("Error: TOPPROC command errored out...\n" );
return;
}
fgets(line, sizeof(line), file);
fgets(line, sizeof(line), file);
char* start = strstr(line, FILTER_PATTERN);
char topproc[32];
uint32_t caret = 0;
for (int i = 0; i < sizeof(line); i++) {
if (start && i == start - line) {
i+=9;
continue;
}
if (caret >= 28 && caret <= 30) {
topproc[caret++] = '.';
continue;
}
if (caret > 30) break;
topproc[caret++] = line[i];
if (line[i] == '\0') break;
}
topproc[31] = '\0';
pclose(file);
char color[16];
if (total_perc >= .7) {
snprintf(color, 16, "%s", getenv("RED"));
} else if (total_perc >= .3) {
snprintf(color, 16, "%s", getenv("ORANGE"));
} else if (total_perc >= .1) {
snprintf(color, 16, "%s", getenv("YELLOW"));
} else {
snprintf(color, 16, "%s", getenv("LABEL_COLOR"));
}
snprintf(cpu->command, 256, "--push cpu.sys %.2f "
"--push cpu.user %.2f "
"--set cpu.percent label=%.0f%% label.color=%s "
"--set cpu.top label=\"%s\"",
sys_perc,
user_perc,
total_perc*100.,
color,
topproc );
}
else {
snprintf(cpu->command, 256, "");
}
cpu->prev_load = cpu->load;
cpu->has_prev_load = true;
}

View file

@ -1,32 +0,0 @@
#include "cpu.h"
#include "sketchybar.h"
struct cpu g_cpu;
void handler(env env) {
// Environment variables passed from sketchybar can be accessed as seen below
char* name = env_get_value_for_key(env, "NAME");
char* sender = env_get_value_for_key(env, "SENDER");
char* info = env_get_value_for_key(env, "INFO");
char* selected = env_get_value_for_key(env, "SELECTED");
if ((strcmp(sender, "routine") == 0)
|| (strcmp(sender, "forced") == 0)) {
// CPU graph updates
cpu_update(&g_cpu);
if (strlen(g_cpu.command) > 0) sketchybar(g_cpu.command);
}
}
int main (int argc, char** argv) {
cpu_init(&g_cpu);
if (argc < 2) {
printf("Usage: provider \"<bootstrap name>\"\n");
exit(1);
}
event_server_begin(handler, argv[1]);
return 0;
}

View file

@ -1,3 +0,0 @@
helper: helper.c cpu.h sketchybar.h
clang -std=c99 -O3 helper.c -o helper

View file

@ -1,227 +0,0 @@
#pragma once
#include <mach/mach.h>
#include <mach/message.h>
#include <bootstrap.h>
#include <stdlib.h>
#include <pthread.h>
#include <stdio.h>
typedef char* env;
#define MACH_HANDLER(name) void name(env env)
typedef MACH_HANDLER(mach_handler);
struct mach_message {
mach_msg_header_t header;
mach_msg_size_t msgh_descriptor_count;
mach_msg_ool_descriptor_t descriptor;
};
struct mach_buffer {
struct mach_message message;
mach_msg_trailer_t trailer;
};
struct mach_server {
bool is_running;
mach_port_name_t task;
mach_port_t port;
mach_port_t bs_port;
pthread_t thread;
mach_handler* handler;
};
static struct mach_server g_mach_server;
static mach_port_t g_mach_port = 0;
static inline char* env_get_value_for_key(env env, char* key) {
uint32_t caret = 0;
for(;;) {
if (!env[caret]) break;
if (strcmp(&env[caret], key) == 0)
return &env[caret + strlen(&env[caret]) + 1];
caret += strlen(&env[caret])
+ strlen(&env[caret + strlen(&env[caret]) + 1])
+ 2;
}
return (char*)"";
}
static inline mach_port_t mach_get_bs_port() {
mach_port_name_t task = mach_task_self();
mach_port_t bs_port;
if (task_get_special_port(task,
TASK_BOOTSTRAP_PORT,
&bs_port ) != KERN_SUCCESS) {
return 0;
}
mach_port_t port;
if (bootstrap_look_up(bs_port,
"git.felix.sketchybar",
&port ) != KERN_SUCCESS) {
return 0;
}
return port;
}
static inline void mach_receive_message(mach_port_t port, struct mach_buffer* buffer, bool timeout) {
*buffer = (struct mach_buffer) { 0 };
mach_msg_return_t msg_return;
if (timeout)
msg_return = mach_msg(&buffer->message.header,
MACH_RCV_MSG | MACH_RCV_TIMEOUT,
0,
sizeof(struct mach_buffer),
port,
100,
MACH_PORT_NULL );
else
msg_return = mach_msg(&buffer->message.header,
MACH_RCV_MSG,
0,
sizeof(struct mach_buffer),
port,
MACH_MSG_TIMEOUT_NONE,
MACH_PORT_NULL );
if (msg_return != MACH_MSG_SUCCESS) {
buffer->message.descriptor.address = NULL;
}
}
static inline char* mach_send_message(mach_port_t port, char* message, uint32_t len) {
if (!message || !port) {
return NULL;
}
mach_port_t response_port;
mach_port_name_t task = mach_task_self();
if (mach_port_allocate(task, MACH_PORT_RIGHT_RECEIVE,
&response_port ) != KERN_SUCCESS) {
return NULL;
}
if (mach_port_insert_right(task, response_port,
response_port,
MACH_MSG_TYPE_MAKE_SEND)!= KERN_SUCCESS) {
return NULL;
}
struct mach_message msg = { 0 };
msg.header.msgh_remote_port = port;
msg.header.msgh_local_port = response_port;
msg.header.msgh_id = response_port;
msg.header.msgh_bits = MACH_MSGH_BITS_SET(MACH_MSG_TYPE_COPY_SEND,
MACH_MSG_TYPE_MAKE_SEND,
0,
MACH_MSGH_BITS_COMPLEX );
msg.header.msgh_size = sizeof(struct mach_message);
msg.msgh_descriptor_count = 1;
msg.descriptor.address = message;
msg.descriptor.size = len * sizeof(char);
msg.descriptor.copy = MACH_MSG_VIRTUAL_COPY;
msg.descriptor.deallocate = false;
msg.descriptor.type = MACH_MSG_OOL_DESCRIPTOR;
mach_msg(&msg.header,
MACH_SEND_MSG,
sizeof(struct mach_message),
0,
MACH_PORT_NULL,
MACH_MSG_TIMEOUT_NONE,
MACH_PORT_NULL );
struct mach_buffer buffer = { 0 };
mach_receive_message(response_port, &buffer, true);
if (buffer.message.descriptor.address)
return (char*)buffer.message.descriptor.address;
mach_msg_destroy(&buffer.message.header);
return NULL;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
static inline bool mach_server_begin(struct mach_server* mach_server, mach_handler handler, char* bootstrap_name) {
mach_server->task = mach_task_self();
if (mach_port_allocate(mach_server->task,
MACH_PORT_RIGHT_RECEIVE,
&mach_server->port ) != KERN_SUCCESS) {
return false;
}
if (mach_port_insert_right(mach_server->task,
mach_server->port,
mach_server->port,
MACH_MSG_TYPE_MAKE_SEND) != KERN_SUCCESS) {
return false;
}
if (task_get_special_port(mach_server->task,
TASK_BOOTSTRAP_PORT,
&mach_server->bs_port) != KERN_SUCCESS) {
return false;
}
if (bootstrap_register(mach_server->bs_port,
bootstrap_name,
mach_server->port ) != KERN_SUCCESS) {
return false;
}
mach_server->handler = handler;
mach_server->is_running = true;
while (mach_server->is_running) {
struct mach_buffer* buffer = (struct mach_buffer*)malloc(sizeof(struct mach_buffer));
mach_receive_message(mach_server->port, buffer, false);
mach_server->handler((env)buffer->message.descriptor.address);
mach_msg_destroy(&buffer->message.header);
}
return true;
}
#pragma clang diagnostic pop
static inline char* sketchybar(char* message) {
uint32_t message_length = strlen(message) + 1;
char formatted_message[message_length + 1];
char quote = '\0';
uint32_t caret = 0;
for (int i = 0; i < message_length; ++i) {
if (message[i] == '"' || message[i] == '\'') {
if (quote == message[i]) quote = '\0';
else quote = message[i];
continue;
}
formatted_message[caret] = message[i];
if (message[i] == ' ' && !quote) formatted_message[caret] = '\0';
caret++;
}
if (caret > 0 && formatted_message[caret] == '\0'
&& formatted_message[caret - 1] == '\0') {
caret--;
}
formatted_message[caret] = '\0';
if (!g_mach_port) g_mach_port = mach_get_bs_port();
char* response = mach_send_message(g_mach_port,
formatted_message,
caret + 1 );
if (response) return response;
else return (char*)"";
}
static inline void event_server_begin(mach_handler event_handler, char* bootstrap_name) {
mach_server_begin(&g_mach_server, event_handler, bootstrap_name);
}

View file

@ -1,31 +0,0 @@
#!/usr/bin/env sh
# General Icons
LOADING=􀖇
APPLE=􀣺
PREFERENCES=􀺽
ACTIVITY=􀒓
LOCK=􀒳
BELL=􀋚
BELL_DOT=􀝗
# Git Icons
GIT_ISSUE=􀍷
GIT_DISCUSSION=􀒤
GIT_PULL_REQUEST=􀙡
GIT_COMMIT=􀡚
GIT_INDICATOR=􀂓
# Spotify Icons
SPOTIFY_BACK=􀊎
SPOTIFY_PLAY_PAUSE=􀊈
SPOTIFY_NEXT=􀊐
SPOTIFY_SHUFFLE=􀊝
SPOTIFY_REPEAT=􀊞
# Yabai Icons
YABAI_STACK=􀏭
YABAI_FULLSCREEN_ZOOM=􀏜
YABAI_PARENT_ZOOM=􀥃
YABAI_FLOAT=􀢌
YABAI_GRID=􀧍

View file

@ -1,31 +0,0 @@
#!/usr/bin/env sh
POPUP_OFF="sketchybar --set apple.logo popup.drawing=off"
POPUP_CLICK_SCRIPT="sketchybar --set \$NAME popup.drawing=toggle"
sketchybar --add item apple.logo left \
\
--set apple.logo icon=$APPLE \
icon.font="$FONT:Black:16.0" \
icon.color=$BLUE2 \
background.padding_right=25 \
label.drawing=off \
click_script="$POPUP_CLICK_SCRIPT" \
\
--add item apple.prefs popup.apple.logo \
--set apple.prefs icon=$PREFERENCES \
label="Preferences" \
click_script="open -a 'System Preferences';
$POPUP_OFF" \
\
--add item apple.activity popup.apple.logo \
--set apple.activity icon=$ACTIVITY \
label="Activity" \
click_script="open -a 'Activity Monitor';
$POPUP_OFF"\
\
--add item apple.lock popup.apple.logo \
--set apple.lock icon=$LOCK \
label="Lock Screen" \
click_script="pmset displaysleepnow;
$POPUP_OFF"

View file

@ -1,14 +0,0 @@
#!/usr/bin/env sh
# Trigger the brew_udpate event when brew update or upgrade is run from cmdline
# e.g. via function in .zshrc
sketchybar --add event brew_update \
--add item brew right \
--set brew script="$PLUGIN_DIR/brew.sh" \
icon=󰏗 \
label=? \
label.color=$BLACK \
background.padding_right=15 \
--subscribe brew brew_update

View file

@ -1,12 +0,0 @@
#!/usr/bin/env sh
sketchybar --add item calendar center \
--set calendar icon=cal \
icon.font="$FONT:Black:12.0" \
icon.padding_right=0 \
label.width=50 \
label.align=right \
background.padding_left=15 \
update_freq=30 \
script="$PLUGIN_DIR/calendar.sh" \
click_script="$PLUGIN_DIR/zen.sh"

View file

@ -1,37 +0,0 @@
#!/usr/bin/env sh
sketchybar --add item cpu.top right \
--set cpu.top label.font="$FONT:Semibold:7" \
label=CPU \
icon.drawing=off \
width=0 \
y_offset=6 \
\
--add item cpu.percent right \
--set cpu.percent label.font="$FONT:Heavy:12" \
label=CPU \
y_offset=-4 \
width=40 \
icon.drawing=off \
update_freq=2 \
mach_helper="$HELPER" \
\
--add graph cpu.sys right 100 \
--set cpu.sys width=0 \
graph.color=$RED \
graph.fill_color=$RED \
label.drawing=off \
icon.drawing=off \
background.padding_left=10 \
background.height=30 \
background.drawing=on \
background.color=$TRANSPARENT \
\
--add graph cpu.user right 100 \
--set cpu.user graph.color=$BLUE \
label.drawing=off \
icon.drawing=off \
background.padding_left=10 \
background.height=30 \
background.drawing=on \
background.color=$TRANSPARENT

View file

@ -1,9 +0,0 @@
sketchybar --add bracket status brew volume volume_alias \
--set status background.color=$WHITE
# sketchybar --add item divider right \
# --set divider label.drawing=off \
# icon=􀫰 \
# icon.font="$FONT:Black:22.0" \
# background.padding_left=15 \
# background.padding_right=20

View file

@ -1,29 +0,0 @@
#!/usr/bin/env sh
FRONT_APP_SCRIPT='sketchybar --set $NAME label="$INFO"'
sketchybar --add event window_focus \
--add event windows_on_spaces \
--add item system.yabai left \
--set system.yabai script="$PLUGIN_DIR/yabai.sh" \
icon.font="$FONT:Bold:16.0" \
label.drawing=off \
icon.width=30 \
icon=$YABAI_GRID \
icon.color=$BLACK \
updates=on \
associated_display=active \
--subscribe system.yabai window_focus \
windows_on_spaces \
mouse.clicked \
\
--add item front_app left \
--set front_app script="$FRONT_APP_SCRIPT" \
icon.drawing=off \
background.padding_left=0 \
background.padding_right=10 \
label.color=$BLACK \
label.font="$FONT:Black:12.0" \
associated_display=active \
--subscribe front_app front_app_switched

View file

@ -1,27 +0,0 @@
#!/usr/bin/env sh
POPUP_CLICK_SCRIPT="sketchybar --set \$NAME popup.drawing=toggle"
sketchybar --add item github.bell right \
--set github.bell update_freq=180 \
icon.font="$FONT:Bold:15.0" \
icon=$BELL \
icon.color=$BLUE \
label=$LOADING \
label.highlight_color=$BLUE \
popup.align=right \
script="$PLUGIN_DIR/github.sh" \
click_script="$POPUP_CLICK_SCRIPT" \
--subscribe github.bell mouse.entered \
mouse.exited \
mouse.exited.global \
\
--add item github.template popup.github.bell \
--set github.template drawing=off \
background.corner_radius=12 \
background.padding_left=7 \
background.padding_right=7 \
background.color=$BLACK \
background.drawing=off \
icon.background.height=2 \
icon.background.y_offset=-12

View file

@ -1,39 +0,0 @@
#!/usr/bin/env sh
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
SPACE_CLICK_SCRIPT="yabai -m space --focus \$SID 2>/dev/null"
sid=0
for i in "${!SPACE_ICONS[@]}"
do
sid=$(($i+1))
sketchybar --add space space.$sid left \
--set space.$sid associated_space=$sid \
icon=${SPACE_ICONS[i]} \
icon.padding_left=22 \
icon.padding_right=22 \
label.padding_right=33 \
icon.highlight_color=$WHITE \
icon.color=0xff4c566a \
background.padding_left=-8 \
background.padding_right=-8 \
background.color=$BACKGROUND_1 \
background.drawing=on \
label.font="JetBrainsMono Nerd Font:Regular:16.0" \
label.background.height=26 \
label.background.drawing=on \
label.background.color=$BACKGROUND_2 \
label.background.corner_radius=9 \
label.drawing=off \
script="$PLUGIN_DIR/space.sh" \
click_script="$SPACE_CLICK_SCRIPT"
done
sketchybar --add item separator left \
--set separator icon= \
icon.font="JetBrainsMono Nerd Font:Regular:16.0" \
background.padding_left=26 \
background.padding_right=15 \
label.drawing=off \
associated_display=active \
icon.color=$GREEN

View file

@ -1,125 +0,0 @@
SPOTIFY_EVENT="com.spotify.client.PlaybackStateChanged"
POPUP_SCRIPT="sketchybar -m --set spotify.anchor popup.drawing=toggle"
sketchybar --add event spotify_change $SPOTIFY_EVENT \
--add item spotify.anchor center \
--set spotify.anchor script="$PLUGIN_DIR/spotify.sh" \
click_script="$POPUP_SCRIPT" \
background.padding_left=22 \
popup.horizontal=on \
popup.align=center \
popup.height=120 \
icon=􁁒 \
icon.font="$FONT:Regular:25.0" \
icon.drawing=off \
label.drawing=off \
drawing=off \
--subscribe spotify.anchor mouse.entered mouse.exited \
mouse.exited.global \
\
--add item spotify.cover popup.spotify.anchor \
--set spotify.cover script="$PLUGIN_DIR/spotify.sh" \
label.drawing=off \
icon.drawing=off \
background.padding_left=12 \
background.padding_right=10 \
background.image.scale=0.15 \
background.image.drawing=on \
background.drawing=on \
\
--add item spotify.title popup.spotify.anchor \
--set spotify.title icon.drawing=off \
background.padding_left=0 \
background.padding_right=0 \
width=0 \
label.font="$FONT:Heavy:14.0" \
y_offset=40 \
\
--add item spotify.artist popup.spotify.anchor \
--set spotify.artist icon.drawing=off \
y_offset=20 \
background.padding_left=0 \
background.padding_right=0 \
width=0 \
\
--add item spotify.album popup.spotify.anchor \
--set spotify.album icon.drawing=off \
background.padding_left=0 \
background.padding_right=0 \
y_offset=3 \
width=0 \
\
--add item spotify.shuffle popup.spotify.anchor \
--set spotify.shuffle icon=􀊝 \
icon.padding_left=5 \
icon.padding_right=5 \
icon.color=$BLACK \
icon.highlight_color=$MAGENTA \
label.drawing=off \
script="$PLUGIN_DIR/spotify.sh" \
y_offset=-30 \
--subscribe spotify.shuffle mouse.clicked \
\
--add item spotify.back popup.spotify.anchor \
--set spotify.back icon=􀊎 \
icon.padding_left=5 \
icon.padding_right=5 \
icon.color=$BLACK \
script="$PLUGIN_DIR/spotify.sh" \
label.drawing=off \
y_offset=-30 \
--subscribe spotify.back mouse.clicked \
\
--add item spotify.play popup.spotify.anchor \
--set spotify.play icon=􀊔 \
background.height=40 \
background.corner_radius=20 \
width=40 \
align=center \
background.color=$BLACK \
background.border_color=$WHITE \
background.border_width=0 \
background.drawing=on \
icon.padding_left=4 \
icon.padding_right=5 \
icon.color=$WHITE \
updates=on \
label.drawing=off \
script="$PLUGIN_DIR/spotify.sh" \
y_offset=-30 \
--subscribe spotify.play mouse.clicked spotify_change \
\
--add item spotify.next popup.spotify.anchor \
--set spotify.next icon=􀊐 \
icon.padding_left=5 \
icon.padding_right=10 \
icon.color=$BLACK \
label.drawing=off \
script="$PLUGIN_DIR/spotify.sh" \
y_offset=-30 \
--subscribe spotify.next mouse.clicked \
\
--add item spotify.repeat popup.spotify.anchor \
--set spotify.repeat icon=􀊞 \
icon.highlight_color=$MAGENTA \
icon.padding_left=5 \
icon.padding_right=10 \
icon.color=$BLACK \
label.drawing=off \
script="$PLUGIN_DIR/spotify.sh" \
y_offset=-30 \
--subscribe spotify.repeat mouse.clicked \
\
--add item spotify.spacer popup.spotify.anchor \
--set spotify.spacer width=5 \
\
--add bracket spotify spotify.shuffle \
spotify.back \
spotify.play \
spotify.next \
spotify.repeat \
--set spotify background.color=$GREEN \
background.corner_radius=11 \
background.drawing=on \
y_offset=-30 \
drawing=off

View file

@ -1,27 +0,0 @@
sketchybar --add item volume right \
--set volume script="$PLUGIN_DIR/volume.sh" \
updates=on \
icon.background.drawing=on \
icon.background.color=$GREEN \
icon.background.height=8 \
icon.background.corner_radius=3 \
icon.width=0 \
icon.align=right \
label.drawing=off \
background.drawing=on \
background.color=$BACKGROUND_2 \
background.height=8 \
background.corner_radius=3 \
align=left \
--subscribe volume volume_change
sketchybar --add alias "Control Center,Sound" right \
--rename "Control Center,Sound" volume_alias \
--set volume_alias icon.drawing=off \
label.drawing=off \
alias.color=$WHITE \
background.padding_right=0 \
background.padding_left=5 \
width=50 \
align=right \
click_script="$PLUGIN_DIR/volume_click.sh"

View file

@ -1,21 +0,0 @@
#!/usr/bin/env sh
source "$HOME/.config/sketchybar/colors.sh"
COUNT=$(brew outdated | wc -l | tr -d ' ')
COLOR=$RED
case "$COUNT" in
[3-5][0-9]) COLOR=$ORANGE
;;
[1-2][0-9]) COLOR=$YELLOW
;;
[1-9]) COLOR=$BLACK
;;
0) COLOR=$GREEN
COUNT=􀆅
;;
esac
sketchybar --set $NAME label=$COUNT icon.color=$COLOR

View file

@ -1,3 +0,0 @@
#!/usr/bin/env sh
sketchybar --set $NAME icon="$(date '+%a %d. %b')" label="$(date '+%H:%M')"

View file

@ -1,87 +0,0 @@
#!/bin/sh
update() {
source "$HOME/.config/sketchybar/colors.sh"
source "$HOME/.config/sketchybar/icons.sh"
NOTIFICATIONS="$(gh api notifications)"
COUNT="$(echo "$NOTIFICATIONS" | jq 'length')"
args=()
if [ "$NOTIFICATIONS" = "[]" ]; then
args+=(--set $NAME icon=$BELL label="0")
else
args+=(--set $NAME icon=$BELL_DOT label="$COUNT")
fi
PREV_COUNT=$(sketchybar --query github.bell | jq -r .label.value)
# For sound to play around with:
# afplay /System/Library/Sounds/Morse.aiff
args+=(--remove '/github.notification\.*/')
COUNTER=0
COLOR=$BLUE
args+=(--set github.bell icon.color=$COLOR)
while read -r repo url type title
do
COUNTER=$((COUNTER + 1))
IMPORTANT="$(echo "$title" | egrep -i "(deprecat|break|broke)")"
COLOR=$BLUE
PADDING=0
if [ "${repo}" = "" ] && [ "${title}" = "" ]; then
repo="Note"
title="No new notifications"
fi
case "${type}" in
"'Issue'") COLOR=$GREEN; ICON=$GIT_ISSUE; URL="$(gh api "$(echo "${url}" | sed -e "s/^'//" -e "s/'$//")" | jq .html_url)"
;;
"'Discussion'") COLOR=$WHITE; ICON=$GIT_DISCUSSION; URL="https://www.github.com/notifications"
;;
"'PullRequest'") COLOR=$MAGENTA; ICON=$GIT_PULL_REQUEST; URL="$(gh api "$(echo "${url}" | sed -e "s/^'//" -e "s/'$//")" | jq .html_url)"
;;
"'Commit'") COLOR=$WHITE; ICON=$GIT_COMMIT; URL="$(gh api "$(echo "${url}" | sed -e "s/^'//" -e "s/'$//")" | jq .html_url)"
;;
esac
if [ "$IMPORTANT" != "" ]; then
COLOR=$RED
ICON=􀁞
args+=(--set github.bell icon.color=$COLOR)
fi
args+=(--clone github.notification.$COUNTER github.template \
--set github.notification.$COUNTER label="$(echo "$title" | sed -e "s/^'//" -e "s/'$//")" \
icon="$ICON $(echo "$repo" | sed -e "s/^'//" -e "s/'$//"):" \
icon.padding_left="$PADDING" \
label.padding_right="$PADDING" \
icon.color=$COLOR \
position=popup.github.bell \
icon.background.color=$COLOR \
drawing=on \
click_script="open $URL;
sketchybar --set github.bell popup.drawing=off")
done <<< "$(echo "$NOTIFICATIONS" | jq -r '.[] | [.repository.name, .subject.latest_comment_url, .subject.type, .subject.title] | @sh')"
sketchybar -m "${args[@]}"
if [ $COUNT -gt $PREV_COUNT ] 2>/dev/null || [ "$SENDER" = "forced" ]; then
sketchybar --animate tanh 15 --set github.bell label.y_offset=5 label.y_offset=0
fi
}
popup() {
sketchybar --set $NAME popup.drawing=$1
}
case "$SENDER" in
"routine"|"forced") update
;;
"mouse.entered") popup on
;;
"mouse.exited"|"mouse.exited.global") popup off
;;
"mouse.clicked") popup toggle
;;
esac

View file

@ -1,381 +0,0 @@
case "$1" in
"Brave Browser")
icon_result=":brave_browser:"
;;
"Keyboard Maestro")
icon_result=":keyboard_maestro:"
;;
"Min")
icon_result=":min_browser:"
;;
"Final Cut Pro")
icon_result=":final_cut_pro:"
;;
"FaceTime")
icon_result=":face_time:"
;;
"Affinity Publisher")
icon_result=":affinity_publisher:"
;;
"Messages" | "Nachrichten")
icon_result=":messages:"
;;
"Tweetbot" | "Twitter")
icon_result=":twitter:"
;;
"ClickUp")
icon_result=":click_up:"
;;
"KeePassXC")
icon_result=":kee_pass_x_c:"
;;
"Microsoft Edge")
icon_result=":microsoft_edge:"
;;
"VLC")
icon_result=":vlc:"
;;
"Emacs")
icon_result=":emacs:"
;;
"Thunderbird")
icon_result=":thunderbird:"
;;
"Notes")
icon_result=":notes:"
;;
"Caprine")
icon_result=":caprine:"
;;
"Zulip")
icon_result=":zulip:"
;;
"Spark")
icon_result=":spark:"
;;
"Microsoft To Do" | "Things")
icon_result=":things:"
;;
"DEVONthink 3")
icon_result=":devonthink3:"
;;
"GitHub Desktop")
icon_result=":git_hub:"
;;
"App Store")
icon_result=":app_store:"
;;
"Chromium" | "Google Chrome" | "Google Chrome Canary")
icon_result=":google_chrome:"
;;
"zoom.us")
icon_result=":zoom:"
;;
"MoneyMoney")
icon_result=":bank:"
;;
"Color Picker")
icon_result=":color_picker:"
;;
"Microsoft Word")
icon_result=":microsoft_word:"
;;
"Iris")
icon_result=":iris:"
;;
"WebStorm")
icon_result=":web_storm:"
;;
"Neovide" | "MacVim" | "Vim" | "VimR")
icon_result=":vim:"
;;
"Sublime Text")
icon_result=":sublime_text:"
;;
"PomoDone App")
icon_result=":pomodone:"
;;
"Setapp")
icon_result=":setapp:"
;;
"qutebrowser")
icon_result=":qute_browser:"
;;
"Mattermost")
icon_result=":mattermost:"
;;
"Notability")
icon_result=":notability:"
;;
"WhatsApp")
icon_result=":whats_app:"
;;
"OBS")
icon_result=":obsstudio:"
;;
"Parallels Desktop")
icon_result=":parallels:"
;;
"VMware Fusion")
icon_result=":vmware_fusion:"
;;
"Pine")
icon_result=":pine:"
;;
"Microsoft Excel")
icon_result=":microsoft_excel:"
;;
"Microsoft PowerPoint")
icon_result=":microsoft_power_point:"
;;
"Matlab")
icon_result=":matlab:"
;;
"Numbers")
icon_result=":numbers:"
;;
"Default")
icon_result=":default:"
;;
"Element")
icon_result=":element:"
;;
"Bear")
icon_result=":bear:"
;;
"TeamSpeak 3")
icon_result=":team_speak:"
;;
"Airmail")
icon_result=":airmail:"
;;
"Firefox Developer Edition" | "Firefox Nightly")
icon_result=":firefox_developer_edition:"
;;
"Trello")
icon_result=":trello:"
;;
"TickTick")
icon_result=":tick_tick:"
;;
"Notion")
icon_result=":notion:"
;;
"Live")
icon_result=":ableton:"
;;
"Evernote Legacy")
icon_result=":evernote_legacy:"
;;
"Calendar" | "Fantastical")
icon_result=":calendar:"
;;
"Android Studio")
icon_result=":android_studio:"
;;
"Xcode")
icon_result=":xcode:"
;;
"Slack")
icon_result=":slack:"
;;
"Sequel Pro")
icon_result=":sequel_pro:"
;;
"Bitwarden")
icon_result=":bit_warden:"
;;
"System Preferences")
icon_result=":gear:"
;;
"Discord" | "Discord Canary" | "Discord PTB")
icon_result=":discord:"
;;
"Vivaldi")
icon_result=":vivaldi:"
;;
"Firefox")
icon_result=":firefox:"
;;
"Skype")
icon_result=":skype:"
;;
"Dropbox")
icon_result=":dropbox:"
;;
"微信")
icon_result=":wechat:"
;;
"Typora")
icon_result=":text:"
;;
"Blender")
icon_result=":blender:"
;;
"Canary Mail" | "HEY" | "Mail" | "Mailspring" | "MailMate" | "邮件")
icon_result=":mail:"
;;
"Safari" | "Safari Technology Preview")
icon_result=":safari:"
;;
"Telegram")
icon_result=":telegram:"
;;
"Keynote")
icon_result=":keynote:"
;;
"Reeder")
icon_result=":reeder5:"
;;
"Spotify")
icon_result=":spotify:"
;;
"MAMP" | "MAMP PRO")
icon_result=":mamp:"
;;
"Figma")
icon_result=":figma:"
;;
"Joplin")
icon_result=":joplin:"
;;
"Spotlight")
icon_result=":spotlight:"
;;
"Music")
icon_result=":music:"
;;
"Insomnia")
icon_result=":insomnia:"
;;
"TIDAL")
icon_result=":tidal:"
;;
"Alfred")
icon_result=":alfred:"
;;
"Pages")
icon_result=":pages:"
;;
"Folx")
icon_result=":folx:"
;;
"Android Messages")
icon_result=":android_messages:"
;;
"mpv")
icon_result=":mpv:"
;;
"网易云音乐")
icon_result=":netease_music:"
;;
"Transmit")
icon_result=":transmit:"
;;
"Pi-hole Remote")
icon_result=":pihole:"
;;
"Nova")
icon_result=":nova:"
;;
"Affinity Designer")
icon_result=":affinity_designer:"
;;
"IntelliJ IDEA")
icon_result=":idea:"
;;
"Drafts")
icon_result=":drafts:"
;;
"Audacity")
icon_result=":audacity:"
;;
"Affinity Photo")
icon_result=":affinity_photo:"
;;
"Atom")
icon_result=":atom:"
;;
"Obsidian")
icon_result=":obsidian:"
;;
"CleanMyMac X")
icon_result=":desktop:"
;;
"Zotero")
icon_result=":zotero:"
;;
"Todoist")
icon_result=":todoist:"
;;
"LibreWolf")
icon_result=":libre_wolf:"
;;
"Grammarly Editor")
icon_result=":grammarly:"
;;
"OmniFocus")
icon_result=":omni_focus:"
;;
"Reminders")
icon_result=":reminders:"
;;
"Preview" | "Skim" | "zathura")
icon_result=":pdf:"
;;
"1Password 7")
icon_result=":one_password:"
;;
"Code" | "Code - Insiders")
icon_result=":code:"
;;
"VSCodium")
icon_result=":vscodium:"
;;
"Tower")
icon_result=":tower:"
;;
"Calibre")
icon_result=":book:"
;;
"Finder" | "访达")
icon_result=":finder:"
;;
"Linear")
icon_result=":linear:"
;;
"League of Legends")
icon_result=":league_of_legends:"
;;
"Zeplin")
icon_result=":zeplin:"
;;
"Signal")
icon_result=":signal:"
;;
"Podcasts")
icon_result=":podcasts:"
;;
"Alacritty" | "Hyper" | "iTerm2" | "kitty" | "Terminal" | "WezTerm")
icon_result=":terminal:"
;;
"Tor Browser")
icon_result=":tor_browser:"
;;
"Kakoune")
icon_result=":kakoune:"
;;
"GrandTotal" | "Receipts")
icon_result=":dollar:"
;;
"Sketch")
icon_result=":sketch:"
;;
"Sequel Ace")
icon_result=":sequel_ace:"
;;
*)
icon_result=":default:"
;;
esac
echo $icon_result

View file

@ -1,8 +0,0 @@
#!/usr/bin/env sh
WIDTH="dynamic"
if [ "$SELECTED" = "true" ]; then
WIDTH="0"
fi
sketchybar --animate tanh 20 --set $NAME icon.highlight=$SELECTED label.width=$WIDTH

View file

@ -1,114 +0,0 @@
#!/bin/sh
next ()
{
osascript -e 'tell application "Spotify" to play next track'
}
back ()
{
osascript -e 'tell application "Spotify" to play previous track'
}
play ()
{
osascript -e 'tell application "Spotify" to playpause'
}
repeat ()
{
REPEAT=$(osascript -e 'tell application "Spotify" to get repeating')
if [ "$REPEAT" = "false" ]; then
sketchybar -m --set spotify.repeat icon.highlight=on
osascript -e 'tell application "Spotify" to set repeating to true'
else
sketchybar -m --set spotify.repeat icon.highlight=off
osascript -e 'tell application "Spotify" to set repeating to false'
fi
}
shuffle ()
{
SHUFFLE=$(osascript -e 'tell application "Spotify" to get shuffling')
if [ "$SHUFFLE" = "false" ]; then
sketchybar -m --set spotify.shuffle icon.highlight=on
osascript -e 'tell application "Spotify" to set shuffling to true'
else
sketchybar -m --set spotify.shuffle icon.highlight=off
osascript -e 'tell application "Spotify" to set shuffling to false'
fi
}
update ()
{
PLAYING=1
if [ "$(echo "$INFO" | jq -r '.["Player State"]')" = "Playing" ]; then
PLAYING=0
TRACK="$(echo "$INFO" | jq -r .Name | sed 's/\(.\{20\}\).*/\1.../')"
ARTIST="$(echo "$INFO" | jq -r .Artist | sed 's/\(.\{20\}\).*/\1.../')"
ALBUM="$(echo "$INFO" | jq -r .Album | sed 's/\(.\{25\}\).*/\1.../')"
SHUFFLE=$(osascript -e 'tell application "Spotify" to get shuffling')
REPEAT=$(osascript -e 'tell application "Spotify" to get repeating')
COVER=$(osascript -e 'tell application "Spotify" to get artwork url of current track')
fi
args=()
if [ $PLAYING -eq 0 ]; then
curl -s --max-time 20 "$COVER" -o /tmp/cover.jpg
if [ "$ARTIST" == "" ]; then
args+=(--set spotify.title label="$TRACK" drawing=on \
--set spotify.album label="Podcast" drawing=on \
--set spotify.artist label="$ALBUM" drawing=on )
else
args+=(--set spotify.title label="$TRACK" drawing=on \
--set spotify.album label="$ALBUM" drawing=on \
--set spotify.artist label="$ARTIST" drawing=on)
fi
args+=(--set spotify.play icon=􀊆 \
--set spotify.shuffle icon.highlight=$SHUFFLE \
--set spotify.repeat icon.highlight=$REPEAT \
--set spotify.cover background.image="/tmp/cover.jpg" \
background.color=0x00000000 \
--set spotify.anchor icon.drawing=on \
drawing=on \
--set spotify drawing=on )
else
args+=(--set spotify.title drawing=off \
--set spotify.artist drawing=off \
--set spotify.anchor drawing=off popup.drawing=off \
--set spotify.play icon=􀊄 )
fi
sketchybar -m "${args[@]}"
}
mouse_clicked () {
case "$NAME" in
"spotify.next") next
;;
"spotify.back") back
;;
"spotify.play") play
;;
"spotify.shuffle") shuffle
;;
"spotify.repeat") repeat
;;
*) exit
;;
esac
}
popup () {
sketchybar --set spotify.anchor popup.drawing=$1
}
case "$SENDER" in
"mouse.clicked") mouse_clicked
;;
"mouse.entered") popup on
;;
"mouse.exited"|"mouse.exited.global") popup off
;;
*) update
;;
esac

View file

@ -1,23 +0,0 @@
#!/usr/bin/env sh
WIDTH=100
volume_change() {
INITIAL_WIDTH=$(sketchybar --query $NAME | jq ".icon.width")
if [ "$INITIAL_WIDTH" -eq "0" ]; then
sketchybar --animate tanh 30 --set $NAME width=$WIDTH icon.width=$INFO
else
sketchybar --set $NAME icon.width=$INFO width=$WIDTH
fi
sleep 5
FINAL_WIDTH=$(sketchybar --query $NAME | jq ".icon.width")
if [ "$FINAL_WIDTH" -eq "$INFO" ]; then
sketchybar --animate tanh 30 --set $NAME width=0 icon.width=0
fi
}
case "$SENDER" in
"volume_change") volume_change
;;
esac

View file

@ -1,9 +0,0 @@
#!/usr/bin/env sh
MUTED=$(osascript -e 'output muted of (get volume settings)')
if [ "$MUTED" = "false" ]; then
osascript -e 'set volume output muted true'
else
osascript -e 'set volume output muted false'
fi

View file

@ -1,45 +0,0 @@
#!/bin/sh
zen_on() {
sketchybar --set github.bell drawing=off \
--set apple.logo drawing=off \
--set '/cpu.*/' drawing=off \
--set calendar icon.drawing=off \
--set system.yabai drawing=off \
--set separator drawing=off \
--set front_app drawing=off \
--set volume_alias drawing=off \
--set spotify.anchor drawing=off \
--set spotify.play updates=off \
--set brew drawing=off \
--set divider drawing=off \
--bar padding_left=18
}
zen_off() {
sketchybar --set github.bell drawing=on \
--set apple.logo drawing=on \
--set '/cpu.*/' drawing=on \
--set calendar icon.drawing=on \
--set separator drawing=on \
--set front_app drawing=on \
--set system.yabai drawing=on \
--set volume_alias drawing=on \
--set spotify.play updates=on \
--set brew drawing=on \
--set divider drawing=on \
--bar padding_left=7
}
if [ "$1" = "on" ]; then
zen_on
elif [ "$1" = "off" ]; then
zen_off
else
if [ "$(sketchybar --query apple.logo | jq -r ".geometry.drawing")" = "on" ]; then
zen_on
else
zen_off
fi
fi

View file

@ -15,11 +15,11 @@
"sf-pro": "sf-pro"
},
"locked": {
"lastModified": 1740961576,
"narHash": "sha256-9L6d3owtajM72YvUOpK1zYle2nM0BpsuopbF9lm9lJs=",
"lastModified": 1748299691,
"narHash": "sha256-HMlx5HzeOOhpewq3y9UaSMP9AkhEo+AFJHZIWLQvJGw=",
"owner": "Lyndeno",
"repo": "apple-fonts.nix",
"rev": "4df58996ed654f6ce9b71b41c1826484c6870739",
"rev": "ec51ae2e8ba89adbb5188c40aa262a7418c48b00",
"type": "github"
},
"original": {
@ -28,73 +28,6 @@
"type": "github"
}
},
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1745523430,
"narHash": "sha256-EAYWV+kXbwsH+8G/8UtmcunDeKwLwSOyfcmzZUkWE/c=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "58bfe2553d937d8af0564f79d5b950afbef69717",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1736852337,
"narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1732806396,
"narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@ -102,11 +35,11 @@
]
},
"locked": {
"lastModified": 1746254942,
"narHash": "sha256-Y062AuRx6l+TJNX8wxZcT59SSLsqD9EedAY0mqgTtQE=",
"lastModified": 1751313918,
"narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "760a11c87009155afa0140d55c40e7c336d62d7a",
"rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
"type": "github"
},
"original": {
@ -116,54 +49,7 @@
"type": "github"
}
},
"firefox-gnome-theme": {
"flake": false,
"locked": {
"lastModified": 1744642301,
"narHash": "sha256-5A6LL7T0lttn1vrKsNOKUk9V0ittdW0VEqh6AtefxJ4=",
"owner": "rafaelmardojai",
"repo": "firefox-gnome-theme",
"rev": "59e3de00f01e5adb851d824cf7911bd90c31083a",
"type": "github"
},
"original": {
"owner": "rafaelmardojai",
"repo": "firefox-gnome-theme",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1746162366,
"narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -179,7 +65,7 @@
"type": "github"
}
},
"flake-compat_4": {
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -200,33 +86,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"lastModified": 1749398372,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"stylix",
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"type": "github"
},
"original": {
@ -291,28 +155,7 @@
},
"flake-utils_4": {
"inputs": {
"systems": [
"stylix",
"systems"
]
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"inputs": {
"systems": "systems_6"
"systems": "systems_5"
},
"locked": {
"lastModified": 1705309234,
@ -328,9 +171,9 @@
"type": "github"
}
},
"flake-utils_6": {
"flake-utils_5": {
"inputs": {
"systems": "systems_7"
"systems": "systems_6"
},
"locked": {
"lastModified": 1710146030,
@ -346,9 +189,9 @@
"type": "github"
}
},
"flake-utils_7": {
"flake-utils_6": {
"inputs": {
"systems": "systems_8"
"systems": "systems_7"
},
"locked": {
"lastModified": 1705309234,
@ -364,48 +207,6 @@
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1731966426,
"narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "106af9e2f715e2d828df706c386a685698f3223b",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "fromYaml",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"stylix",
"flake-compat"
],
"gitignore": "gitignore_2",
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"flake": false,
"locked": {
@ -423,28 +224,6 @@
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"stylix",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_3": {
"inputs": {
"nixpkgs": [
"zls",
@ -465,23 +244,6 @@
"type": "github"
}
},
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1732369855,
"narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "dadd58f630eeea41d645ee225a63f719390829dc",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "47.2",
"repo": "gnome-shell",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -489,11 +251,11 @@
]
},
"locked": {
"lastModified": 1746632058,
"narHash": "sha256-Mp5Bbvb+YlFEZ76C/0wFS6C1lRfH3D60u465wFNlnS0=",
"lastModified": 1751489990,
"narHash": "sha256-ENTd/sd4Vz/VJYn14SVqW1OH2m7WIAvsm9A9SrmDZRY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "708074ae6db9e0468e4f48477f856e8c2d059795",
"rev": "89af52d9a893af013f5f4c1d2d56912106827153",
"type": "github"
},
"original": {
@ -503,27 +265,6 @@
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746369725,
"narHash": "sha256-m3ai7LLFYsymMK0uVywCceWfUhP0k3CALyFOfcJACqE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1a1793f6d940d22c6e49753548c5b6cb7dc5545d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"langref": {
"flake": false,
"locked": {
@ -538,11 +279,11 @@
},
"mnw": {
"locked": {
"lastModified": 1746338991,
"narHash": "sha256-GbyoHjf14LOxZQc+0NFblI4xf/uwGrYo3W8lwE4HcwI=",
"lastModified": 1748710831,
"narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=",
"owner": "Gerg-L",
"repo": "mnw",
"rev": "c65407ee9387ef75985dad3e30f58c822c766ec1",
"rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d",
"type": "github"
},
"original": {
@ -559,11 +300,11 @@
]
},
"locked": {
"lastModified": 1745980935,
"narHash": "sha256-aLx/HDrnGTgcRZFs5kiiz173yi/RnARERDKIq+p4OJw=",
"lastModified": 1750621684,
"narHash": "sha256-E8iHTYK9iUtIjYgBNj54Xeulj9WaxSGDbzOLLFhCSqA=",
"owner": "moonlight-mod",
"repo": "moonlight",
"rev": "f2395a937ca7e4e933a44e71eb38a4c621125595",
"rev": "9398874e59f5e2b8485c489ce6c0f6c9c7d210a0",
"type": "github"
},
"original": {
@ -579,11 +320,11 @@
]
},
"locked": {
"lastModified": 1746442382,
"narHash": "sha256-lFUHQdnDqnXXzigQn6Kd4aVrDDjg80HAb7DfThQNC/I=",
"lastModified": 1751375534,
"narHash": "sha256-9z1W64dDVtVxqgPzUbjIQqRfygg1hdivUOZ6d/H+yFg=",
"owner": "viperML",
"repo": "nh",
"rev": "4eb1941c2e30f3dabbf24619c7ca7303c448983d",
"rev": "d0abb8eebe32f79ce4659e68dd777cf497a5d3d2",
"type": "github"
},
"original": {
@ -594,22 +335,17 @@
},
"nil": {
"inputs": {
"flake-utils": [
"nvf",
"flake-utils"
],
"nixpkgs": [
"nvf",
"nixpkgs"
],
"rust-overlay": "rust-overlay_2"
]
},
"locked": {
"lastModified": 1741118843,
"narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=",
"lastModified": 1750047244,
"narHash": "sha256-vluLARrk4485npdyHOj8XKr0yk6H22pNf+KVRNL+i/Y=",
"owner": "oxalica",
"repo": "nil",
"rev": "577d160da311cc7f5042038456a0713e9863d09e",
"rev": "870a4b1b5f12004832206703ac15aa85c42c247b",
"type": "github"
},
"original": {
@ -625,11 +361,11 @@
]
},
"locked": {
"lastModified": 1746330942,
"narHash": "sha256-ShizFaJCAST23tSrHHtFFGF0fwd72AG+KhPZFFQX/0o=",
"lastModified": 1751170039,
"narHash": "sha256-3EKpUmyGmHYA/RuhZjINTZPU+OFWko0eDwazUOW64nw=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "137fd2bd726fff343874f85601b51769b48685cc",
"rev": "9c932ae632d6b5150515e5749b198c175d8565db",
"type": "github"
},
"original": {
@ -658,29 +394,6 @@
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1746628701,
"narHash": "sha256-kyVvluIygGCuLDd/RTm4QVcVdhYuBuW5/RlUpiCYJMQ=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "b8e92345fb75ed4c8b4a172a344c92f962593af7",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1736012469,
@ -699,11 +412,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1743296961,
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"lastModified": 1748740939,
"narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"rev": "656a64127e9d791a334452c6b6606d17539476e2",
"type": "github"
},
"original": {
@ -712,44 +425,13 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1746557022,
"narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1720535198,
"narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1746461020,
"narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=",
"lastModified": 1751271578,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"type": "github"
},
"original": {
@ -790,29 +472,6 @@
"type": "github"
}
},
"nur": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"stylix",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1746056780,
"narHash": "sha256-/emueQGaoT4vu0QjU9LDOG5roxRSfdY0K2KkxuzazcM=",
"owner": "nix-community",
"repo": "NUR",
"rev": "d476cd0972dd6242d76374fcc277e6735715c167",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"nvf": {
"inputs": {
"flake-parts": "flake-parts",
@ -825,11 +484,11 @@
"systems": "systems_4"
},
"locked": {
"lastModified": 1746940940,
"narHash": "sha256-ASB3QVEoFK5//280uedYdt8jyDLhFa9zgj8qfc0S7Sk=",
"lastModified": 1751186226,
"narHash": "sha256-Bt7jtmCW72JUPxOIrV73qBTAUOy4qvJXsls2ERDUcGo=",
"owner": "notashelf",
"repo": "nvf",
"rev": "815ed49d3693346122ef61da6d7443cd3cc21752",
"rev": "5bad5dd94ce5ea3b40b08d9e6802e69d02198d21",
"type": "github"
},
"original": {
@ -859,12 +518,10 @@
"nh": "nh",
"nix-index-database": "nix-index-database",
"nix-options-search": "nix-options-search",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2",
"nvf": "nvf",
"rust-overlay": "rust-overlay_3",
"stylix": "stylix",
"rust-overlay": "rust-overlay",
"zen-browser": "zen-browser",
"zig": "zig",
"zls": "zls"
}
@ -872,58 +529,15 @@
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixos-cosmic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746585402,
"narHash": "sha256-Pf+ufu6bYNA1+KQKHnGMNEfTwpD9ZIcAeLoE2yPWIP0=",
"lastModified": 1751423951,
"narHash": "sha256-AowKhJGplXRkAngSvb+32598DTiI6LOzhAnzgvbCtYM=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "72dd969389583664f87aa348b3458f2813693617",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"nvf",
"nil",
"nixpkgs"
]
},
"locked": {
"lastModified": 1741055476,
"narHash": "sha256-52vwEV0oS2lCnx3c/alOFGglujZTLmObit7K8VblnS8=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "aefb7017d710f150970299685e8d8b549d653649",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_3": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1746585402,
"narHash": "sha256-Pf+ufu6bYNA1+KQKHnGMNEfTwpD9ZIcAeLoE2yPWIP0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "72dd969389583664f87aa348b3458f2813693617",
"rev": "1684ed5b15859b655caf41b467d046e29a994d04",
"type": "github"
},
"original": {
@ -1016,43 +630,6 @@
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
}
},
"stylix": {
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_4",
"git-hooks": "git-hooks",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
],
"nur": "nur",
"systems": "systems_5",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
"tinted-tmux": "tinted-tmux",
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1746575057,
"narHash": "sha256-kBlPMNZXPzDG4HUmdqYpvjvVYkoDdDrVvO14cKgHaiU=",
"owner": "danth",
"repo": "stylix",
"rev": "685deb9bae2e4c463e953ff39bd54fd448feaf05",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -1158,137 +735,38 @@
"type": "github"
}
},
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": {
"flake": false,
"locked": {
"lastModified": 1726913040,
"narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=",
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
}
},
"tinted-kitty": {
"flake": false,
"locked": {
"lastModified": 1716423189,
"narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=",
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
}
},
"tinted-schemes": {
"flake": false,
"locked": {
"lastModified": 1744974599,
"narHash": "sha256-Fg+rdGs5FAgfkYNCs74lnl8vkQmiZVdBsziyPhVqrlY=",
"owner": "tinted-theming",
"repo": "schemes",
"rev": "28c26a621123ad4ebd5bbfb34ab39421c0144bdd",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "schemes",
"type": "github"
}
},
"tinted-tmux": {
"flake": false,
"locked": {
"lastModified": 1745111349,
"narHash": "sha256-udV+nHdpqgkJI9D0mtvvAzbqubt9jdifS/KhTTbJ45w=",
"owner": "tinted-theming",
"repo": "tinted-tmux",
"rev": "e009f18a01182b63559fb28f1c786eb027c3dee9",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-tmux",
"type": "github"
}
},
"tinted-zed": {
"flake": false,
"locked": {
"lastModified": 1725758778,
"narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=",
"owner": "tinted-theming",
"repo": "base16-zed",
"rev": "122c9e5c0e6f27211361a04fae92df97940eccf9",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-zed",
"type": "github"
}
},
"treefmt-nix": {
"zen-browser": {
"inputs": {
"nixpkgs": [
"stylix",
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"lastModified": 1751256876,
"narHash": "sha256-4A8LmE0Hd9RvQwSEPYdITJebpLt7J99VY76IphzqZKc=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "615b9244dc7ac777b8f0bc3a9cb7290936e4fcf9",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"owner": "youwen5",
"repo": "zen-browser-flake",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_5",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1746533648,
"narHash": "sha256-tdYkRMWaPfF8EUTyZVFjhBA4m8vay2T0zRICsM/y1A4=",
"lastModified": 1751458413,
"narHash": "sha256-eyKdTzRaY4blNs/GVJODh4E+16wpEKmlnQUpGf9e9gc=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "3cf5310e0b70cd7c4d0fffc6d3e16bb8429d8da5",
"rev": "4f33e11d99060c5cb2bdc380a11a9b23858dcfde",
"type": "github"
},
"original": {
@ -1299,8 +777,8 @@
},
"zig-overlay": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_7",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"zls",
"nixpkgs"
@ -1322,8 +800,8 @@
},
"zls": {
"inputs": {
"flake-utils": "flake-utils_6",
"gitignore": "gitignore_3",
"flake-utils": "flake-utils_5",
"gitignore": "gitignore_2",
"langref": "langref",
"nixpkgs": "nixpkgs_4",
"zig-overlay": "zig-overlay"

View file

@ -2,7 +2,6 @@
description = "multi device configuration flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
@ -22,15 +21,13 @@
zig.url = "github:mitchellh/zig-overlay";
zls.url = "github:zigtools/zls?rev=a26718049a8657d4da04c331aeced1697bc7652b";
stylix.url = "github:danth/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.
moonlight.inputs.nixpkgs.follows = "nixpkgs";
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs";
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nh.url = "github:viperML/nh";
nh.inputs.nixpkgs.follows = "nixpkgs";
@ -41,14 +38,13 @@
};
outputs =
{
self,
nixpkgs,
nixos-cosmic,
darwin,
...
}@inputs:
let
lib = nixpkgs.lib;
inherit (nixpkgs) lib;
# TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
overlays = [
inputs.zig.overlays.default
@ -97,10 +93,16 @@
;
};
mkNeovim = import ./lib/mkNeovim.nix {
inherit overlays nixpkgs inputs;
inherit
self
overlays
nixpkgs
inputs
;
};
in
rec {
inherit self;
# "nix fmt"
formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
packages = forAllSystems (
@ -108,10 +110,11 @@
{
nvim-chloe = mkNeovim "chloe" system;
nvim-natalie = mkNeovim "natalie" system;
nvim-julia = mkNeovim "julia" system;
}
// lib.optionalAttrs (system == "aarch64-darwin") {
# "nix run .#darwin-rebuild"
darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
inherit (darwin.packages.aarch64-darwin) darwin-rebuild;
}
);
@ -121,7 +124,6 @@
host = "desktop";
system = "x86_64-linux";
extraModules = [
nixos-cosmic.nixosModules.default
];
};
# natalie's laptop
@ -149,9 +151,6 @@
user = "julia";
host = "cattop";
system = "x86_64-linux";
extraModules = [
nixos-cosmic.nixosModules.default
];
};
# generate checks for "nix flake check --all-systems --no-build"

View file

@ -1,13 +1,13 @@
{
self,
nixpkgs,
# TODO: apply overlays here
overlays,
inputs,
}:
configPath: system:
user: system:
let
darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;
user = builtins.elemAt (builtins.split "/" configPath) 0;
host = {
inherit darwin;
@ -20,11 +20,12 @@ in
(inputs.nvf.lib.neovimConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = builtins.filter (f: f != null) [
(../users + ("/" + configPath + "/vim.nix"))
(../users + ("/" + user + "/vim.nix"))
../modules/neovim
];
extraSpecialArgs = {
inherit host;
flake = self;
user = userConfig;
};
}).neovim

View file

@ -9,7 +9,7 @@
name:
{
user, # ./users/{name}
host, # ./users/{name}/{host} (optional)
host, # ./users/{name}/{host}
system, # arch-os
extraModules ? [ ],
}:
@ -101,9 +101,6 @@ systemFunc {
(getInputModule "nix-index-database" "nix-index")
{ programs.nix-index-database.comma.enable = true; }
# Themes for all programs
(getInputModule "stylix" "stylix")
# Home manager
(getInputModule "home-manager" "home-manager")
{

View file

@ -16,7 +16,14 @@ in
imports = mainHomeImports ++ [
./macos/sketchybar.nix
];
programs = {
options = {
programs.ghostty.shader = lib.mkOption {
type = lib.types.str;
default = { };
description = "set the ghostty shader, relative to 'files/ghostty'";
};
};
config.programs = {
home-manager.enable = true;
nix-index.enable = true;
@ -86,8 +93,12 @@ in
};
shellInit = ''
batman --export-env | source
test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
'';
##test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
};
ghostty.settings.custom-shader = lib.mkIf (
cfg.ghostty.shader != null
) "${../../files/ghostty}/${cfg.ghostty.shader}";
};
}

View file

@ -5,13 +5,10 @@
host,
...
}:
let
# folder = "${config.home.homeDirectory}.dotfiles/files/sketchybar";
# folder = "~/.dotfiles/files/sketchybar";
folder = ../../../files/sketchybar;
in
lib.mkIf (host.darwin) {
{
home.file =
{ }
// lib.optionalAttrs host.darwin (
lib.attrsets.mapAttrs
(
file: value: (lib.attrsets.overrideExisting value { enable = config.shared.darwin.tiling.enable; })
@ -24,7 +21,6 @@ lib.mkIf (host.darwin) {
#!/usr/bin/env sh
source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
source "$HOME/.config/sketchybar/icons.sh" # Loads all defined icons
ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured
PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored
@ -32,49 +28,33 @@ lib.mkIf (host.darwin) {
FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants
PADDINGS=3 # All paddings use this value (icon, label, background)
# Setting up and starting the helper process
HELPER=git.felix.helper
killall helper
cd $HOME/.config/sketchybar/helper && make
$HOME/.config/sketchybar/helper/helper $HELPER > /dev/null 2>&1 &
# Unload the macOS on screen indicator overlay for volume change
# launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 &
# Setting up the general bar appearance and default values
${pkgs.sketchybar}/bin/sketchybar --bar height=40 \
color=$BAR_COLOR \
shadow=off \
blur_radius=30 \
position=top \
sticky=on \
padding_right=0 \
padding_left=0 \
corner_radius=12 \
y_offset=0 \
margin=2 \
blur_radius=0 \
notch_width=0 \
--default updates=when_shown \
icon.font="$FONT:Bold:14.0" \
icon.color=$ICON_COLOR \
icon.padding_left=$PADDINGS \
icon.padding_right=$PADDINGS \
label.font="$FONT:Semibold:13.0" \
label.color=$LABEL_COLOR \
label.padding_left=$PADDINGS \
label.padding_right=$PADDINGS \
background.padding_right=$PADDINGS \
background.padding_left=$PADDINGS \
background.height=26 \
background.corner_radius=9 \
popup.background.border_width=2 \
popup.background.corner_radius=11 \
popup.background.border_color=$POPUP_BORDER_COLOR \
popup.background.color=$POPUP_BACKGROUND_COLOR \
popup.background.shadow.drawing=on
padding_left=10 \
padding_right=10
${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \
icon.color=$ITEM_COLOR \
label.font="SF Pro:Semibold:12.0" \
label.color=$ITEM_COLOR \
background.color=$ACCENT_COLOR \
background.corner_radius=10 \
background.height=20 \
padding_left=4 \
padding_right=4 \
icon.padding_left=6 \
icon.padding_right=3 \
label.padding_left=3 \
label.padding_right=6
# Left
source "$ITEM_DIR/apple.sh"
# source "$ITEM_DIR/apple.sh"
source "$ITEM_DIR/spaces.sh"
source "$ITEM_DIR/front_app.sh"
@ -83,11 +63,10 @@ lib.mkIf (host.darwin) {
source "$ITEM_DIR/calendar.sh"
# Right
# source "$ITEM_DIR/brew.sh"
# source "$ITEM_DIR/github.sh"
source "$ITEM_DIR/volume.sh"
# source "$ITEM_DIR/divider.sh"
# source "$ITEM_DIR/cpu.sh"
source $ITEM_DIR/calendar.sh
source $ITEM_DIR/wifi.sh
source $ITEM_DIR/battery.sh
source $ITEM_DIR/volume.sh
# Forcing all item scripts to run (never do this outside of sketchybarrc)
${pkgs.sketchybar}/bin/sketchybar --update
@ -97,275 +76,429 @@ lib.mkIf (host.darwin) {
};
icons = {
executable = true;
target = ".config/sketchybar/icons.sh";
source = folder + /icons.sh;
target = ".config/sketchybar/plugins/icons.sh";
text = ''
#!/usr/bin/env sh
# Source the icon map with all the application icons
source ${pkgs.sketchybar-app-font}/bin/icon_map.sh
# Create a cache directory if it doesn't exist
CACHE_DIR="$HOME/.cache/sketchybar"
mkdir -p "$CACHE_DIR"
# Cache file for icon mappings
ICON_CACHE="$CACHE_DIR/icon_cache.txt"
# Create the cache file if it doesn't exist
if [ ! -f "$ICON_CACHE" ]; then
touch "$ICON_CACHE"
fi
# Check if the app is already in cache
APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi)
CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2)
if [ -n "$CACHED_ICON" ]; then
# Cache hit, return the icon
echo "$CACHED_ICON"
exit 0
fi
# Get icon from the mapping function
__icon_map "$APP_NAME"
if [ -n "$icon_result" ]; then
echo "$APP_NAME|$icon_result" >>"$ICON_CACHE"
fi
echo "$icon_result"
'';
};
colors = {
executable = true;
target = ".config/sketchybar/colors.sh";
text = ''
#!/usr/bin/env sh
# Color Palette
export BLACK=0xff4c4f69
export WHITE=0xffeff1f5
export RED=0xffd20f39
export GREEN=0xff40a02b
export BLUE=0xff1e66f5
export YELLOW=0xffdf8e1d
export ORANGE=0xfffe640b
export MAGENTA=0xffea76cb
export GREY=0xff9ca0b0
export TRANSPARENT=0xff000000
export BLUE2=0xff7287fd
export FLAMINGO=0xffdd7878
# General bar colors
export BAR_COLOR=0xeff1f5ff # Color of the bar
export ICON_COLOR=0xff4c4f69
export LABEL_COLOR=0xff4c4f69 # Color of all labels
export BACKGROUND_1=0xffbcc0cc
export BACKGROUND_2=0xffbcc0cc
export TRANSPARENT=0x00ffffff
export POPUP_BACKGROUND_COLOR=$BLACK
export POPUP_BORDER_COLOR=$WHITE
# -- Gray Scheme --
export ITEM_COLOR=0xff000000
export ACCENT_COLOR=0xffc3c6cb
export SHADOW_COLOR=$BLACK
# -- White Scheme --
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xffffffff
# -- Teal Scheme --
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xff2cf9ed
# -- Purple Scheme --
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xffeb46f9
# -- Red Scheme ---
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xffff2453
# -- Blue Scheme ---
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xff15bdf9
# -- Green Scheme --
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xff1dfca1
# -- Orange Scheme --
# export ITEM_COLOR=0xffffffff
# export ACCENT_COLOR=0xfff97716
# -- Yellow Scheme --
# export ITEM_COLOR=0xff000000
# export ACCENT_COLOR=0xfff7fc17
'';
};
items_apple = {
items_wifi = {
executable = true;
target = ".config/sketchybar/items/apple.sh";
source = folder + /items/executable_apple.sh;
target = ".config/sketchybar/items/wifi.sh";
text = ''
#!/usr/bin/env/ sh
sketchybar --add item wifi right \
--set wifi \
icon="􀙥" \
label="Updating..." \
script="$PLUGIN_DIR/wifi.sh" \
--subscribe wifi wifi_change
'';
};
items_brew = {
items_battery = {
executable = true;
target = ".config/sketchybar/items/brew.sh";
source = folder + /items/executable_brew.sh;
target = ".config/sketchybar/items/battery.sh";
text = ''
#!/usr/bin/env/ sh
sketchybar --add item battery right \
--set battery update_freq=180 \
script="$PLUGIN_DIR/battery.sh" \
--subscribe battery system_woke power_source_change
'';
};
items_calendar = {
executable = true;
target = ".config/sketchybar/items/calendar.sh";
text = ''
#!/usr/bin/env sh
sketchybar --add item calendar center \
--set calendar icon=cal \
display=1 \
icon.font="$FONT:Black:12.0" \
icon.padding_right=0 \
label.width=50 \
label.align=right \
background.padding_left=15 \
update_freq=30 \
script="$PLUGIN_DIR/calendar.sh" \
click_script="$PLUGIN_DIR/zen.sh"
sketchybar --add item calendar right \
--set calendar icon=􀧞 \
update_freq=15 \
script="$PLUGIN_DIR/calendar.sh"
'';
};
items_cpu = {
executable = true;
target = ".config/sketchybar/items/cpu.sh";
source = folder + /items/executable_cpu.sh;
};
items_divider = {
executable = true;
target = ".config/sketchybar/items/divider.sh";
source = folder + /items/executable_divider.sh;
};
items_front_app = {
executable = true;
target = ".config/sketchybar/items/front_app.sh";
text = ''
#!/usr/bin/env sh
FRONT_APP_SCRIPT='sketchybar --set $NAME label="$INFO"'
sketchybar --add event window_focus \
--add event windows_on_spaces \
--add item system.aerospace left \
--set system.aerospace script="$PLUGIN_DIR/aerospace.sh" \
icon.font="$FONT:Bold:16.0" \
label.drawing=off \
icon.width=30 \
icon=$YABAI_GRID \
icon.color=$BLACK \
updates=on \
display=active \
--subscribe system.aerospace window_focus \
windows_on_spaces \
mouse.clicked \
--add item front_app left \
--set front_app script="$FRONT_APP_SCRIPT" \
icon.drawing=off \
background.padding_left=0 \
background.padding_right=10 \
label.color=$BLACK \
label.font="$FONT:Black:12.0" \
display=active \
sketchybar --add item front_app left \
--set front_app background.color=$ACCENT_COLOR \
icon.color=$ITEM_COLOR \
label.color=$ITEM_COLOR \
icon.font="sketchybar-app-font:Regular:12.0" \
label.font="SF Pro:Semibold:12.0" \
script="$PLUGIN_DIR/front_app.sh" \
--subscribe front_app front_app_switched
'';
};
items_github = {
executable = true;
target = ".config/sketchybar/items/github.sh";
source = folder + /items/executable_github.sh;
};
items_spaces = {
executable = true;
target = ".config/sketchybar/items/spaces.sh";
# label.background.color=$BACKGROUND_2
text = ''
${pkgs.sketchybar}/bin/sketchybar --add event aerospace_workspace_change
${pkgs.sketchybar}/bin/sketchybar --add event aerospace_mode_change
for sid in $(${pkgs.aerospace}/bin/aerospace list-workspaces --all); do
${pkgs.sketchybar}/bin/sketchybar --add item space.$sid left \
--subscribe space.$sid aerospace_workspace_change \
--subscribe space.$sid aerospace_mode_change \
--set space.$sid \
sketchybar --add event aerospace_workspace_change
sketchybar --add item aerospace_dummy left \
--set aerospace_dummy display=0 \
script="$PLUGIN_DIR/spaces.sh" \
--subscribe aerospace_dummy aerospace_workspace_change
for m in $(aerospace list-monitors | awk '{print $1}'); do
for sid in $(aerospace list-workspaces --monitor $m); do
sketchybar --add space space.$sid left \
--set space.$sid space=$sid \
icon=$sid \
icon.padding_left=22 \
icon.padding_right=22 \
icon.highlight_color=$WHITE \
icon.highlight=off \
icon.color=0xff4c566a \
background.padding_left=-8 \
background.padding_right=-8 \
background.color=$BACKGROUND_1 \
background.drawing=on \
script="$PLUGIN_DIR/aerospace.sh $sid" \
click_script="aerospace workspace $sid" \
label.font="Iosevka Nerd Font:Regular:16.0" \
label.padding_right=33 \
label.background.height=26 \
label.background.drawing=on \
label.background.corner_radius=9 \
label.drawing=off
background.color=$TRANSPARENT \
label.color=$ACCENT_COLOR \
icon.color=$ACCENT_COLOR \
display=$m \
label.font="sketchybar-app-font:Regular:12.0" \
icon.font="SF Pro:Semibold:12.0" \
label.padding_right=10 \
label.y_offset=-1 \
click_script="$PLUGIN_DIR/space_click.sh $sid"
apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" |
awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}')
icon_strip=""
if [ "''${apps}" != "" ]; then
while read -r app; do
icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")"
done <<<"''${apps}"
else
icon_strip=" "
fi
sketchybar --set space.$sid label="$icon_strip"
done
for empty_space in $(aerospace list-workspaces --monitor $m --empty); do
sketchybar --set space.$empty_space display=0
done
for focus in $(aerospace list-workspaces --focused); do
sketchybar --set space.$focus background.drawing=on \
background.color=$ACCENT_COLOR \
label.color=$ITEM_COLOR \
icon.color=$ITEM_COLOR
done
done
${pkgs.sketchybar}/bin/sketchybar --add item separator left \
--set separator icon= \
icon.font="Iosevka Nerd Font:Regular:16.0" \
background.padding_left=26 \
background.padding_right=15 \
label.drawing=off \
display=active \
icon.color=$GREEN
'';
};
items_spotify = {
executable = true;
target = ".config/sketchybar/items/spotify.sh";
source = folder + /items/executable_spotify.sh;
};
items_volume = {
executable = true;
target = ".config/sketchybar/items/volume.sh";
text = ''
INITIAL_WIDTH=$(osascript -e 'set ovol to output volume of (get volume settings)')
${pkgs.sketchybar}/bin/sketchybar --add item volume right \
--subscribe volume volume_change \
#/usr/bin/env sh
sketchybar --add item volume right \
--set volume script="$PLUGIN_DIR/volume.sh" \
updates=on \
icon.background.drawing=on \
icon.background.color=$FLAMINGO \
icon.background.height=8 \
icon.background.corner_radius=3 \
icon.width=$INITIAL_WIDTH \
width=100 \
icon.align=right \
label.drawing=off \
background.drawing=on \
background.color=$BACKGROUND_2 \
background.height=8 \
background.corner_radius=3 \
align=left
${pkgs.sketchybar}/bin/sketchybar --add alias "Control Center,Sound" right \
--rename "Control Center,Sound" volume_alias \
--set volume_alias icon.drawing=off \
label.drawing=off \
alias.color=$BLUE2 \
background.padding_right=0 \
background.padding_left=5 \
width=50 \
align=right \
click_script="$PLUGIN_DIR/volume_click.sh"
--subscribe volume volume_change
'';
};
plugins_brew = {
plugins_wifi = {
executable = true;
target = ".config/sketchybar/plugins/brew.sh";
source = folder + /plugins/executable_brew.sh;
target = ".config/sketchybar/plugins/wifi.sh";
text = ''
#/usr/bin/env sh
SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')
if [ "$SSID" = "" ]; then
sketchybar --set $NAME icon="􀙈" label="Disconnected"
else
sketchybar --set $NAME icon="􀙇" label="$SSID"
fi
'';
};
plugins_calendar = {
executable = true;
target = ".config/sketchybar/plugins/calendar.sh";
source = folder + /plugins/executable_calendar.sh;
text = ''
#/usr/bin/env sh
sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')"
'';
};
plugins_github = {
plugins_spaces = {
executable = true;
target = ".config/sketchybar/plugins/github.sh";
source = folder + /plugins/executable_github.sh;
target = ".config/sketchybar/plugins/spaces.sh";
text = ''
#!/usr/bin/env sh
source "$CONFIG_DIR/colors.sh"
update_workspace_appearance() {
local sid=$1
local is_focused=$2
if [ "$is_focused" = "true" ]; then
sketchybar --set space.$sid background.drawing=on \
background.color=$ACCENT_COLOR \
label.color=$ITEM_COLOR \
icon.color=$ITEM_COLOR
else
sketchybar --set space.$sid background.drawing=off \
label.color=$ACCENT_COLOR \
icon.color=$ACCENT_COLOR
fi
}
update_icons() {
m=$1
sid=$2
apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \
| awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \
| sort)
icon_strip=""
if [ "''${apps}" != "" ]; then
while read -r app; do
icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
done <<<"''${apps}"
else
icon_strip=" "
fi
sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
}
update_workspace_appearance "$PREV_WORKSPACE" "false"
update_workspace_appearance "$FOCUSED_WORKSPACE" "true"
for m in $(aerospace list-monitors | awk '{print $1}'); do
for sid in $(aerospace list-workspaces --monitor $m --visible); do
sketchybar --set space.$sid display=$m
update_icons "$m" "$sid"
update_icons "$m" "$PREV_WORKSPACE"
apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l)
if [ "''${apps}" -eq 0 ]; then
sketchybar --set space.$sid display=0
fi
done
done
'';
};
plugins_icon_map = {
plugins_space_click = {
executable = true;
target = ".config/sketchybar/plugins/icon_map.sh";
source = folder + /plugins/executable_icon_map.sh;
};
plugins_space = {
executable = true;
target = ".config/sketchybar/plugins/space.sh";
source = folder + /plugins/executable_space.sh;
};
plugins_spotify = {
executable = true;
target = ".config/sketchybar/plugins/spotify.sh";
source = folder + /plugins/executable_spotify.sh;
target = ".config/sketchybar/plugins/space_click.sh";
text = ''
#/usr/bin/env/ sh
apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}')
focused=$(aerospace list-workspaces --focused)
if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then
sketchybar --set space.$1 display=0
else
aerospace workspace $1
fi
'';
};
plugins_volume = {
executable = true;
target = ".config/sketchybar/plugins/volume.sh";
text = ''
#!/usr/bin/env sh
WIDTH=100
volume_change() {
# INITIAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width")
# if [ "$INITIAL_WIDTH" -eq "0" ]; then
# ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=$WIDTH icon.width=$INFO
# else
# ${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO width=$WIDTH
# fi
${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO
# The volume_change event supplies a $INFO variable in which the current volume
# percentage is passed to the script.
if [ "$SENDER" = "volume_change" ]; then
# sleep 5
# FINAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width")
# if [ "$FINAL_WIDTH" -eq "$INFO" ]; then
# ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=0 icon.width=0
# fi
}
VOLUME=$INFO
case "$SENDER" in
"volume_change") volume_change
case $VOLUME in
[6-9][0-9] | 100)
ICON="􀊩"
;;
[3-5][0-9])
ICON="􀊥"
;;
[1-9] | [1-2][0-9])
ICON="􀊡"
;;
*) ICON="􀊣" ;;
esac
'';
};
plugins_volume_click = {
executable = true;
target = ".config/sketchybar/plugins/volume_click.sh";
text = ''
#!/usr/bin/env sh
MUTED=$(osascript -e 'output muted of (get volume settings)')
if [ "$MUTED" = "false" ]; then
osascript -e 'set volume output muted true'
else
osascript -e 'set volume output muted false'
sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
fi
'';
};
plugins_zen = {
plugins_front_app = {
executable = true;
target = ".config/sketchybar/plugins/zen.sh";
source = folder + /plugins/executable_zen.sh;
target = ".config/sketchybar/plugins/front_app.sh";
text = ''
# Some events send additional information specific to the event in the $INFO
# variable. E.g. the front_app_switched event sends the name of the newly
# focused application in the $INFO variable:
# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
app_switched() {
for m in $(aerospace list-monitors | awk '{print $1}'); do
for sid in $(aerospace list-workspaces --monitor $m --visible); do
apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \
| awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \
| awk '!seen[$0]++' | sort)
icon_strip=""
if [ "''${apps}" != "" ]; then
while read -r app; do
icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
done <<<"''${apps}"
else
icon_strip=" "
fi
sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
done
done
}
if [ "$SENDER" = "front_app_switched" ]; then
sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")"
app_switched
fi
'';
};
plugins_battery = {
executable = true;
target = ".config/sketchybar/plugins/battery.sh";
text = ''
#!/usr/bin/env sh
source "$CONFIG_DIR/colors.sh"
PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
CHARGING=$(pmset -g batt | grep 'AC Power')
if [ $PERCENTAGE = "" ]; then
exit 0
fi
case ''${PERCENTAGE} in
9[0-9] | 100)
ICON="􀛨"
COLOR=$ITEM_COLOR
;;
[6-8][0-9])
ICON="􀺸"
COLOR=$ITEM_COLOR
;;
[3-5][0-9])
ICON="􀺶"
COLOR="0xFFd97706"
;;
[1-2][0-9])
ICON="􀛩"
COLOR="0xFFf97316"
;;
*)
ICON="􀛪"
COLOR="0xFFef4444"
;;
esac
if [[ $CHARGING != "" ]]; then
ICON="􀢋"
COLOR=$ITEM_COLOR
fi
# The item invoking this script (name $NAME) will get its icon and label
# updated with the current battery status
sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR"
'';
};
plugins_aerospace = {
executable = true;
@ -404,5 +537,6 @@ lib.mkIf (host.darwin) {
esac
'';
};
};
}
);
}

View file

@ -1,5 +1,4 @@
{
pkgs,
lib,
...
}:

View file

@ -4,27 +4,15 @@ _: {
enable = true;
onActivation = {
autoUpdate = true;
autoUpdate = false;
cleanup = "none";
upgrade = true;
upgrade = false;
};
brews = [
"imagemagick"
"opam"
];
casks = [
"battle-net"
"stremio"
"alt-tab"
"legcord"
"zulip"
"zen-browser"
"supertuxkart"
"sf-symbols"
"mediosz/tap/swipeaerospace"
];
masApps = {

View file

@ -1,4 +1,5 @@
{
user,
config,
pkgs,
lib,
@ -17,6 +18,7 @@ in
# Set some OSX preferences that I always end up hunting down and changing.
system = {
primaryUser = user.username;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
stateVersion = 6;

View file

@ -17,6 +17,24 @@
theme = {
enable = true;
};
options = {
tabstop = 2;
softtabstop = 2;
shiftwidth = 2;
undofile = true;
swapfile = false;
showmode = false;
foldlevel = 99;
foldcolumn = "1";
foldlevelstart = 99;
foldenable = true;
foldmethod = "expr";
#Default to treesitter folding
foldexpr = "v:lua.vim.treesitter.foldexpr()";
};
visuals = {
# notification system
# https://github.com/j-hui/fidget.nvim
@ -26,7 +44,7 @@
highlight-undo.enable = true;
# indentation guides
# https://github.com/lukas-reineke/indent-blankline.nvim
indent-blankline.enable = false;
indent-blankline.enable = true;
# extra icons
nvim-web-devicons.enable = true;
# https://github.com/petertriho/nvim-scrollbar
@ -35,16 +53,43 @@
lsp = {
# Must be enabled for language modules to hook into the LSP API.
enable = true;
formatOnSave = true;
# show errors inline
# https://github.com/folke/trouble.nvim
trouble.enable = true;
# show lightbulb icon in gutter to indicate code actions
# https://github.com/kosayoda/nvim-lightbulb
lightbulb.enable = true;
lightbulb.enable = false;
# show icons in auto-completion menu
# https://github.com/onsails/lspkind.nvim
lspkind.enable = config.vim.autocomplete.blink-cmp.enable;
# Enables inlay hints (types info in rust and shit)
inlayHints.enable = true;
#Nice mappings that i use :3
mappings = {
codeAction = "<leader>ca";
goToDeclaration = "gD";
goToDefinition = "gd";
listReferences = "gr";
goToType = "gy";
hover = "K";
nextDiagnostic = "<leader>d";
openDiagnosticFloat = "<leader>df";
renameSymbol = "rn";
documentHighlight = null;
listDocumentSymbols = null;
listImplementations = null;
listWorkspaceFolders = null;
previousDiagnostic = null;
removeWorkspaceFolder = null;
signatureHelp = null;
toggleFormatOnSave = null;
};
};
treesitter = {
enable = true;
addDefaultGrammars = true;
};
debugger = {
nvim-dap = {
@ -56,18 +101,22 @@
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
# enable debug adapter protocol by default
enableDAP = true;
# sort-lines: on
assembly.enable = true;
bash.enable = true;
clang.enable = true;
css.enable = true;
html.enable = true;
markdown.enable = true;
nix.enable = true;
python.enable = true;
rust.crates.enable = true;
rust.enable = true;
ts.enable = true;
zig.enable = true;
lua.enable = true;
# sort-lines: off
ts.format.enable = false; # deno fmt is enabled elsewhere
@ -87,14 +136,20 @@
};
filetree = {
neo-tree = {
enable = true;
enable = false;
};
};
tabline = {
nvimBufferline.enable = true;
};
autocomplete = {
blink-cmp.enable = true;
blink-cmp = {
enable = true;
sourcePlugins = {
ripgrep.enable = true;
};
friendly-snippets.enable = true;
};
};
statusline = {
lualine = {
@ -106,16 +161,76 @@
};
};
};
utility = {
snacks-nvim = {
enable = true;
setupOpts = {
bigfile.enable = true;
explorer.replace_netrw = true;
dashboard = {
preset.keys = [
{
icon = " ";
key = "n";
desc = "New File";
action = ":ene | startinsert";
}
{
icon = " ";
key = "r";
desc = "Recent Files";
action = ":lua Snacks.dashboard.pick('oldfiles')";
}
];
sections = [
{ section = "header"; }
{
section = "keys";
indent = 2;
padding = 1;
}
{
icon = " ";
title = "Projects";
section = "projects";
indent = 2;
padding = 1;
}
{
icon = " ";
title = "Git";
section = "terminal";
enabled = lib.options.literalExpression ''
function()
return Snacks.git.get_root() ~= nil
end
'';
cmd = "git status --short --branch --renames";
height = 10;
padding = 1;
ttl = 5 * 60;
indent = 3;
}
];
};
image = {
enable = true;
math.enabled = false;
};
notifier.timeout = 3000;
picker = {
enable = true;
sources = {
explorer = { };
};
};
};
};
};
binds = {
whichKey.enable = true;
cheatsheet.enable = true;
# discourages bad keyboard habit, e.g. disables arrow keys, explains better binds
# https://github.com/m4xshen/hardtime.nvim
hardtime-nvim.enable = true;
hardtime-nvim.setupOpts = {
disable_mouse = false;
restriction_mode = "hint"; # default behavior is lenient
};
};
ui = {
borders.enable = true;
@ -127,19 +242,6 @@
enable = false;
navbuddy.enable = config.vim.ui.breadcrumbs.enable;
};
smartcolumn = {
enable = true;
setupOpts.custom_colorcolumn = {
# this is a freeform module, it's `buftype = int;` for configuring column position
nix = "110";
ruby = "120";
java = "130";
go = [
"90"
"130"
];
};
};
};
notes = {
todo-comments.enable = true;
@ -149,5 +251,11 @@
gitsigns.enable = true;
gitsigns.codeActions.enable = false; # throws an annoying debug message
};
# Better help docs
lazy.plugins."helpview.nvim" = {
enabled = true;
package = pkgs.vimPlugins.helpview-nvim;
lazy = false;
};
};
}

View file

@ -22,9 +22,6 @@
};
};
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
# Auto mount devices
udisks2 = {
enable = true;

View file

@ -5,10 +5,11 @@
};
nix = {
nixPath = [ "nixpkgs = ${inputs.nixpkgs}" ];
# nixPath = ["nixpkgs = ${inputs.nixpkgs}"];
extraOptions = ''
warn-dirty = false
'';
channel.enable = false;
optimise = {
automatic = true;
@ -19,17 +20,16 @@
"nix-command"
"flakes"
];
extra-nix-path = "nixpkgs=flake:nixpkgs";
substituters = [
"https://cache.nixos.org/?priority=10"
"https://nix-community.cachix.org"
"https://cosmic.cachix.org/"
# For haskell
"https://cache.iog.io"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
# For haskell
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];

View file

@ -19,27 +19,4 @@
BROWSER = user.browser;
};
stylix = lib.mkIf (user ? "theme" && user.theme != null) {
enable = false;
base16Scheme = "${pkgs.base16-schemes}/share/themes/${user.theme}.yaml";
fonts = lib.optionalAttrs (user ? "font") {
serif = {
package = pkgs.nerd-fonts.${user.font};
name = "${user.font} Nerd Font";
};
sansSerif = {
package = pkgs.nerd-fonts.${user.font};
name = "${user.font} Nerd Font";
};
monospace = {
package = pkgs.nerd-fonts.${user.font};
name = "${user.font} Nerd Font";
};
emoji = {
package = pkgs.twemoji-color-font;
name = "Twemoji Color";
};
};
};
}

9
nvim
View file

@ -1,13 +1,14 @@
#!/bin/sh
username="$(id -u -n)"
if [ "$username" = "clo" ]; then
name="chloe";
name="chloe"
elif [ "$username" = "nmarks" ]; then
name="natalie";
name="natalie"
elif [ "$username" = "fish" ]; then
name="julia"
fi
if [ -z "$name" ]; then
echo "Configure this wrapper script with your name." >2
echo "Configure this wrapper script with your name." >&2
exit 1
fi
exec nix run ".#nvim-$name" -- "$@"

View file

@ -6,16 +6,16 @@ machines, but also share useful modules between each other.
```
lib/ # reusable functions
modules/ # reusable modules
+-- home/ # home program configurations
+-- macos/ # nix-darwin configurations
+-- nixos/ # linux configurations
+-- neovim/ # nvf configurations
+-- nixos/ # linux configurations
+-- shared/ # shared between nixos-rebuild & darwin-rebuild
+-- home-manager.nix # home program presets
users/
+-- chloe/
| +-- user.nix # info about her
| +-- configuration.nix # for all hosts
| +-- home.nix # for all hosts
| +-- configuration.nix # for all hosts (system)
| +-- home.nix # for all hosts (userspace)
| +-- vim.nix # for neovim
| +-- sandwich/
| | +-- configuration.nix # per host
@ -67,3 +67,15 @@ Setup `nix-darwin` using the `switch` helper:
```
./switch
```
## Neovim configuration
By default, neovim is configured to all machines in `$PATH`. Neovim can be run
directly via `nix run`, which skips needing to build the whole system
configuration.
```
nix run .#nvim-natalie # run by user
./nvim # run based on your username
```

View file

@ -1,9 +0,0 @@
global {
cmd + opt + backtick -> app "Keyboard Maestro"
}
device WorkLouder {
a -> {
if app "REAPER" -> key cmd + shift
}
}

6
switch
View file

@ -1,11 +1,11 @@
#!/bin/sh
nh_subcommand="os"
fallback_command="nixos-rebuild"
if [ "$(uname -o)" ]; then
if [ "$(uname -o)" = "darwin" ]; then
nh_subcommand="darwin"
fallback_command="nix run .#darwin-rebuild"
fi;
if command -v nh > /dev/null; then
fi
if command -v nh >/dev/null; then
nh $nh_subcommand switch .
else
$fallback_command -- switch --flake .

View file

@ -3,8 +3,11 @@
{
# packages for all machines
environment.systemPackages = with pkgs; [
git
];
services.tailscale.enable = true;
# configuration for shared modules.
# all custom options in 'shared' for clarity.
shared.darwin = {

View file

@ -10,7 +10,9 @@ in
let
# packages to always install
all = [
ffmpeg
(ffmpeg.override {
withSvtav1 = true;
})
ripgrep
uv
nh
@ -33,12 +35,26 @@ in
};
programs = {
# sort-lines:start
bat.enable = true;
# bat.enable = true;
btop.enable = true;
fd.enable = true;
hyfetch.enable = true;
# sort-lines:end
ghostty = {
enable = true;
shader = "cursor-smear-black.glsl";
package = null;
settings = {
theme = "catppuccin-latte";
font-family = "AT Name Mono";
adjust-cursor-thickness = 1;
minimum-contrast = 1.1;
background-opacity = 0.9;
background-blur = true;
};
};
# zsh is the shell i use
zsh = {
enable = true;

View file

@ -0,0 +1,6 @@
_: {
homebrew = {
enable = true;
casks = [ "eloston-chromium" ];
};
}

View file

@ -13,5 +13,6 @@
pnpm
yt-dlp
spotdl
zig
];
}

View file

@ -1,21 +1,35 @@
{ ... }:
{
vim.languages.astro.enable = true;
vim.theme.extraConfig = ''
if vim.g.neovide then
vim.g.neovide_cursor_trail_size = 0.3
vim.g.neovide_scroll_animation_length = 0.1;
vim.keymap.set('n', '<D-s>', ':w<CR>') -- Save
vim.keymap.set('v', '<D-c>', '"+y') -- Copy
vim.keymap.set('n', '<D-v>', '"+P') -- Paste normal mode
vim.keymap.set('v', '<D-v>', '"+P') -- Paste visual mode
vim.keymap.set('c', '<D-v>', '<C-R>+') -- Paste command mode
vim.keymap.set('i', '<D-v>', '<ESC>l"+Pli') -- Paste insert mode
end
vim.api.nvim_set_keymap("", '<D-v>', '+p<CR>', { noremap = true, silent = true})
vim.api.nvim_set_keymap('!', '<D-v>', '<C-R>+', { noremap = true, silent = true})
vim.api.nvim_set_keymap('t', '<D-v>', '<C-R>+', { noremap = true, silent = true})
vim.api.nvim_set_keymap('v', '<D-v>', '<C-R>+', { noremap = true, silent = true})
'';
_: {
vim = {
options = {
linebreak = true;
};
git = {
gitsigns.setupOpts = {
current_line_blame = true;
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "right_align";
delay = 25;
ignore_whitespace = true;
virt_text_priority = 100;
use_focus = true;
};
};
};
keymaps =
let
mkKeymap = mode: key: action: desc: {
inherit mode;
inherit key action desc;
};
n = mkKeymap "n"; # normal mode
in
[
# UI
(n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
# Find Files
(n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
(n "<leader>f" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
];
};
}

View file

@ -1,31 +1,45 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"vmd"
"nvme"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8eb0d6a2-b8cf-4ef2-ba2a-e25a5555b0bc";
fileSystems."/" = {
device = "/dev/disk/by-uuid/8eb0d6a2-b8cf-4ef2-ba2a-e25a5555b0bc";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3B51-4A1C";
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/3B51-4A1C";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/58ee9d19-292f-49b5-9979-341b42e8e09d"; }
swapDevices = [
{ device = "/dev/disk/by-uuid/58ee9d19-292f-49b5-9979-341b42e8e09d"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,21 +1,3 @@
{ ... }:
{
vim.languages.astro.enable = true;
vim.theme.extraConfig = ''
if vim.g.neovide then
vim.g.neovide_cursor_trail_size = 0.3
vim.g.neovide_scroll_animation_length = 0.1;
vim.keymap.set('n', '<D-s>', ':w<CR>') -- Save
vim.keymap.set('v', '<D-c>', '"+y') -- Copy
vim.keymap.set('n', '<D-v>', '"+P') -- Paste normal mode
vim.keymap.set('v', '<D-v>', '"+P') -- Paste visual mode
vim.keymap.set('c', '<D-v>', '<C-R>+') -- Paste command mode
vim.keymap.set('i', '<D-v>', '<ESC>l"+Pli') -- Paste insert mode
end
vim.api.nvim_set_keymap("", '<D-v>', '+p<CR>', { noremap = true, silent = true})
vim.api.nvim_set_keymap('!', '<D-v>', '<C-R>+', { noremap = true, silent = true})
vim.api.nvim_set_keymap('t', '<D-v>', '<C-R>+', { noremap = true, silent = true})
vim.api.nvim_set_keymap('v', '<D-v>', '<C-R>+', { noremap = true, silent = true})
'';
}

View file

@ -14,6 +14,7 @@
nerd-fonts.symbols-only
nerd-fonts.iosevka
inputs.apple-fonts.packages.${pkgs.system}.sf-pro
sketchybar-app-font
];
# configuration for shared modules.

View file

@ -9,6 +9,7 @@
# Include the results of the hardware scan.
./hardware-configuration.nix
];
documentation.man.generateCaches = false;
programs = {
gamemode.enable = true;
@ -83,8 +84,6 @@
hybrid-sleep.enable = false;
};
packages = [ pkgs.observatory ];
services.monitord.wantedBy = [ "multi-user.target" ];
};
@ -122,6 +121,11 @@
# Enable sound with pipewire.
security.rtkit.enable = true;
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
desktopManager.cosmic.xwayland.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
@ -147,7 +151,10 @@
];
};
environment = {
sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1;
sessionVariables = {
COSMIC_DATA_CONTROL_ENABLED = 1;
NIXOS_OZONE_WL = "1";
};
variables.EDITOR = "nvim";
systemPackages = with pkgs; [

View file

@ -8,6 +8,7 @@
...
}:
{
programs.mangohud.enable = true;
home = {
stateVersion = "23.05"; # Please read the comment before changing.
@ -29,6 +30,7 @@
wineWowPackages.stable
winetricks
(prismlauncher.override { gamemodeSupport = true; })
umu-launcher
#window manager stuff
wofi
@ -50,8 +52,8 @@
signal-desktop
inputs.zls.packages.x86_64-linux.zls
rust-bin.stable.latest.default
inputs.zen-browser.packages.x86_64-linux.default
];
# programs.mangohud.enable = true;
};
# xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop";

View file

@ -11,6 +11,7 @@
hyfetch.enable = true;
direnv.enable = true;
fish.enable = true;
man.generateCaches = false;
# sort-lines:end
};

View file

@ -2,7 +2,6 @@
{
environment.systemPackages = with pkgs; [
pinentry_mac
signal-desktop-bin
];
# Custom configuration modules in "modules" are shared between users,
@ -11,6 +10,8 @@
macAppStoreApps = [ "wireguard" ];
};
system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = 1.0;
# Create /etc/zshrc that loads the nix-darwin environment.
programs = {
gnupg.agent.enable = true;
@ -30,14 +31,6 @@
# Use homebrew to install casks
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
cleanup = "none";
upgrade = true;
};
brews = [
"imagemagick"
"opam"
@ -49,8 +42,11 @@
"alt-tab"
"legcord"
"zulip"
"zen-browser"
"zen"
"supertuxkart"
"sf-symbols"
"mediosz/tap/swipeaerospace"
];
};
}

View file

@ -15,5 +15,10 @@
sessionPath = [
"$HOME/.emacs.d/bin"
];
packages = with pkgs; [
#PDF viewer for VimTeX
skimpdf
];
};
}

View file

@ -24,6 +24,7 @@ with pkgs;
qemu
podman
docker
devenv
#productivity
glance
@ -63,15 +64,9 @@ with pkgs;
#media
spotify
zathura
#language servers
typst-live
lua-language-server
nil
nixd
texlab
texlivePackages.chktex
#formatters/linters
stylua
@ -80,22 +75,16 @@ with pkgs;
#neovim deps
# TODO: from clo, maybe u can remove all of these? i don't wanna break tho
lua51Packages.lua
lua51Packages.luarocks-nix
codespell
typst
tree-sitter
zathura
#python
pyright
basedpyright
ruff
python312Packages.python
python312Packages.pynvim
python312Packages.pip
#programming languages
R
deno
ruby
nodePackages.npm
@ -108,8 +97,7 @@ with pkgs;
firefox
#math
texlive.combined.scheme-full
zathura
# texlive.combined.scheme-full
#fun things
cowsay

View file

@ -3,11 +3,11 @@ rec {
name = "Natalie"; # name/identifier
email = "nmarks413@gmail.com"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
theme = "catppuccin-mocha"; # name of theme that stylix will use
theme = null; # name of theme that stylix will use
browser = "firefox"; # Default browser; must select one from ./user/app/browser/
term = "ghostty"; # Default terminal command;
font = "iosevka"; # Selected font
editor = "neovim"; # Default editor;
editor = "nvim"; # Default editor;
timeZone = "America/Los_Angeles";
sexuality = "bisexual";
}

View file

@ -1,9 +1,41 @@
{ ... }:
{ pkgs, ... }:
{
imports = [
./vim/default.nix
];
vim = {
#enable python provider
withPython3 = true;
python3Packages = [ "pynvim" ];
autocmds = [
#Autocommand to fall back to treesitter folding if LSP doesnt support it
{
event = [ "LspAttach" ];
callback = pkgs.lib.generators.mkLuaInline ''
function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client:supports_method('textDocument/foldingRange') then
local win = vim.api.nvim_get_current_win()
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
end
end
'';
}
];
tabline = {
nvimBufferline.enable = true;
};
startPlugins = [
"nui-nvim"
];
theme = {
name = "catppuccin";
style = "mocha";
};
hideSearchHighlight = true;
};
}

16
users/natalie/vim/coq.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
vim = {
# extraPackages = with pkgs; [
# coq_8_20
# coqPackages_8_20.stdlib
# ];
extraPlugins.Coqtail = {
# enabled = true;
package = pkgs.vimPlugins.Coqtail;
# lazy = true;
# ft = "coq";
};
};
}

View file

@ -0,0 +1,12 @@
{ ... }:
{
imports = [
./keybinds.nix
./languages.nix
./latex.nix
./lean.nix
./coq.nix
./visuals.nix
./mini.nix
];
}

View file

@ -0,0 +1,19 @@
{ ... }:
let
mkKeymap = mode: key: action: desc: {
inherit mode;
inherit key action desc;
};
n = mkKeymap "n"; # normal mode
in
{
vim = {
keymaps = [
(n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
# Snacks Picker Replaces Telescope!?
(n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
(n "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")
(n "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
];
};
}

View file

@ -0,0 +1,184 @@
{
flake,
user,
host,
pkgs,
...
}:
{
vim = {
extraPackages = with pkgs; [
python312Packages.pylatexenc
nixd
];
lsp = {
servers = {
nil = {
settings.nil.nix.flake = {
autoArchive = true;
autoEvalInputs = true;
};
};
nixd = {
settings.nixd = {
nixpkgs.expr = ''import "${flake.inputs.nixpkgs}" { }'';
options =
{
home-manager = {
expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; lib = import "${flake.inputs.home-manager}/modules/lib/stdlib-extended.nix" pkgs.lib; in (lib.evalModules { modules = (import "${flake.inputs.home-manager}/modules/modules.nix") { inherit lib pkgs;check = false;}; })).options'';
# (builtins.getFlake "${flakePath}").${darwin}Configurations.${hostname}.options.home-manager.users.type.getSubOptions [ ]'';
};
}
// pkgs.lib.optionalAttrs host.darwin {
nix-darwin = {
expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; in (pkgs.lib.evalModules { modules = (import "${flake.inputs.darwin}/modules/module-list.nix"); check = false;})).options'';
# (builtins.getFlake "${flakePath}").darwinConfigurations.${hostname}.options'';
};
}
// pkgs.lib.optionalAttrs host.linux {
nixos = {
expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; in (pkgs.lib.evalModules { modules = (import "${flake.inputs.nixpkgs}/nixos/modules/module-list.nix"); check = false;})).options'';
# (builtins.getFlake "${flakePath}").nixosConfigurations.${hostname}.options'';
};
};
};
};
};
};
languages = {
python.format.type = "ruff";
markdown = {
enable = true;
extensions.render-markdown-nvim = {
enable = true;
};
};
nix.format.enable = true;
};
formatter.conform-nvim = {
enable = true;
setupOpts = {
formatters_by_ft = {
fish = [ "fish_indent" ];
tex = [ "latexindent" ];
};
};
};
diagnostics = {
enable = true;
config = {
virtual_text = {
format = pkgs.lib.generators.mkLuaInline ''
function(diagnostic)
return string.format("%s (%s)", diagnostic.message, diagnostic.source)
end
'';
};
};
nvim-lint = {
enable = true;
linters_by_ft = {
nix = [ "statix" ];
tex = [ "chktex" ];
haskell = [ "hlint" ];
};
linters = {
chktex = {
ignore_exitcode = true;
};
};
};
};
treesitter = {
enable = true;
fold = true;
addDefaultGrammars = true;
highlight = {
additionalVimRegexHighlighting = true;
};
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
markdown_inline
markdown
];
highlight.enable = true;
indent.enable = false;
};
visuals = {
fidget-nvim = {
setupOpts = {
logger.level = "trace";
};
};
};
ui = {
nvim-ufo = {
enable = true;
};
};
autocomplete.blink-cmp = {
enable = true;
mappings = {
close = null;
complete = null;
confirm = null;
next = null;
previous = null;
scrollDocsDown = null;
scrollDocsUp = null;
};
setupOpts = {
keymap = {
preset = "super-tab";
};
completion = {
ghost_text.enabled = false;
list.selection.preselect = true;
trigger = {
show_in_snippet = true;
};
accept.auto_brackets.enabled = true;
};
signature = {
enabled = true;
};
};
};
lazy.plugins."blink.pairs" = {
enabled = true;
package = pkgs.vimPlugins.blink-pairs;
setupModule = "blink.pairs";
setupOpts = {
mappings = {
# -- you can call require("blink.pairs.mappings").enable() and require("blink.pairs.mappings").disable() to enable/disable mappings at runtime
enabled = true;
# -- see the defaults: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L10
pairs = [ ];
};
highlights = {
enabled = true;
groups = [
"BlinkPairsOrange"
"BlinkPairsPurple"
"BlinkPairsBlue"
];
matchparen = {
enabled = true;
group = "MatchParen";
};
};
debug = false;
};
};
};
}

115
users/natalie/vim/latex.nix Normal file
View file

@ -0,0 +1,115 @@
{ pkgs, host, ... }:
{
vim = {
lazy.plugins.cmp-vimtex = {
enabled = true;
package = pkgs.vimPlugins.cmp-vimtex;
lazy = false;
};
lazy.plugins.vimtex = {
enabled = true;
package = pkgs.vimPlugins.vimtex;
lazy = false;
};
globals = {
tex_flavor = "latex";
maplocalleader = "\\";
vimtex_compiler_method = "latexmk";
vimtex_view_method = if host.darwin then "skim" else "zathura";
vimtex_view_automatic = 1;
vimtex_compiler_latexmk = {
callback = 1;
continuous = 1;
executable = "latexmk";
hooks = [ ];
options = [
"-verbose"
"-file-line-error"
"-synctex=1"
"-interaction=nonstopmode"
"-shell-escape"
];
};
vimtex_log_ignore = [
"Underfull"
"Overfull"
"specifier changed to"
"Token not allowed in a PDF string"
];
vimtex_quickfix_ignore_filters = [
"Underfull"
"Overfull"
];
};
autocomplete.blink-cmp = {
sourcePlugins = {
"blink.compat" = {
enable = true;
package = "blink-compat";
module = "blink.compat.source";
};
};
setupOpts = {
sources = {
default = [ "vimtex" ];
providers = {
vimtex = {
name = "vimtex";
module = "blink.compat.source";
score_offset = 100;
};
};
};
};
};
augroups = [
{
name = "VimTeX Events";
}
];
autocmds = [
{
pattern = [ "VimtexEventViewReverse" ];
event = [ "User" ];
desc = "Return to nvim after reverse search";
command = "call b:vimtex.viewer.xdo_focus_vim()";
group = "VimTeX Events";
}
{
pattern = [ "VimtexEventQuit" ];
event = [ "User" ];
desc = "Close pdf after exiting nvim";
command = "VimtexClean";
group = "VimTeX Events";
}
{
pattern = [ "VimtexEventInitPost" ];
event = [ "User" ];
desc = "Start compiling when opening nvim to a tex file";
command = "VimtexCompile";
group = "VimTeX Events";
}
];
lsp = {
servers = {
texlab = {
enable = true;
cmd = [ "${pkgs.texlab}/bin/texlab" ];
filetypes = [ "tex" ];
};
};
};
treesitter = {
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
latex
];
};
};
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
vim = {
lazy.plugins."lean.nvim" = {
enabled = true;
package = pkgs.vimPlugins.lean-nvim;
lazy = true;
ft = "lean";
};
};
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
vim = {
mini = {
icons.enable = true;
ai.enable = true;
};
};
}

View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
vim = {
ui = {
noice = {
enable = true;
setupOpts = {
lsp = {
progress.enabled = false;
signature.enabled = true;
};
presets = {
lsp_doc_border = true;
long_message_to_split = true;
inc_rename = false;
command_palette = false;
bottom_search = true;
};
};
};
borders = {
enable = true;
};
};
};
}