authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-07 08:20:01-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-07 08:20:01-07:00
log474cf9441e765dd0c6c8f76b9d16c1d7b63a6442
tree0e1565d747e08d0845f2d60bf929a9e6581abebd
parentfbad532ae9e5541455ffb0829262a4859ff1165d
signature Commit is signed but in an unrecognized format.

sketchybar stuff


11 files changed, 200 insertions(+), 137 deletions(-)

.gitignore+2
......@@ -1 +1,3 @@
11flake.lock
2.DS_STORE
3**/.DS_STORE
files/sketchybar/executable_colors.sh created100644→100755
files/sketchybar/executable_icons.sh deleted-31
......@@ -1,31 +0,0 @@
1#!/usr/bin/env sh
2
3# General Icons
4LOADING=􀖇
5APPLE=􀣺
6PREFERENCES=􀺽
7ACTIVITY=􀒓
8LOCK=􀒳
9BELL=􀋚
10BELL_DOT=􀝗
11
12# Git Icons
13GIT_ISSUE=􀍷
14GIT_DISCUSSION=􀒤
15GIT_PULL_REQUEST=􀙡
16GIT_COMMIT=􀡚
17GIT_INDICATOR=􀂓
18
19# Spotify Icons
20SPOTIFY_BACK=􀊎
21SPOTIFY_PLAY_PAUSE=􀊈
22SPOTIFY_NEXT=􀊐
23SPOTIFY_SHUFFLE=􀊝
24SPOTIFY_REPEAT=􀊞
25
26# Yabai Icons
27YABAI_STACK=􀏭
28YABAI_FULLSCREEN_ZOOM=􀏜
29YABAI_PARENT_ZOOM=􀥃
30YABAI_FLOAT=􀢌
31YABAI_GRID=􀧍
files/sketchybar/icons.sh created+31
......@@ -0,0 +1,31 @@
1#!/usr/bin/env sh
2
3# General Icons
4LOADING=􀖇
5APPLE=􀣺
6PREFERENCES=􀺽
7ACTIVITY=􀒓
8LOCK=􀒳
9BELL=􀋚
10BELL_DOT=􀝗
11
12# Git Icons
13GIT_ISSUE=􀍷
14GIT_DISCUSSION=􀒤
15GIT_PULL_REQUEST=􀙡
16GIT_COMMIT=􀡚
17GIT_INDICATOR=􀂓
18
19# Spotify Icons
20SPOTIFY_BACK=􀊎
21SPOTIFY_PLAY_PAUSE=􀊈
22SPOTIFY_NEXT=􀊐
23SPOTIFY_SHUFFLE=􀊝
24SPOTIFY_REPEAT=􀊞
25
26# Yabai Icons
27YABAI_STACK=􀏭
28YABAI_FULLSCREEN_ZOOM=􀏜
29YABAI_PARENT_ZOOM=􀥃
30YABAI_FLOAT=􀢌
31YABAI_GRID=􀧍
files/sketchybar/plugins/executable_yabai.sh deleted-76
......@@ -1,76 +0,0 @@
1#!/bin/sh
2
3window_state() {
4 source "$HOME/.config/sketchybar/colors.sh"
5 source "$HOME/.config/sketchybar/icons.sh"
6
7 WINDOW=$(yabai -m query --windows --window)
8 CURRENT=$(echo "$WINDOW" | jq '.["stack-index"]')
9
10 args=()
11 if [[ $CURRENT -gt 0 ]]; then
12 LAST=$(yabai -m query --windows --window stack.last | jq '.["stack-index"]')
13 args+=(--set $NAME icon=$YABAI_STACK icon.color=$RED label.drawing=on label=$(printf "[%s/%s]" "$CURRENT" "$LAST"))
14 yabai -m config active_window_border_color $RED > /dev/null 2>&1 &
15
16 else
17 args+=(--set $NAME label.drawing=off)
18 case "$(echo "$WINDOW" | jq '.["is-floating"]')" in
19 "false")
20 if [ "$(echo "$WINDOW" | jq '.["has-fullscreen-zoom"]')" = "true" ]; then
21 args+=(--set $NAME icon=$YABAI_FULLSCREEN_ZOOM icon.color=$GREEN)
22 yabai -m config active_window_border_color $GREEN > /dev/null 2>&1 &
23 elif [ "$(echo "$WINDOW" | jq '.["has-parent-zoom"]')" = "true" ]; then
24 args+=(--set $NAME icon=$YABAI_PARENT_ZOOM icon.color=$BLUE)
25 yabai -m config active_window_border_color $BLUE > /dev/null 2>&1 &
26 else
27 args+=(--set $NAME icon=$YABAI_GRID icon.color=$ORANGE)
28 yabai -m config active_window_border_color $WHITE > /dev/null 2>&1 &
29 fi
30 ;;
31 "true")
32 args+=(--set $NAME icon=$YABAI_FLOAT icon.color=$MAGENTA)
33 yabai -m config active_window_border_color $MAGENTA > /dev/null 2>&1 &
34 ;;
35 esac
36 fi
37
38 sketchybar -m "${args[@]}"
39}
40
41windows_on_spaces () {
42 CURRENT_SPACES="$(yabai -m query --displays | jq -r '.[].spaces | @sh')"
43
44 args=()
45 while read -r line
46 do
47 for space in $line
48 do
49 icon_strip=" "
50 apps=$(yabai -m query --windows --space $space | jq -r ".[].app")
51 for app in $apps
52 do
53 icon_strip+=" $($HOME/.config/sketchybar/plugins/icon_map.sh "$app")"
54 done
55 args+=(--set space.$space label="$icon_strip" label.drawing=on)
56 done
57 done <<< "$CURRENT_SPACES"
58
59 sketchybar -m "${args[@]}"
60}
61
62mouse_clicked() {
63 yabai -m window --toggle float
64 update
65}
66
67case "$SENDER" in
68 "mouse.clicked") mouse_clicked
69 ;;
70 "forced") exit 0
71 ;;
72 "window_focus") window_state
73 ;;
74 "windows_on_spaces") windows_on_spaces
75 ;;
76esac
flake.lock+125
......@@ -1,5 +1,33 @@
11{
22 "nodes": {
3 "apple-fonts": {
4 "inputs": {
5 "nixpkgs": [
6 "nixpkgs"
7 ],
8 "ny": "ny",
9 "sf-arabic": "sf-arabic",
10 "sf-armenian": "sf-armenian",
11 "sf-compact": "sf-compact",
12 "sf-georgian": "sf-georgian",
13 "sf-hebrew": "sf-hebrew",
14 "sf-mono": "sf-mono",
15 "sf-pro": "sf-pro"
16 },
17 "locked": {
18 "lastModified": 1740961576,
19 "narHash": "sha256-9L6d3owtajM72YvUOpK1zYle2nM0BpsuopbF9lm9lJs=",
20 "owner": "Lyndeno",
21 "repo": "apple-fonts.nix",
22 "rev": "4df58996ed654f6ce9b71b41c1826484c6870739",
23 "type": "github"
24 },
25 "original": {
26 "owner": "Lyndeno",
27 "repo": "apple-fonts.nix",
28 "type": "github"
29 }
30 },
331 "base16": {
432 "inputs": {
533 "fromYaml": "fromYaml"
......@@ -805,8 +833,21 @@
805833 "type": "github"
806834 }
807835 },
836 "ny": {
837 "flake": false,
838 "locked": {
839 "narHash": "sha256-3257NAH4qlan2YHVLpNRy7x8IJqR2pal3OzFo/ykqXs=",
840 "type": "file",
841 "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
842 },
843 "original": {
844 "type": "file",
845 "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
846 }
847 },
808848 "root": {
809849 "inputs": {
850 "apple-fonts": "apple-fonts",
810851 "darwin": "darwin",
811852 "home-manager": "home-manager",
812853 "moonlight": "moonlight",
......@@ -864,6 +905,90 @@
864905 "type": "github"
865906 }
866907 },
908 "sf-arabic": {
909 "flake": false,
910 "locked": {
911 "narHash": "sha256-/0gjRimqvZyE60xYxxPdlU+7Q2LJnnvtbmwOP0YmS9U=",
912 "type": "file",
913 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
914 },
915 "original": {
916 "type": "file",
917 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
918 }
919 },
920 "sf-armenian": {
921 "flake": false,
922 "locked": {
923 "narHash": "sha256-rRoDkbNMYkzOHZmQm96Zv80TZvRlAeoxkv4pMHP5nUg=",
924 "type": "file",
925 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
926 },
927 "original": {
928 "type": "file",
929 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
930 }
931 },
932 "sf-compact": {
933 "flake": false,
934 "locked": {
935 "narHash": "sha256-J72Lyt2wy83E46wN8w6/Rih9kilM9wEjtY6KnbF0DsA=",
936 "type": "file",
937 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
938 },
939 "original": {
940 "type": "file",
941 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
942 }
943 },
944 "sf-georgian": {
945 "flake": false,
946 "locked": {
947 "narHash": "sha256-IevVNOC28IiR45YfI3PsZzXLMRxuB5u7UiE53Zn6tRU=",
948 "type": "file",
949 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
950 },
951 "original": {
952 "type": "file",
953 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
954 }
955 },
956 "sf-hebrew": {
957 "flake": false,
958 "locked": {
959 "narHash": "sha256-Dw84kYwMpCtKKKqm8cZcQ9TZ7GayU5MO7W0LJw0Rcwk=",
960 "type": "file",
961 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
962 },
963 "original": {
964 "type": "file",
965 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
966 }
967 },
968 "sf-mono": {
969 "flake": false,
970 "locked": {
971 "narHash": "sha256-ICdHRFdNL7PM/fXJUzS7LgZxZiqcyIuCMHLze4En4vg=",
972 "type": "file",
973 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg"
974 },
975 "original": {
976 "type": "file",
977 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg"
978 }
979 },
980 "sf-pro": {
981 "flake": false,
982 "locked": {
983 "narHash": "sha256-Q/pOQ4MGhW/ZtLka+UUQcwSoZFDWW34XvutxL4GvzUY=",
984 "type": "file",
985 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
986 },
987 "original": {
988 "type": "file",
989 "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
990 }
991 },
867992 "stylix": {
868993 "inputs": {
869994 "base16": "base16",
flake.nix+5
......@@ -13,6 +13,11 @@
1313 inputs.nixpkgs.follows = "nixpkgs";
1414 };
1515
16 apple-fonts = {
17 url = "github:Lyndeno/apple-fonts.nix";
18 inputs.nixpkgs.follows = "nixpkgs";
19 };
20
1621 nixvim = {
1722 url = "github:nix-community/nixvim";
1823 inputs.nixpkgs.follows = "nixpkgs";
modules/macos/homebrew.nix+1
......@@ -22,6 +22,7 @@ _: {
2222 "zulip"
2323 "zen-browser"
2424 "supertuxkart"
25 "sf-symbols"
2526
2627 "mediosz/tap/swipeaerospace"
2728 ];
modules/macos/tiling/aerospace.nix+4-1
......@@ -110,7 +110,10 @@
110110 up = "volume up";
111111 shift-down = ["volume set 0" "mode main"];
112112 };
113 after-startup-command = ["exec-and-forget sketchybar"];
113 after-startup-command = [
114 "exec-and-forget sketchybar"
115 "exec-and-forget open /Applications/SwipeAeroSpace.app"
116 ];
114117 exec-on-workspace-change = [
115118 "/bin/bash"
116119 "-c"
modules/macos/tiling/sketchybar-home.nix+30-29
......@@ -1,5 +1,11 @@
1{pkgs, ...}: let
2 folder = "../../../files/sketchybar/";
1{
2 pkgs,
3 config,
4 ...
5}: let
6 # folder = "${config.home.homeDirectory}.dotfiles/files/sketchybar";
7 # folder = "~/.dotfiles/files/sketchybar";
8 folder = ../../../files/sketchybar;
39in {
410 home.file = {
511 sketchybarrc = {
......@@ -27,16 +33,16 @@ in {
2733 # launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 &
2834
2935 # Setting up the general bar appearance and default values
30 ${pkgs.sketchybar}/bin/sketchybar --bar height=50 \
36 ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \
3137 color=$BAR_COLOR \
3238 shadow=off \
3339 position=top \
3440 sticky=on \
35 padding_right=7 \
36 padding_left=7 \
41 padding_right=0 \
42 padding_left=0 \
3743 corner_radius=12 \
38 y_offset=20 \
39 margin=40 \
44 y_offset=0 \
45 margin=2 \
4046 blur_radius=0 \
4147 notch_width=0 \
4248 --default updates=when_shown \
......@@ -83,7 +89,7 @@ in {
8389 icons = {
8490 executable = true;
8591 target = ".config/sketchybar/icons.sh";
86 text = builtins.readFile "${folder}/executable_icons.sh";
92 source = folder + /icons.sh;
8793 };
8894 colors = {
8995 executable = true;
......@@ -120,12 +126,12 @@ in {
120126 items_apple = {
121127 executable = true;
122128 target = ".config/sketchybar/items/apple.sh";
123 text = builtins.readFile "${folder}/items/executable_apple.sh";
129 source = folder + /items/executable_apple.sh;
124130 };
125131 items_brew = {
126132 executable = true;
127133 target = ".config/sketchybar/items/brew.sh";
128 text = builtins.readFile "${folder}/items/executable_brew.sh";
134 source = folder + /items/executable_brew.sh;
129135 };
130136 items_calendar = {
131137 executable = true;
......@@ -149,12 +155,12 @@ in {
149155 items_cpu = {
150156 executable = true;
151157 target = ".config/sketchybar/items/cpu.sh";
152 text = builtins.readFile "${folder}/items/executable_cpu.sh";
158 source = folder + /items/executable_cpu.sh;
153159 };
154160 items_divider = {
155161 executable = true;
156162 target = ".config/sketchybar/items/divider.sh";
157 text = builtins.readFile "${folder}/items/executable_divider.sh";
163 source = folder + /items/executable_divider.sh;
158164 };
159165 items_front_app = {
160166 executable = true;
......@@ -165,7 +171,7 @@ in {
165171 sketchybar --add event window_focus \
166172 --add event windows_on_spaces \
167173 --add item system.aerospace left \
168 --set system.aerospace script="$PLUGIN_DIR/yabai.sh" \
174 --set system.aerospace script="$PLUGIN_DIR/aerospace.sh" \
169175 icon.font="$FONT:Bold:16.0" \
170176 label.drawing=off \
171177 icon.width=30 \
......@@ -190,7 +196,7 @@ in {
190196 items_github = {
191197 executable = true;
192198 target = ".config/sketchybar/items/github.sh";
193 text = builtins.readFile "${folder}/items/executable_github.sh";
199 source = folder + /items/executable_github.sh;
194200 };
195201 items_spaces = {
196202 executable = true;
......@@ -216,7 +222,7 @@ in {
216222 background.drawing=on \
217223 script="$PLUGIN_DIR/aerospace.sh $sid" \
218224 click_script="aerospace workspace $sid" \
219 label.font="JetBrainsMono Nerd Font:Regular:16.0" \
225 label.font="Iosevka Nerd Font:Regular:16.0" \
220226 label.padding_right=33 \
221227 label.background.height=26 \
222228 label.background.drawing=on \
......@@ -225,7 +231,7 @@ in {
225231 done
226232 ${pkgs.sketchybar}/bin/sketchybar --add item separator left \
227233 --set separator icon= \
228 icon.font="JetBrainsMono Nerd Font:Regular:16.0" \
234 icon.font="Iosevka Nerd Font:Regular:16.0" \
229235 background.padding_left=26 \
230236 background.padding_right=15 \
231237 label.drawing=off \
......@@ -236,7 +242,7 @@ in {
236242 items_spotify = {
237243 executable = true;
238244 target = ".config/sketchybar/items/spotify.sh";
239 text = builtins.readFile "${folder}/items/executable_spotify.sh";
245 source = folder + /items/executable_spotify.sh;
240246 };
241247 items_volume = {
242248 executable = true;
......@@ -277,32 +283,32 @@ in {
277283 plugins_brew = {
278284 executable = true;
279285 target = ".config/sketchybar/plugins/brew.sh";
280 text = builtins.readFile "${folder}/plugins/executable_brew.sh";
286 source = folder + /plugins/executable_brew.sh;
281287 };
282288 plugins_calendar = {
283289 executable = true;
284290 target = ".config/sketchybar/plugins/calendar.sh";
285 text = builtins.readFile "${folder}/plugins/executable_calendar.sh";
291 source = folder + /plugins/executable_calendar.sh;
286292 };
287293 plugins_github = {
288294 executable = true;
289295 target = ".config/sketchybar/plugins/github.sh";
290 text = builtins.readFile "${folder}/plugins/executable_github.sh";
296 source = folder + /plugins/executable_github.sh;
291297 };
292298 plugins_icon_map = {
293299 executable = true;
294300 target = ".config/sketchybar/plugins/icon_map.sh";
295 text = builtins.readFile "${folder}/plugins/executable_icon_map.sh";
301 source = folder + /plugins/executable_icon_map.sh;
296302 };
297303 plugins_space = {
298304 executable = true;
299305 target = ".config/sketchybar/plugins/space.sh";
300 text = builtins.readFile "${folder}/plugins/executable_space.sh";
306 source = folder + /plugins/executable_space.sh;
301307 };
302308 plugins_spotify = {
303309 executable = true;
304310 target = ".config/sketchybar/plugins/spotify.sh";
305 text = builtins.readFile "${folder}/plugins/executable_spotify.sh";
311 source = folder + /plugins/executable_spotify.sh;
306312 };
307313 plugins_volume = {
308314 executable = true;
......@@ -347,15 +353,10 @@ in {
347353 fi
348354 '';
349355 };
350 plugins_yabai = {
351 executable = true;
352 target = ".config/sketchybar/plugins/yabai.sh";
353 text = builtins.readFile "${folder}/plugins/executable_yabai.sh";
354 };
355356 plugins_zen = {
356357 executable = true;
357358 target = ".config/sketchybar/plugins/zen.sh";
358 text = builtins.readFile "${folder}/plugins/executable_zen.sh";
359 source = folder + /plugins/executable_zen.sh;
359360 };
360361 plugins_aerospace = {
361362 executable = true;
modules/shared/extras.nix+2
......@@ -1,4 +1,5 @@
11{
2 inputs,
23 pkgs,
34 userSettings,
45 ...
......@@ -13,6 +14,7 @@
1314 iosevka
1415 nerd-fonts.symbols-only
1516 nerd-fonts.iosevka
17 inputs.apple-fonts.packages.${pkgs.system}.sf-pro
1618 ];
1719
1820 # Set your time zone.