From 1b424c6a03d89506098822c75d5e4486600c81b3 Mon Sep 17 00:00:00 2001 From: Nicolas Simon Date: Sun, 3 Dec 2023 17:57:35 +0100 Subject: [PATCH] Add spacebar --- home/zsh/default.nix | 6 +++++ macos/components/spacebar.nix | 42 +++++++++++++++++++++++++++++++++++ macos/components/yabai.nix | 2 +- macos/configuration.nix | 10 ++++++--- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 macos/components/spacebar.nix diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 2d6a0fb..9ef3865 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -26,5 +26,11 @@ # Will load the whole folder and source nsimon.plugin.zsh: { name = "nsimon"; src = ../dotfiles/zsh; } ]; + + initExtra = '' + if [[ $(uname -m) == 'arm64' ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + fi + ''; }; } \ No newline at end of file diff --git a/macos/components/spacebar.nix b/macos/components/spacebar.nix new file mode 100644 index 0000000..f298e1e --- /dev/null +++ b/macos/components/spacebar.nix @@ -0,0 +1,42 @@ +{ pkgs, ... }: +{ + enable = true; + package = pkgs.spacebar; + config = { + debug_output = "on"; + position = "top"; + display = "main"; + height = 26; + title = "on"; + spaces = "on"; + clock = "on"; + power = "on"; + padding_left = 20; + padding_right = 20; + spacing_left = 25; + spacing_right = 15; + text_font = ''"Menlo:Regular:12.0"''; + icon_font = ''"Font Awesome 5 Free:Solid:12.0"''; + background_color = "0xff202020"; + foreground_color = "0xffa8a8a8"; + power_icon_color = "0xffcd950c"; + battery_icon_color = "0xffd75f5f"; + dnd_icon_color = "0xffa8a8a8"; + clock_icon_color = "0xffa8a8a8"; + power_icon_strip = " "; + space_icon = "•"; + space_icon_strip = "1 2 3 4 5 6 7 8 9 10"; + spaces_for_all_displays = "on"; + display_separator = "on"; + display_separator_icon = ""; + space_icon_color = "0xff458588"; + space_icon_color_secondary = "0xff78c4d4"; + space_icon_color_tertiary = "0xfffff9b0"; + clock_icon = ""; + dnd_icon = ""; + clock_format = ''"%d/%m/%y %R"''; + right_shell = "on"; + right_shell_icon = ""; + right_shell_command = "whoami"; + }; +} \ No newline at end of file diff --git a/macos/components/yabai.nix b/macos/components/yabai.nix index f938700..6073199 100644 --- a/macos/components/yabai.nix +++ b/macos/components/yabai.nix @@ -36,7 +36,7 @@ #left_padding = 10; #right_padding = 10; #window_gap = 10; - #external_bar = "all:0:0"; + external_bar = "all:26:0"; }; extraConfig = '' yabai -m config --space 3 layout bsp diff --git a/macos/configuration.nix b/macos/configuration.nix index ba57843..4e5840f 100644 --- a/macos/configuration.nix +++ b/macos/configuration.nix @@ -20,6 +20,9 @@ security.pam.enableSudoTouchIdAuth = true; + # Silence the 'last login' shell message + #home-manager.users.${username}.home.file.".hushlogin".text = ""; + services.activate-system.enable = true; services.skhd = { @@ -27,10 +30,11 @@ skhdConfig = builtins.readFile ../home/dotfiles/skhdrc; }; - # Silence the 'last login' shell message - #home-manager.users.${username}.home.file.".hushlogin".text = ""; - system = import ./components/system.nix { inherit pkgs; }; homebrew = import ./components/homebrew.nix { inherit pkgs; }; services.yabai = import ./components/yabai.nix { inherit pkgs; }; + services.spacebar = import ./components/spacebar.nix { inherit pkgs; }; + + launchd.user.agents.spacebar.serviceConfig.StandardErrorPath = "/tmp/spacebar.err.log"; + launchd.user.agents.spacebar.serviceConfig.StandardOutPath = "/tmp/spacebar.out.log"; }