[SUMIREKO] Make sumireko bearable.

This commit is contained in:
Kat Inskip 2023-02-20 14:24:36 -08:00
parent 2be79777a5
commit d2d403fef8
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
20 changed files with 359 additions and 67 deletions

13
darwin/common/overlay.nix Normal file
View file

@ -0,0 +1,13 @@
{
inputs,
pkgs,
tree,
system,
...
}: {
nixpkgs = {
overlays = [
inputs.spacebar.overlay.${system}
];
};
}

87
darwin/wm/skhd.nix Normal file
View file

@ -0,0 +1,87 @@
{std, ...}: let
inherit (std) string list;
in {
services.skhd = {
enable = true;
skhdConfig = let
bindWorkspace = key: workspace: ''
alt - ${key} : yabai -m space --focus ${workspace}
shift + alt - ${key} : yabai -m window --space ${workspace}
'';
workspaceBindings = string.concat (list.map (v: bindWorkspace v "${v}") (list.map builtins.toString (list.range 1 9))
++ [
(
bindWorkspace "0" "10"
)
]
++ list.imap (i: v: bindWorkspace v "${toString (10 + i + 1)}") (list.map (n: "f${builtins.toString n}") (std.list.range 1 12)));
in
workspaceBindings
+ ''
# focus windows - ESDF
alt - s : yabai -m window --focus west
alt - d : yabai -m window --focus south
alt - e : yabai -m window --focus north
alt - f : yabai -m window --focus east
# focus windows - arrows
alt - left : yabai -m window --focus west
alt - down : yabai -m window --focus south
alt - up : yabai -m window --focus north
alt - right : yabai -m window --focus east
# move windows - ESDF
shift + alt - s : yabai -m window --swap west
shift + alt - d : yabai -m window --swap south
shift + alt - e : yabai -m window --swap north
shift + alt - f : yabai -m window --swap east
# move windows - arrows
shift + alt - left : yabai -m window --swap west
shift + alt - down : yabai -m window --swap south
shift + alt - up : yabai -m window --swap north
shift + alt - right : yabai -m window --swap east
# warp windows - ESDF
ctrl + alt - s : yabai -m window --warp west
ctrl + alt - d : yabai -m window --warp south
ctrl + alt - e : yabai -m window --warp north
ctrl + alt - f : yabai -m window --warp east
# warp windows - arrows
ctrl + alt - left : yabai -m window --warp west
ctrl + alt - down : yabai -m window --warp south
ctrl + alt - up : yabai -m window --warp north
ctrl + alt - right : yabai -m window --warp east
# process management - q
# unused base -> spotlight exists (cmd+space)
alt + shift - q : yabai -m window --close
alt + ctrl - q : wezterm
# workspace prev/next - w
alt - w : yabai -m space --focus prev
alt + shift - w : yabai -m space --focus next
alt + ctrl - w : yabai -m window --display next
ctrl + shift - w : yabai -m window --display prev
# split managent - a
alt - a : yabai -m window --toggle split
# resizing, reloading - r
alt - r : yabai -m space --balance
# layout handling (spaces) - t
alt - t : yabai -m space -- layout stack
alt + shift - t : yabai -m space -- layout bsp
alt + ctrl - t : yabai -m space -- layout float
# layout handling (windows) - p
alt - p : yabai -m window --toggle float
alt + shift - p : yabai -m window --toggle stack
# workspace history switching - tab
alt + ctrl - tab: yabai -m space --focus recent
'';
};
}

35
darwin/wm/spacebar.nix Normal file
View file

@ -0,0 +1,35 @@
{pkgs, ...}: {
services.spacebar = {
enable = true;
package = pkgs.spacebar;
config = {
# bar characteristics
position = "top";
display = "main";
height = "26";
# modules
spaces = "on";
space_icon_strip = " 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22";
spaces_for_all_displays = "on";
title = "off";
clock = "on";
clock_icon = "";
clock_format = ''"%F %R %Z"'';
power = "on";
dnd = "on";
dnd_icon = "";
power_icon_strip = " ";
# display
padding_left = 20;
padding_right = 20;
spacing_left = 15;
spacing_right = 15;
# text
text_font = ''"Iosevka:Regular:12.0"'';
icon_font = ''"Font Awesome 6 Free:Solid:12.0"'';
};
};
}

50
darwin/wm/yabai.nix Normal file
View file

@ -0,0 +1,50 @@
_: {
services.yabai = {
enable = true;
enableScriptingAddition = true;
config = {
# layout
layout = "bsp";
window_origin_display = "focused";
split_ratio = "0.50";
mouse_modifier = "alt";
mouse_action1 = "move";
mouse_action2 = "resize";
mouse_drop_action = "stack";
external_bar = "main:26:0";
# window border
window_border = "on";
window_border_width = 3;
window_border_hidpi = "on";
# focus
focus_follows_mouse = "autoraise";
mouse_follows_focus = "off";
# window
window_placement = "second_child";
window_border_blur = "on";
# paddings
top_padding = 10;
bottom_padding = 10;
left_padding = 10;
right_padding = 10;
window_gap = 10;
};
extraConfig = ''
# rules
yabai -m rule --add app='System Preferences' manage=off
yabai -m rule --add app='Yubico Authenticator' manage=off
yabai -m rule --add app='YubiKey Manager' manage=off
yabai -m rule --add app='YubiKey Personalization Tool' manage=off
# signals
yabai -m signal --add event=window_focused action="sketchybar --trigger window_focus"
yabai -m signal --add event=window_created action="sketchybar --trigger windows_on_spaces"
yabai -m signal --add event=window_destroyed action="sketchybar --trigger windows_on_spaces"
'';
};
}