updated tiling options to not push changes to non-users

This commit is contained in:
Natalie 2025-05-07 13:21:11 -07:00
parent 91c676f3f5
commit 3bd8fa4e7a
No known key found for this signature in database
GPG key ID: 61F4EAEB0C9C3D5F
7 changed files with 431 additions and 552 deletions

View file

@ -38,6 +38,11 @@
hostHomePath = hostDir + "/home.nix";
userHomePath = userDir + "/home.nix";
pathOrNull = a:
if pathExists a
then a
else null;
# Arguments passed to all module files
args = {
inherit inputs;
@ -94,15 +99,11 @@ in
)
# The user-wide configuration.nix
(
if pathExists userConfigPath
then userConfigPath
else null
)
(pathOrNull userConfigPath)
# The host-wide configuration.nix
(
if host != null && pathExists hostConfigPath
then hostConfigPath
if host != null
then pathOrNull hostConfigPath
else null
)
@ -127,15 +128,15 @@ in
// {
mainHomeImports = builtins.filter (f: f != null) [
(
if pathExists userHomePath
then userHomePath
else null
pathOrNull userHomePath
)
(
if host != null && pathExists hostHomePath
then hostHomePath
if host != null
then pathOrNull hostHomePath
else null
)
#Can't have conditional import path
../modules/macos/tiling/sketchybar-home.nix
];
};
# can't find how to make this an array without the param

View file

