diff --git a/flake.lock b/flake.lock index a37055b..1df54d9 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "ai-robots-txt": { "flake": false, "locked": { - "lastModified": 1766279226, - "narHash": "sha256-O/W/gX7EazxzR+ghdxg4i6S0SHEUZoX1afB//HKUNgY=", + "lastModified": 1771349314, + "narHash": "sha256-HwRsZKQlK0t88Sz7VDQ5qZoufPTfYofZhBQ6EY3jVkg=", "owner": "ai-robots-txt", "repo": "ai.robots.txt", - "rev": "aa8519ec107d7cfa29b03005c9176708e1269965", + "rev": "243ec6b67d31909e4e3f9d9ee2f79266402c9222", "type": "github" }, "original": { @@ -57,11 +57,11 @@ ] }, "locked": { - "lastModified": 1769428758, - "narHash": "sha256-0G/GzF7lkWs/yl82bXuisSqPn6sf8YGTnbEdFOXvOfU=", + "lastModified": 1770895474, + "narHash": "sha256-JBcrq1Y0uw87VZdYsByVbv+GBuT6ECaCNb9txLX9UuU=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "def5e74c97370f15949a67c62e61f1459fcb0e15", + "rev": "a494d50d32b5567956b558437ceaa58a380712f7", "type": "github" }, "original": { @@ -357,11 +357,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1770245750, - "narHash": "sha256-hWGcDAhwloJK0MGvu9v1aIY3tUphAYMYkbc3whaCHTY=", + "lastModified": 1771583642, + "narHash": "sha256-mKVhOB/bChKUdaDu/RJCqaWXORrCiCeYPvmvQxhPSIE=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "e4f2be7badec7ede6128614daaa7a0ca8155d183", + "rev": "52991d23ad7ae88ec4eb6ece5c90fadc3d660335", "type": "github" }, "original": { @@ -373,11 +373,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1770252071, - "narHash": "sha256-d3ci+aTB1k5HyCTIoX/JmrhKgbXZVjE/aggVl6xYdFE=", + "lastModified": 1771577856, + "narHash": "sha256-B+tR08bn8+FJ/hk8BmGqV3tQvqftsm9MlhNRNgGFzfs=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "520f413dc530506af8e624f9cbbedbb3b5e01677", + "rev": "3c90b72f62f5930e7adadbd98c7873159dd09129", "type": "github" }, "original": { @@ -391,11 +391,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1768426687, - "narHash": "sha256-CopNx3j//gZ2mE0ggEK9dZ474UcbDhpTw+KMor8mSxI=", + "lastModified": 1771502235, + "narHash": "sha256-aH8h5ZOiyEGtHmEyuE/eFxx8TN7a+NGDnl4V+dbzJ6E=", "owner": "hyprwm", "repo": "contrib", - "rev": "541628cebe42792ddf5063c4abd6402c2f1bd68f", + "rev": "918f266dddae39fa4184a1b8bf51ec5381cf29f7", "type": "github" }, "original": { @@ -449,11 +449,11 @@ ] }, "locked": { - "lastModified": 1769284023, - "narHash": "sha256-xG34vwYJ79rA2wVC8KFuM8r36urJTG6/csXx7LiiSYU=", + "lastModified": 1770511807, + "narHash": "sha256-suKmSbSk34uPOJDTg/GbPrKEJutzK08vj0VoTvAFBCA=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "13c536659d46893596412d180449353a900a1d31", + "rev": "7c75487edd43a71b61adb01cae8326d277aab683", "type": "github" }, "original": { @@ -481,11 +481,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1769694617, - "narHash": "sha256-h8+Wqc4x68mN2qOLX45HsO6Z4eQOfrdtSKiSzcBrCVg=", + "lastModified": 1771522877, + "narHash": "sha256-uCi2y7Y0hgw81Vet26nLidq/xZZEpdlkWj8aZKItaMI=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "c92fb5e85f4a5fd3a0f5ffb5892f6a61cfe1be2b", + "rev": "9ea6d0e15fddccf321c035e83b007a55d6829dd9", "type": "github" }, "original": { @@ -557,11 +557,11 @@ ] }, "locked": { - "lastModified": 1769285097, - "narHash": "sha256-eVD4U3Oqzz0VU9ylJ5wo76xDcYKv2CpiiRXq4Is4QdA=", + "lastModified": 1770899531, + "narHash": "sha256-UBrWjh0DR8db60aLNkTnZTJ9F4kWK0Y7rUDNJC88W7A=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "06c0749a0dac978d89b1a76ae6adc76a3c15dbfa", + "rev": "e03c34ccd51280a44ea6d1f5c040cd81ecca25ed", "type": "github" }, "original": { @@ -688,11 +688,11 @@ ] }, "locked": { - "lastModified": 1766253372, - "narHash": "sha256-1+p4Kw8HdtMoFSmJtfdwjxM4bPxDK9yg27SlvUMpzWA=", + "lastModified": 1770139857, + "narHash": "sha256-bCqxcXjavgz5KBJ/1CBLqnagMMf9JvU1m9HmYVASKoc=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "51a4f93ce8572e7b12b7284eb9e6e8ebf16b4be9", + "rev": "9038eec033843c289b06b83557a381a2648d8fa5", "type": "github" }, "original": { @@ -713,11 +713,11 @@ ] }, "locked": { - "lastModified": 1763640274, - "narHash": "sha256-Uan1Nl9i4TF/kyFoHnTq1bd/rsWh4GAK/9/jDqLbY5A=", + "lastModified": 1770501770, + "narHash": "sha256-NWRM6+YxTRv+bT9yvlhhJ2iLae1B1pNH3mAL5wi2rlQ=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "f6cf414ca0e16a4d30198fd670ec86df3c89f671", + "rev": "0bd8b6cde9ec27d48aad9e5b4deefb3746909d40", "type": "github" }, "original": { @@ -742,11 +742,11 @@ ] }, "locked": { - "lastModified": 1769202094, - "narHash": "sha256-gdJr/vWWLRW85ucatSjoBULPB2dqBJd/53CZmQ9t91Q=", + "lastModified": 1770203293, + "narHash": "sha256-PR/KER+yiHabFC/h1Wjb+9fR2Uy0lWM3Qld7jPVaWkk=", "owner": "hyprwm", "repo": "hyprwire", - "rev": "a45ca05050d22629b3c7969a926d37870d7dd75c", + "rev": "37bc90eed02b0c8b5a77a0b00867baf3005cfb98", "type": "github" }, "original": { @@ -907,11 +907,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1769302137, - "narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=", + "lastModified": 1771423359, + "narHash": "sha256-yRKJ7gpVmXbX2ZcA8nFi6CMPkJXZGjie2unsiMzj3Ig=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8", + "rev": "740a22363033e9f1bb6270fbfb5a9574067af15b", "type": "github" }, "original": { @@ -969,11 +969,11 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1769268028, - "narHash": "sha256-mAdJpV0e5IGZjnE4f/8uf0E4hQR7ptRP00gnZKUOdMo=", + "lastModified": 1770843696, + "narHash": "sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ab9fbbcf4858bd6d40ba2bbec37ceb4ab6e1f562", + "rev": "2343bbb58f99267223bc2aac4fc9ea301a155a16", "type": "github" }, "original": { @@ -985,11 +985,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1769018530, - "narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "88d3861acdd3d2f0e361767018218e51810df8a1", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -1049,11 +1049,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1769598131, - "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", + "lastModified": 1771419570, + "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", + "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47", "type": "github" }, "original": { @@ -1097,11 +1097,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1769461804, - "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", + "rev": "0182a361324364ae3f436a63005877674cf45efb", "type": "github" }, "original": { @@ -1173,11 +1173,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1769768855, - "narHash": "sha256-OuUk+skANEQBNDKLiXvZOcdv2vfWsrbxvwNPSw0iKjE=", + "lastModified": 1771581385, + "narHash": "sha256-Yu5ehDh4rtd3Ow6VyXEEuQ40DzD14oe0R8kXFUtIGBs=", "owner": "nix-community", "repo": "NUR", - "rev": "cf3ece1c8c4108d7e5940ba7f1b01048407fff10", + "rev": "5bdc2edf13c2dbbbb7d4ce9228fc01cdb5254ed2", "type": "github" }, "original": { @@ -1213,7 +1213,7 @@ "oisd": { "flake": false, "locked": { - "narHash": "sha256-vW0GHUShUrTXa6qwEcJNhD/m5kbSlpzOIMj1/Kv77uk=", + "narHash": "sha256-j/o31zDLIhL7Kec6NAoyIMuO7Woh+2e/JzWMzqVuKpo=", "type": "file", "url": "https://big.oisd.nl/domainswild" }, @@ -1232,11 +1232,11 @@ ] }, "locked": { - "lastModified": 1769069492, - "narHash": "sha256-Efs3VUPelRduf3PpfPP2ovEB4CXT7vHf8W+xc49RL/U=", + "lastModified": 1770726378, + "narHash": "sha256-kck+vIbGOaM/dHea7aTBxdFYpeUl/jHOy5W3eyRvVx8=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "a1ef738813b15cf8ec759bdff5761b027e3e1d23", + "rev": "5eaaedde414f6eb1aea8b8525c466dc37bba95ae", "type": "github" }, "original": { @@ -1332,11 +1332,11 @@ "nixpkgs": "nixpkgs_10" }, "locked": { - "lastModified": 1769469829, - "narHash": "sha256-wFcr32ZqspCxk4+FvIxIL0AZktRs6DuF8oOsLt59YBU=", + "lastModified": 1771524872, + "narHash": "sha256-eksVUcUsfS9mQx4D9DrYu88u9w70bAf+n6KmTDuIGEE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c5eebd4eb2e3372fe12a8d70a248a6ee9dd02eff", + "rev": "e85540ffe97322dc1fea14dd11cdc2f59d540ac7", "type": "github" }, "original": { @@ -1351,11 +1351,11 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1769316930, - "narHash": "sha256-4EOGHYLpIscwr+6drHE28Qj7NDjjowp2Vd8QkXjdBBE=", + "lastModified": 1771268051, + "narHash": "sha256-nGqPcngnezoT+/xAvw3UDjwdKP2MC4fO315A/Otb9eE=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "b2ce438f386943ef611e196a178af2d79042903b", + "rev": "b930de84c561f62a0c39a6a57c2ab553a97e8495", "type": "github" }, "original": { diff --git a/hosts/azalea/default.nix b/hosts/azalea/default.nix index bf68387..59fc7b1 100644 --- a/hosts/azalea/default.nix +++ b/hosts/azalea/default.nix @@ -2,17 +2,12 @@ pkgs, inputs, self, + username, ... }: { imports = [ - # ./../../modules/core/homebrew.nix - ./../../modules/core/user.nix - # ./../../modules/core/skhd.nix - ./../../modules/core/yabai.nix - #./../../modules/core/virtualization.nix - #./../../modules/services/tailscale.nix - #./../../modules/services/mpd.nix + ./../../modules/core/default.azalea.nix ]; security.pam.services.sudo_local.touchIdAuth = true; @@ -30,12 +25,18 @@ }; finder = { AppleShowAllExtensions = true; - FXPreferredViewStyle = "clmv"; + FXEnableExtensionChangeWarning = false; + CreateDesktop = false; + FXPreferredViewStyle = "Nlsv"; # list view + # FXPreferredViewStyle = "clmv"; + ShowPathbar = true; }; + # "com.apple.finder".NewWindowTargetPath = "file:///Users/${username}/"; iCal."first day of week" = "Monday"; screencapture.include-date = true; screencapture.type = "png"; spaces.spans-displays = false; + loginwindow.GuestEnabled = false; }; }; nixpkgs.hostPlatform = "aarch64-darwin"; @@ -45,7 +46,7 @@ taps = [ "homebrew/homebrew-core" "homebrew/homebrew-cask" - # "FelixKratz/formulae" + "FelixKratz/homebrew-formulae" ]; onActivation = { autoUpdate = true; @@ -59,17 +60,29 @@ brews = [ "imagemagick" "virt-manager" - # "svim" + "svim" + "nowplaying-cli" + "switchaudio-osx" + "lua" ]; casks = [ + "vial" + "thunderbird" + "sf-symbols" + "font-sf-mono" + "font-sf-pro" + "darktable" "qbittorrent" "libreoffice" "signal" "ungoogled-chromium" + "keepingyouawake" + # "yubikey-agent" # "orca-slicer" "element" - "raycast" "anki" + "homerow" + "firefox" "kitty" "spotify" "nextcloud" @@ -83,8 +96,7 @@ "mullvad-vpn" "maccy" "spotmenu" - # "svim" - # "font-sketchybar-app-font" + "utm" ]; }; @@ -93,7 +105,7 @@ # imports = [ ../flake/modules/home/zsh.nix ]; environment.systemPackages = [ pkgs.vim - inputs.nixvim.packages.${pkgs.system}.default + inputs.nixvim.packages.${pkgs.stdenv.hostPlatform.system}.default pkgs.lazygit pkgs.eza pkgs.exiftool diff --git a/modules/core/default.azalea.nix b/modules/core/default.azalea.nix new file mode 100644 index 0000000..918fb4e --- /dev/null +++ b/modules/core/default.azalea.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = + # [ (import ./sshd.nix) ] + [ (import ./system.nix) ] ++ [ (import ./user.nix) ] ++ [ (import ./yabai.nix) ]; +} diff --git a/modules/core/i18n.nix b/modules/core/i18n.nix new file mode 100644 index 0000000..5bc69f8 --- /dev/null +++ b/modules/core/i18n.nix @@ -0,0 +1,7 @@ +{ + i18n.defaultLocale = "en_US.UTF-8"; + i18n.supportedLocales = [ + "en_US.UTF-8/UTF-8" + "ja_JP.UTF-8/UTF-8" + ]; +} diff --git a/modules/core/yabai.nix b/modules/core/yabai.nix index a8186df..4503d9f 100644 --- a/modules/core/yabai.nix +++ b/modules/core/yabai.nix @@ -16,11 +16,11 @@ window_opacity = "off"; window_border = "on"; window_border_placement = "inset"; - window_border_width = 2; + window_border_width = 8; window_border_radius = 3; window_shadow = "float"; active_window_opacity = "1.0"; - normal_window_opacity = "1.0"; + normal_window_opacity = "0.7"; mouse_modifier = "alt"; # set modifier + right-click drag to resize window (default: resize) @@ -28,14 +28,15 @@ # set modifier + left-click drag to resize window (default: move) mouse_action1 = "move"; - mouse_follows_focus = "off"; + mouse_follows_focus = "on"; focus_follows_mouse = "autofocus"; + mouse_drop_action = "swap"; # gaps - top_padding = 20; - bottom_padding = 8; - left_padding = 8; - right_padding = 8; + top_padding = 12; + bottom_padding = 12; + left_padding = 12; + right_padding = 12; window_gap = 16; }; @@ -71,8 +72,9 @@ action="sudo yabai --load-sa" sudo yabai --load-sa - # yabai -m config external_bar all:40:0 + yabai -m config external_bar all:34:0 exec ~/.config/borders/bordersrc & + spacebar & ''; }; diff --git a/modules/home/default.azalea.nix b/modules/home/default.azalea.nix index 5b01ee9..6bb4cce 100644 --- a/modules/home/default.azalea.nix +++ b/modules/home/default.azalea.nix @@ -13,6 +13,7 @@ ++ [ (import ./ssh.nix) ] ++ [ (import ./skhd.nix) ] ++ [ (import ./sketchybar/default.nix) ] + ++ [ (import ./spacebar.nix) ] ++ [ (import ./jankyborders.nix) ] ++ [ (import ./zsh.nix) ] ++ [ (import ./qutebrowser.nix) ] diff --git a/modules/home/packages.nix b/modules/home/packages.nix index 161c191..90ba585 100644 --- a/modules/home/packages.nix +++ b/modules/home/packages.nix @@ -10,7 +10,9 @@ gcc gnumake python3 - qbittorrent + # qbittorrent + mpv + qutebrowser # CLI shit imagemagick diff --git a/modules/home/sketchybar/default.nix b/modules/home/sketchybar/default.nix new file mode 100644 index 0000000..c1fd3bf --- /dev/null +++ b/modules/home/sketchybar/default.nix @@ -0,0 +1,49 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + sketchybar + sketchybar-app-font + lua + readline + switchaudio-osx + nowplaying-cli + # sf-symbols + # font-sf-mono + # font-sf-pro + ]; + home.file = { + ".config/sketchybar/sketchybarrc" = { + executable = true; + text = builtins.readFile ./sketchybarrc; + }; + # PLUGINS + ".config/sketchybar/plugins/battery.sh" = { + executable = true; + text = builtins.readFile ./plugins/battery.sh; + }; + ".config/sketchybar/plugins/clock.sh" = { + executable = true; + text = builtins.readFile ./plugins/clock.sh; + }; + ".config/sketchybar/plugins/front_app.sh" = { + executable = true; + text = builtins.readFile ./plugins/front_app.sh; + }; + ".config/sketchybar/plugins/memory.sh" = { + executable = true; + text = builtins.readFile ./plugins/memory.sh; + }; + ".config/sketchybar/plugins/nowplaying.sh" = { + executable = true; + text = builtins.readFile ./plugins/nowplaying.sh; + }; + ".config/sketchybar/plugins/space.sh" = { + executable = true; + text = builtins.readFile ./plugins/space.sh; + }; + ".config/sketchybar/plugins/volume.sh" = { + executable = true; + text = builtins.readFile ./plugins/volume.sh; + }; + }; +} diff --git a/modules/home/sketchybar/plugins/battery.sh b/modules/home/sketchybar/plugins/battery.sh new file mode 100755 index 0000000..c7b2490 --- /dev/null +++ b/modules/home/sketchybar/plugins/battery.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +PERCENTAGE="$(pmset -g batt | grep -Eo "...%" | awk '{print $1}')" +CHARGING="$(pmset -g batt | grep 'AC Power')" + +# The item invoking this script (name $NAME) will get its icon and label +# updated with the current battery status + +if [[ "$CHARGING" != "" ]]; then + STATE="CHAR:" +else + STATE="BATT:" +fi + +sketchybar --set "$NAME" label="$STATE $PERCENTAGE" diff --git a/modules/home/sketchybar/plugins/clock.sh b/modules/home/sketchybar/plugins/clock.sh new file mode 100755 index 0000000..043323a --- /dev/null +++ b/modules/home/sketchybar/plugins/clock.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# The $NAME variable is passed from sketchybar and holds the name of +# the item invoking this script: +# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + +sketchybar --set "$NAME" label="$(date '+%Z'): $(date '+%H:%M')" diff --git a/modules/home/sketchybar/plugins/front_app.sh b/modules/home/sketchybar/plugins/front_app.sh new file mode 100755 index 0000000..fb6d0b3 --- /dev/null +++ b/modules/home/sketchybar/plugins/front_app.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# 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 + +if [ "$SENDER" = "front_app_switched" ]; then + sketchybar --set "$NAME" label="$INFO" +fi diff --git a/modules/home/sketchybar/plugins/memory.sh b/modules/home/sketchybar/plugins/memory.sh new file mode 100755 index 0000000..0e10b13 --- /dev/null +++ b/modules/home/sketchybar/plugins/memory.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +hw_pagesize="$(sysctl -n hw.pagesize)" +mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))" +mem_total_gb="$(($(sysctl -n hw.memsize) / 1024 / 1024 / 1024))" +pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))" +pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')" +pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')" +pages_compressed="${pages_compressed:-0}" +mem_used="$(((${pages_app} + ${pages_wired//./} + ${pages_compressed//./}) * hw_pagesize / 1024 / 1024))" +mem_used_gb="$((${mem_used} / 1024))" + +sketchybar --set "$NAME" label="RAM: $mem_used_gb GiB/$mem_total_gb GiB" diff --git a/modules/home/sketchybar/plugins/nowplaying.sh b/modules/home/sketchybar/plugins/nowplaying.sh new file mode 100755 index 0000000..f4b2161 --- /dev/null +++ b/modules/home/sketchybar/plugins/nowplaying.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sketchybar --set "$NAME" label="$(nowplaying-cli get title) - $(nowplaying-cli get artist)" diff --git a/modules/home/sketchybar/plugins/space.sh b/modules/home/sketchybar/plugins/space.sh new file mode 100755 index 0000000..b8602b5 --- /dev/null +++ b/modules/home/sketchybar/plugins/space.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# The $SELECTED variable is available for space components and indicates if +# the space invoking this script (with name: $NAME) is currently selected: +# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item + +sketchybar --set "$NAME" background.drawing="$SELECTED" diff --git a/modules/home/sketchybar/plugins/volume.sh b/modules/home/sketchybar/plugins/volume.sh new file mode 100755 index 0000000..a9f414d --- /dev/null +++ b/modules/home/sketchybar/plugins/volume.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# The volume_change event supplies a $INFO variable in which the current volume +# percentage is passed to the script. + +if [ "$SENDER" = "volume_change" ]; then + VOLUME="$INFO" + + CURRENT="$(SwitchAudioSource -c)" + + #case "$VOLUME" in + #[6-9][0-9] | 100) + # ICON="󰕾" + # ;; + #[3-5][0-9]) + # ICON="󰖀" + # ;; + #[1-9] | [1-2][0-9]) + # ICON="󰕿" + # ;; + #*) ICON="󰖁" ;; + #esac + + # sketchybar --set "$NAME" icon="$ICON" label="$CURRENT: $VOLUME%" + sketchybar --set "$NAME" label="VOL: $CURRENT: $VOLUME%" +fi diff --git a/modules/home/sketchybar/sketchybarrc b/modules/home/sketchybar/sketchybarrc new file mode 100755 index 0000000..87f929a --- /dev/null +++ b/modules/home/sketchybar/sketchybarrc @@ -0,0 +1,96 @@ +# This is a demo config to showcase some of the most important commands. +# It is meant to be changed and configured, as it is intentionally kept sparse. +# For a (much) more advanced configuration example see my dotfiles: +# https://github.com/FelixKratz/dotfiles + +PLUGIN_DIR="$CONFIG_DIR/plugins" + +##### Bar Appearance ##### +# Configuring the general appearance of the bar. +# These are only some of the options available. For all options see: +# https://felixkratz.github.io/SketchyBar/config/bar +# If you are looking for other colors, see the color picker: +# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker + +sketchybar --bar position=top height=40 blur_radius=16 color=0x40000000 + +##### Changing Defaults ##### +# We now change some default values, which are applied to all further items. +# For a full list of all available item properties see: +# https://felixkratz.github.io/SketchyBar/config/items + +default=( + padding_left=5 + padding_right=5 + icon.font="scientifica:regular:12.0" + label.font="scientifica:regular:12.0" + icon.color=0xffffffff + label.color=0xffffffff + icon.padding_left=4 + icon.padding_right=4 + label.padding_left=4 + label.padding_right=4 +) +sketchybar --default "${default[@]}" + +##### Adding Mission Control Space Indicators ##### +# Let's add some mission control spaces: +# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item +# to indicate active and available mission control spaces. + +SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10") +for i in "${!SPACE_ICONS[@]}" +do + sid="$(($i+1))" + space=( + space="$sid" + icon="${SPACE_ICONS[i]}" + icon.padding_left=7 + icon.padding_right=7 + background.color=0x40ffffff + background.corner_radius=5 + background.height=25 + label.drawing=off + script="$PLUGIN_DIR/space.sh" + click_script="yabai -m space --focus $sid" + ) + sketchybar --add space space."$sid" left --set space."$sid" "${space[@]}" +done + +##### Adding Left Items ##### +# We add some regular items to the left side of the bar, where +# only the properties deviating from the current defaults need to be set + +sketchybar --add item nowplaying left \ + --set nowplaying update_freq=2 script="$PLUGIN_DIR/nowplaying.sh" \ + --add item chevron left \ + --set chevron icon='' label.drawing=off \ + --add item front_app left \ + --set front_app icon.drawing=off script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched + +##### Adding Right Items ##### +# In the same way as the left items we can add items to the right side. +# Additional position (e.g. center) are available, see: +# https://felixkratz.github.io/SketchyBar/config/items#adding-items-to-sketchybar + +# Some items refresh on a fixed cycle, e.g. the clock runs its script once +# every 10s. Other items respond to events they subscribe to, e.g. the +# volume.sh script is only executed once an actual change in system audio +# volume is registered. More info about the event system can be found here: +# https://felixkratz.github.io/SketchyBar/config/events + +sketchybar --add item clock right \ + --set clock update_freq=10 script="$PLUGIN_DIR/clock.sh" \ + --add item battery right \ + --set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \ + --subscribe battery system_woke power_source_change \ + --add item volume right \ + --set volume script="$PLUGIN_DIR/volume.sh" \ + --subscribe volume volume_change \ + --add item memory right \ + --set memory script="$PLUGIN_DIR/memory.sh" \ + --set memory update_freq=120 \ + +##### Force all scripts to run the first time (never do this in a script) ##### +sketchybar --update diff --git a/modules/home/skhd.nix b/modules/home/skhd.nix index 88579ce..5a34fa6 100644 --- a/modules/home/skhd.nix +++ b/modules/home/skhd.nix @@ -37,7 +37,9 @@ shift + alt - k : yabai -m window --warp north shift + alt - l : yabai -m window --warp east - alt + shift - r : skhd --reload; yabai --restart-service + alt + shift - r : launchctl kickstart -k "gui/$\{UID}/com.jackielii.skhd"; launchctl kickstart -k "gui/$\{UID}/org.nixos.yabai" + + alt - q : yabai -m window --close # Float / Unfloat window alt - space : yabai -m window --toggle float; yabai -m window --toggle border @@ -45,6 +47,7 @@ # cmd - d : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "stack" else "bsp" end') alt - return: open -a Kitty -n alt + shift - t : open -na Mail + alt - e : open -a Finder /Users/${username} alt + shift - c : open -na Chromium # open new instance alt + shift - e : open -a Element # move to existing instance diff --git a/modules/home/spacebar.nix b/modules/home/spacebar.nix new file mode 100755 index 0000000..2bd9e0a --- /dev/null +++ b/modules/home/spacebar.nix @@ -0,0 +1,40 @@ +{ pkgs, username, ... }: +{ + home.packages = with pkgs; [ + spacebar + ]; + + home.file.".config/spacebar/spacebarrc" = { + executable = true; + text = '' + #!/usr/bin/env sh + + spacebar -m config position top + spacebar -m config height 34 + spacebar -m config title on + spacebar -m config spaces on + spacebar -m config clock on + spacebar -m config power on + spacebar -m config padding_left 20 + spacebar -m config padding_right 20 + spacebar -m config spacing_left 25 + spacebar -m config spacing_right 15 + spacebar -m config text_font "scientifica:Regular:12.0" + spacebar -m config icon_font "scientifica:Regular:12.0" + spacebar -m config background_color 0xff202020 + spacebar -m config foreground_color 0xffa8a8a8 + spacebar -m config space_icon_color 0xffaaaaaa + spacebar -m config power_icon_color 0xffaaaaaa + spacebar -m config battery_icon_color 0xffaaaaaa + spacebar -m config dnd_icon_color 0xffaaaaaa + spacebar -m config clock_icon_color 0xffaaaaaa + spacebar -m config power_icon_strip "BATT: " "CHAR: " #   + spacebar -m config space_icon_strip 1 2 3 4 5 6 7 8 9 10 + spacebar -m config clock_icon "CLCK: " + spacebar -m config dnd_icon "DND" + spacebar -m config clock_format "%d/%m/%y %R" + + echo "spacebar configuration loaded.." + ''; + }; +} diff --git a/modules/home/tmux.nix b/modules/home/tmux.nix index b452b37..816ce11 100644 --- a/modules/home/tmux.nix +++ b/modules/home/tmux.nix @@ -1,4 +1,10 @@ -{ inputs, lib, config, pkgs, ... }: +{ + inputs, + lib, + config, + pkgs, + ... +}: { home.packages = with pkgs; [ tmux @@ -58,10 +64,9 @@ # Allow passthrough so that image.nvim works. set -gq allow-passthrough on - ''; + ''; plugins = with pkgs.tmuxPlugins; [ - yank - fzf-tmux-url + yank vim-tmux-navigator ]; }; diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix index 54f020d..dbde6ba 100644 --- a/modules/home/zsh.nix +++ b/modules/home/zsh.nix @@ -51,7 +51,7 @@ }; initContent = '' - export export PATH="''${PATH}:''${HOME}/.local/bin/:''${HOME}/.cargo/bin/:''${HOME}/.fzf/bin/" + export PATH="''${PATH}:''${HOME}/.local/bin/:''${HOME}/.cargo/bin/:''${HOME}/.fzf/bin/" autoload -U add-zsh-hook autoload -U compinit @@ -130,11 +130,11 @@ function cd() { if [ -f "$1" ]; then - ${pkgs.zoxide}/bin/zoxide "$(dirname "$1")" + z "$(dirname "$1")" return fi - ${pkgs.zoxide}/bin/zoxide $@ + z $@ } get-git-root() { @@ -253,7 +253,6 @@ ezit = "exit"; wlc = "wl-copy"; yt-dlp-audio = "yt-dlp -f 'ba' -x --audio-format mp3"; - open = "xdg-open"; tree = "eza --icons --tree --group-directories-first"; doas = "sudo"; sxiv = "nsxiv"; @@ -267,7 +266,6 @@ rm = "rm -i -v"; cat = "${lib.getExe pkgs.bat} --plain"; diff = "${lib.getExe pkgs.delta} --color-only"; - battery-left = "${lib.getExe pkgs.acpi} | cut -d' ' -f5"; github-actions = "${lib.getExe pkgs.act} -s GITHUB_TOKEN=\"$(${lib.getExe pkgs.github-cli} auth token)\""; tailscale = "sudo tailscale"; @@ -338,6 +336,7 @@ fd delta bat + # zoxide nix-search-fzf.zsh-shell-widget ]; }