From c1e274ab1c64805a6ba98faaa86afedfdd536cf9 Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Mon, 17 Feb 2025 12:54:48 -0500 Subject: [PATCH] Change primary display don't need sketchybar --- dot_config/aerospace/aerospace.toml | 2 +- dot_config/flake/machines/hinge/home.nix | 13 ++++ .../flake/machines/hinge/sketchybar.nix | 12 +-- dot_config/flake/pkgs/sbarlua/default.nix | 75 ++++++------------- dot_config/sketchybar/executable_sketchybarrc | 5 -- dot_config/sketchybar/helpers/init.lua | 1 - 6 files changed, 44 insertions(+), 64 deletions(-) delete mode 100755 dot_config/sketchybar/executable_sketchybarrc diff --git a/dot_config/aerospace/aerospace.toml b/dot_config/aerospace/aerospace.toml index 56b326e..e66101b 100644 --- a/dot_config/aerospace/aerospace.toml +++ b/dot_config/aerospace/aerospace.toml @@ -57,7 +57,7 @@ inner.horizontal = 4 inner.vertical = 4 outer.left = 0 outer.bottom = 0 -outer.top = 30 +outer.top = 0 outer.right = 0 # 'main' binding mode declaration diff --git a/dot_config/flake/machines/hinge/home.nix b/dot_config/flake/machines/hinge/home.nix index d335bd0..926519c 100644 --- a/dot_config/flake/machines/hinge/home.nix +++ b/dot_config/flake/machines/hinge/home.nix @@ -40,6 +40,19 @@ file.".gnupg/gpg-agent.conf".text = '' pinentry-program ${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac ''; + + file.".config/sketchybar/sketchybarrc" = { + executable = true; + text = '' + #!/usr/bin/env lua + + package.cpath = package.cpath .. ";${pkgs.sbarlua}/lib/lua/5.4/sketchybar.so" + + -- Load the sketchybar-package and prepare the helper binaries + require("helpers") + require("init") + ''; + }; }; programs.home-manager.enable = true; diff --git a/dot_config/flake/machines/hinge/sketchybar.nix b/dot_config/flake/machines/hinge/sketchybar.nix index 7d864af..75c9815 100644 --- a/dot_config/flake/machines/hinge/sketchybar.nix +++ b/dot_config/flake/machines/hinge/sketchybar.nix @@ -1,6 +1,8 @@ -{...}: { - # services.sketchybar = { - # enable = true; - # extraPackages = []; - # }; +{pkgs, ...}: { + services.sketchybar = { + # enable = true; + extraPackages = with pkgs; [ + sbarlua + ]; + }; } diff --git a/dot_config/flake/pkgs/sbarlua/default.nix b/dot_config/flake/pkgs/sbarlua/default.nix index bf1b4df..8ef76ea 100644 --- a/dot_config/flake/pkgs/sbarlua/default.nix +++ b/dot_config/flake/pkgs/sbarlua/default.nix @@ -1,62 +1,33 @@ { - lib, stdenv, + clang, fetchFromGitHub, gcc, - lua, - nix-update-script, - apple-sdk_15, - versionCheckHook, + readline, + lua5_4, }: let - inherit (stdenv.hostPlatform) system; - - target = - { - "aarch64-darwin" = "arm64"; - "x86_64-darwin" = "x86"; - } - .${system} - or (throw "Unsupported system: ${system}"); + lua = lua5_4; in - stdenv.mkDerivation ( - finalAttrs: { - pname = "SBarLua"; - version = "437bd2031da38ccda75827cb7548e7baa4aa9978"; - src = fetchFromGitHub { - repo = "SbarLua"; - owner = "FelixKratz"; - rev = "437bd2031da38ccda75827cb7548e7baa4aa9978"; - hash = "sha256-F0UfNxHM389GhiPQ6/GFbeKQq5EvpiqQdvyf7ygzkPg="; - }; + stdenv.mkDerivation { + pname = "SBarLua"; + version = "unstable-2024-02-28"; - nativeBuildInputs = [ - gcc - ]; + src = fetchFromGitHub { + owner = "FelixKratz"; + repo = "SbarLua"; + rev = "437bd2031da38ccda75827cb7548e7baa4aa9978"; + hash = "sha256-F0UfNxHM389GhiPQ6/GFbeKQq5EvpiqQdvyf7ygzkPg="; + }; - buildInputs = [ - apple-sdk_15 - lua - ]; + nativeBuildInputs = [ + clang + gcc + ]; - # buildPhase = '' - # make - # ''; + buildInputs = [readline]; - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - - ls -la - - cp ./bin/sbarlua $out/bin/sbarlua - - runHook postInstall - ''; - - meta = { - homepage = "https://github.com/FelixKratz/SbarLua"; - platforms = lib.platforms.darwin; - }; - } - ) + installPhase = '' + mkdir -p $out/lib/lua/${lua.luaversion}/ + cp -r bin/* "$out/lib/lua/${lua.luaversion}/" + ''; + } diff --git a/dot_config/sketchybar/executable_sketchybarrc b/dot_config/sketchybar/executable_sketchybarrc deleted file mode 100755 index 95ece11..0000000 --- a/dot_config/sketchybar/executable_sketchybarrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env lua - --- Load the sketchybar-package and prepare the helper binaries -require("helpers") -require("init") diff --git a/dot_config/sketchybar/helpers/init.lua b/dot_config/sketchybar/helpers/init.lua index 351531a..62c24a0 100644 --- a/dot_config/sketchybar/helpers/init.lua +++ b/dot_config/sketchybar/helpers/init.lua @@ -1,4 +1,3 @@ -- Add the sketchybar module to the package cpath -package.cpath = package.cpath .. ";/Users/" .. os.getenv("USER") .. "/.local/share/sketchybar_lua/?.so" os.execute("(cd helpers && make)")