Skip to content

Commit

Permalink
feat: jankyborders
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed May 31, 2024
1 parent 67260c7 commit 3e9bcb5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
31 changes: 13 additions & 18 deletions home/apps/sketchybar/plugins/colordummy.nu
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,27 @@ def color [name: string, alpha: float = 1.0] {
(sketchybar
--bar
$"color=(color bg)"
border_color=(color rose)
--default
$"icon.color=(color rose)"
$"label.color=(color rose)"
$"icon.color=(color fg)"
$"label.color=(color fg)"
--set /space/
$"icon.color=(color violet 0.5)"
$"icon.highlight_color=(color rose)"
--set window_title
$"icon.color=(color rose)"
$"label.color=(color gray)"
$"icon.color=(color gray 0.5)"
$"icon.highlight_color=(color blue)"
--set music
$"icon.color=(color rose)"
$"label.color=(color rose)"
$"icon.color=(color violet)"
$"label.color=(color violet)"
--set "Mullvad VPN"
$"alias.color=(color orange)"
--set "Control Centre,Battery"
$"alias.color=(color gold)"
--set "Little Snitch Agent"
$"alias.color=(color green)"
--set "iStat Menus Status"
$"alias.color=(color blue)"
--set clock
$"icon.color=(color violet)"
$"label.color=(color violet)")

# set the yabai colors as well
# yabai -m config active_window_border_color "$(color pink)"
# yabai -m config normal_window_border_color "$(color surface0)"
# yabai -m config insert_feedback_color "$(color red)"
# set the jankyborders colors as well
if ((which borders).type? == "external") {
(borders
$"active_color=(colors rose)"
$"inactive_color=(colors gray)"
width=5.0)
}
4 changes: 2 additions & 2 deletions home/apps/sketchybar/plugins/window_title.nu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env nu

let icon = match ($env | get -i INFO) {
let icon = match ($env.INFO?) {
# IDEs
"CLion" | "GoLand" | "PhpStorm" | "PyCharm" | RustRover | "WebStorm" | "Xcode" => "",
"Neovide" => "",
Expand Down Expand Up @@ -53,6 +53,6 @@ let icon = match ($env | get -i INFO) {
}

(sketchybar
--set $env.NAME $"label=($env | get -i INFO | default '')" $"icon=($icon)"
--set $env.NAME $"label=($env.INFO? | default '')" $"icon=($icon)"
icon.font="Symbols Nerd Font:2048-em:18.0"
label.font="Berkeley Mono:Bold:16.0" y_offset="3")
10 changes: 2 additions & 8 deletions home/apps/sketchybar/sketchybarrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let pluginDir = $env.HOME | path join ".config/sketchybar/plugins"
padding_right=5
margin=5
corner_radius=10
border_width=2
border_width=0
hidden=off
topmost=off
y_offset=2)
Expand Down Expand Up @@ -61,12 +61,6 @@ for $el in ["Ⅰ" "Ⅱ" "Ⅲ" "Ⅳ" "Ⅴ" "Ⅵ" "Ⅶ" "Ⅷ" "Ⅸ" "Ⅹ"] --numbe
sketchybar -m --add event music_changed com.apple.Music.playerInfo

(sketchybar
--add item window_title left
--set window_title
$"script=($pluginDir)/window_title.nu"
label.y_offset=-1
icon.y_offset=-1
--subscribe window_title front_app_switched
--add item music left
--set music
$"script=($pluginDir)/music.nu"
Expand All @@ -83,7 +77,7 @@ sketchybar -m --add event music_changed com.apple.Music.playerInfo
--add alias "Little Snitch Agent" right
icon.padding_left=0
icon.padding_right=0
--add alias "Control Centre,Battery" right
--add alias "Control Center,Battery" right
icon.padding_left=0
icon.padding_right=0
--add alias "Mullvad VPN" right
Expand Down
19 changes: 17 additions & 2 deletions machines/common/darwin/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
imports = [ ./options.nix ];
# manipulate the global /etc/zshenv for PATH, etc.
Expand Down Expand Up @@ -26,7 +31,7 @@
config = {
layout = "bsp";

window_gap = 5;
window_gap = 7;
left_padding = 5;
right_padding = 5;
top_padding = 5;
Expand All @@ -42,6 +47,8 @@
mouse_drop_action = "swap";
mouse_follows_focus = "off";
focus_follows_mouse = "off";

external_bar = "all:32:0";
};
extraConfig =
let
Expand Down Expand Up @@ -141,4 +148,12 @@
'';
};
};

environment.systemPackages = [ pkgs.jankyborders ];
launchd.user.agents.jankyborders.serviceConfig = {
ProgramArguments = [ "${pkgs.jankyborders}/bin/borders" ];
KeepAlive = true;
RunAtLoad = true;
EnvironmentVariables.PATH = "${pkgs.jankyborders}/bin:${config.environment.systemPath}";
};
}

0 comments on commit 3e9bcb5

Please sign in to comment.