@ -1,4 +1,8 @@
{config,pkgs, ...}: {
{
config,
pkgs,
...
}: {
services.aerospace = {
enable = config.shared.darwin.tiling.enable;
settings = {
@ -60,34 +64,34 @@
alt-equal = "resize smart +50";
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
cmd-1 = "workspace 1";
cmd-2 = "workspace 2";
cmd-3 = "workspace 3";
cmd-4 = "workspace 4";
cmd-5 = "workspace 5";
cmd-6 = "workspace 6";
cmd-7 = "workspace 7";
cmd-8 = "workspace 8";
cmd-9 = "workspace 9";
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-7 = "workspace 7";
alt-8 = "workspace 8";
alt-9 = "workspace 9";
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
cmd-shift-1 = "move-node-to-workspace 1";
cmd-shift-2 = "move-node-to-workspace 2";
cmd-shift-3 = "move-node-to-workspace 3";
cmd-shift-4 = "move-node-to-workspace 4";
cmd-shift-5 = "move-node-to-workspace 5";
cmd-shift-6 = "move-node-to-workspace 6";
cmd-shift-7 = "move-node-to-workspace 7";
cmd-shift-8 = "move-node-to-workspace 8";
cmd-shift-9 = "move-node-to-workspace 9";
alt-shift-1 = "move-node-to-workspace 1";
alt-shift-2 = "move-node-to-workspace 2";
alt-shift-3 = "move-node-to-workspace 3";
alt-shift-4 = "move-node-to-workspace 4";
alt-shift-5 = "move-node-to-workspace 5";
alt-shift-6 = "move-node-to-workspace 6";
alt-shift-7 = "move-node-to-workspace 7";
alt-shift-8 = "move-node-to-workspace 8";
alt-shift-9 = "move-node-to-workspace 9";
cmd-h = []; # Disable "hide application"
cmd-alt-h = []; # Disable "hide others"
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = "workspace-back-and-forth";
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
# # See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
# alt-tab = "workspace-back-and-forth";
# # See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
# alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = "mode service";
@ -112,7 +116,7 @@
};
after-startup-command = [
"exec-and-forget sketchybar"
"exec-and-forget open /Applications/SwipeAeroSpace.app"
# "exec open /Applications/SwipeAeroSpace.app"
];
exec-on-workspace-change = [
"/bin/bash"
@ -124,8 +128,11 @@
#Ghostty currently renders tabs as individual processes
#Fix comes from https://ghostty.org/docs/help/macos-tiling-wms
{
"if".app-id = "com.mitchellh.ghostty";
"if" = {
app-id = "com.mitchellh.ghostty";
};
run = ["layout tiling"];
check-further-callbacks = true;
}
];
};

View file

@ -1,5 +1,6 @@
{
pkgs,
lib,
config,
...
}: let
@ -7,7 +8,10 @@
# folder = "~/.dotfiles/files/sketchybar";
folder = ../../../files/sketchybar;
in {
home.file = {
home.file =
lib.attrsets.mapAttrs (file: value: (
lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;}
)) {
sketchybarrc = {
executable = true;
target = ".config/sketchybar/sketchybarrc";

View file

@ -1,150 +1,10 @@
{config,pkgs, ...}: {
{
config,
pkgs,
...
}: {
services.sketchybar = {
enable = config.shared.darwin.tiling.enable;
config = ''
# 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=30 color=0x04313244
# Colours
SURFACE=0xff313244
##### 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="Hack Nerd Font:Bold:17.0"
label.font="Hack Nerd Font:Bold:14.0"
icon.color=0xffcdd6f4
label.color=0xffcdd6f4
icon.padding_left=8
icon.padding_right=4
label.padding_left=4
label.padding_right=8
background.padding_left=2
background.padding_right=2
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
background.border_width=1 \
)
sketchybar --default "$\{default[@]}"
sketchybar --add event aerospace_workspace_change
for sid in $(aerospace list-workspaces --all); do
sketchybar --add item space.$sid left \
--subscribe space.$sid aerospace_workspace_change \
--set space.$sid \
background.border_width=1 \
background.border_color=0xffb4befe \
background.corner_radius=5 \
background.height=20 \
icon.padding_left=0 \
icon.padding_right=0 \
label.padding_right=6 \
label="$sid" \
click_script="aerospace workspace $sid" \
script="$CONFIG_DIR/plugins/aerospace.sh $sid"
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 chevron left \
--set chevron icon= label.drawing=off background.drawing=off \
icon.color=0xfff5e0dc \
--add item front_app left \
--set front_app icon.drawing=off script="$PLUGIN_DIR/front_app.sh" \
label.color=0xff94e2d5 \
label.padding_left=8 \
background.border_color=0xff94e2d5 \
--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 icon=󰃰 script="$PLUGIN_DIR/clock.sh" \
icon.color=0xfffab387 \
label.color=0xffcdd6f4 \
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
--add item volume right \
--set volume script="$PLUGIN_DIR/volume.sh" \
label.color=0xffcdd6f4 \
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
--subscribe volume volume_change \
--add item battery right \
--set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \
label.color=0xffcdd6f4 \
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
--subscribe battery system_woke power_source_change
sketchybar -m --add item mullvad right \
--set mullvad icon= \
icon.color=0xfff38ba8 \
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
background.border_width=1 \
background.border_color=0xfff38ba8 \
label.padding_left=0 \
label.padding_right=0 \
icon.padding_left=6 \
update_freq=5 \
script="$PLUGIN_DIR/mullvad.sh"
# Add event
sketchybar -m --add event song_update com.apple.iTunes.playerInfo
# Add Music Item
sketchybar -m --add item music right \
--set music script="$PLUGIN_DIR/music.sh" \
click_script="$PLUGIN_DIR/music_click.sh" \
label.padding_right=10 \
label.color=0xffcdd6f4 \
background.color=$SURFACE \
background.corner_radius=10 \
background.height=30 \
background.border_width=1 \
background.border_color=0xfff38ba8 \
drawing=off \
--subscribe music song_update
##### Force all scripts to run the first time (never do this in a script) #####
sketchybar --update
'';
package = pkgs.sketchybar;
};
}

View file

@ -1,5 +1,10 @@
# Applied to all systems
{pkgs, ...}: {
{
inputs,
pkgs,
host,
...
}: {
services.tailscale.enable = true;
fonts.packages = with pkgs; [
nerd-fonts.fira-code
@ -7,11 +12,12 @@
iosevka
nerd-fonts.symbols-only
nerd-fonts.iosevka
inputs.apple-fonts.packages.${pkgs.system}.sf-pro
];
# configuration for shared modules.
# all custom options in 'shared' for clarity.
shared.darwin = {
tiling.enable = true; # use tiling window manager
tiling.enable = host.darwin; # use tiling window manager
};
}

View file

@ -9,6 +9,7 @@
bat.enable = true;
hyfetch.enable = true;
direnv.enable = true;
fish.enable = true;
# sort-lines:end
};