Skip to content

Commit

Permalink
feat(kitty): reinit & fix miscellaneous issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Jun 8, 2024
1 parent 3833243 commit 1c44376
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 96 deletions.
8 changes: 4 additions & 4 deletions _sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"milspec": {
"cargoLocks": null,
"date": "2024-05-30",
"date": "2024-06-08",
"extract": null,
"name": "milspec",
"passthru": null,
Expand All @@ -33,11 +33,11 @@
"name": null,
"owner": "nekowinston",
"repo": "milspec.nvim",
"rev": "89b7d29dad6708c04821cbf8ba8c80294f8d1733",
"sha256": "sha256-GWto6Y+2ZJXgTbOApQrhzsBT9sPENhgqoD6SSxykAVE=",
"rev": "3988464c4514e441b4f81599507bdf2815b2f9e2",
"sha256": "sha256-2U8yqLqTnal0CAZOD8bWrv/bprl7Tusg1H5gnasbfVY=",
"type": "github"
},
"version": "89b7d29dad6708c04821cbf8ba8c80294f8d1733"
"version": "3988464c4514e441b4f81599507bdf2815b2f9e2"
},
"nekowinston-wezterm-bar": {
"cargoLocks": null,
Expand Down
8 changes: 4 additions & 4 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
};
milspec = {
pname = "milspec";
version = "89b7d29dad6708c04821cbf8ba8c80294f8d1733";
version = "3988464c4514e441b4f81599507bdf2815b2f9e2";
src = fetchFromGitHub {
owner = "nekowinston";
repo = "milspec.nvim";
rev = "89b7d29dad6708c04821cbf8ba8c80294f8d1733";
rev = "3988464c4514e441b4f81599507bdf2815b2f9e2";
fetchSubmodules = false;
sha256 = "sha256-GWto6Y+2ZJXgTbOApQrhzsBT9sPENhgqoD6SSxykAVE=";
sha256 = "sha256-2U8yqLqTnal0CAZOD8bWrv/bprl7Tusg1H5gnasbfVY=";
};
date = "2024-05-30";
date = "2024-06-08";
};
nekowinston-wezterm-bar = {
pname = "nekowinston-wezterm-bar";
Expand Down
4 changes: 2 additions & 2 deletions home/apps/colorscheme-sync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ in
let
queryCommand =
if isLinux then
"dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' | grep -q 'uint32 1'"
"dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' 2>/dev/null | grep -q 'uint32 1'"
else if isDarwin then
"defaults read -g AppleInterfaceStyle &>/dev/null"
else
Expand Down Expand Up @@ -66,7 +66,7 @@ in
};
};

xdg.configFile."fsh".source = "${milspec.src}/extras/zsh-fast-syntax-highlighting";
xdg.configFile.fsh.source = "${milspec.src}/extras/zsh-fast-syntax-highlighting";
programs.zsh.initExtra = ''
zadm_sync() {
local flavor="$(dark-mode-ternary mocha latte)"
Expand Down
2 changes: 1 addition & 1 deletion home/apps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
./colorscheme-sync.nix
./discord.nix
./fonts.nix
./foot.nix
./git.nix
./gnome.nix
./gpg.nix
./gtk.nix
./hyprland.nix
./kitty.nix
./kubernetes.nix
./mail.nix
./media.nix
Expand Down
57 changes: 0 additions & 57 deletions home/apps/foot.nix

This file was deleted.

5 changes: 1 addition & 4 deletions home/apps/gtk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ in
};

xdg = {
configFile."gtk-4.0/assets" = {
source = "${themeDir}/gtk-4.0/assets";
recursive = true;
};
configFile."gtk-4.0/assets".source = "${themeDir}/gtk-4.0/assets";
configFile."gtk-4.0/gtk.css".source = "${themeDir}/gtk-4.0/gtk.css";
configFile."gtk-4.0/gtk-dark.css".source = "${themeDir}/gtk-4.0/gtk-dark.css";
};
Expand Down
2 changes: 1 addition & 1 deletion home/apps/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
dwindle.preserve_split = true;
windowrulev2 = [ "suppressevent maximize, class:.*" ];
bind = [
"${modMove}, return, exec, foot"
"${modMove}, return, exec, kitty"
"${modMove}, q, killactive,"
"${modMove}, m, exit,"
"${modMove}, d, togglefloating,"
Expand Down
97 changes: 97 additions & 0 deletions home/apps/kitty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
config,
lib,
pkgs,
...
}:
let
milspec = (pkgs.callPackage ../../_sources/generated.nix { }).milspec;
in
{
programs.kitty = {
enable = true;
font = {
name = "Berkeley Mono";
size = 14;
};
settings = {
placement_strategy = "top-left";
inactive_text_alpha = "0.8";

active_tab_font_style = "bold";
inactive_tab_font_style = "normal";

tab_bar_align = "left";
tab_bar_edge = "bottom";
tab_bar_style = "powerline";
tab_bar_margin_width = "0.0";
tab_powerline_style = "slanted";
enabled_layouts = "splits, stack";

# always show tab bar
tab_bar_min_tabs = "1";

tab_title_template = "{index}: {title}{sup.num_windows if num_windows > 1 else ''}{activity_symbol}{bell_symbol}";
};

keybindings = {
# this emulates zooming panes
"ctrl+s>z" = "toggle_layout stack";

# create new panes
"ctrl+s>-" = "launch --location=hsplit --cwd=current";
"ctrl+s>\\" = "launch --location=vsplit --cwd=current";

# jump to other panes
"ctrl+s>h" = "neighboring_window left";
"ctrl+s>l" = "neighboring_window right";
"ctrl+s>k" = "neighboring_window up";
"ctrl+s>j" = "neighboring_window down";
"ctrl+s>q" = "focus_visible_window";

# move panes
"ctrl+s>ctrl+k" = "move_window up";
"ctrl+s>ctrl+h" = "move_window left";
"ctrl+s>ctrl+l" = "move_window right";
"ctrl+s>ctrl+j" = "move_window down";

# manipulate panes
"ctrl+s>ctrl+r" = "start_resizing_window";
"ctrl+s>r" = "layout_action rotate";
"ctrl+s>x" = "close_window";

# open ui panel to move the pane somewhere else
"ctrl+s>m" = "detach_window ask";

# show index for easier switching, show number of panes
"ctrl+s>c" = "new_tab";
"ctrl+s>n" = "next_tab";
"ctrl+s>p" = "previous_tab";
"ctrl+s>1" = "goto_tab 1";
"ctrl+s>2" = "goto_tab 2";
"ctrl+s>3" = "goto_tab 3";
"ctrl+s>4" = "goto_tab 4";
"ctrl+s>5" = "goto_tab 5";
"ctrl+s>6" = "goto_tab 6";
"ctrl+s>7" = "goto_tab 7";
"ctrl+s>8" = "goto_tab 8";
"ctrl+s>9" = "goto_tab 9";

"alt+enter" = "toggle_fullscreen";
};
extraConfig = ''
include themes.conf
'';
};

xdg.configFile."kitty/themes".source = "${milspec.src}/extras/kitty";

services.darkman = lib.mkIf config.services.darkman.enable {
lightModeScripts.kitty-theme = ''
${config.programs.kitty.package}/bin/kitty +kitten themes --config-file-name=themes.conf "milspec-light"
'';
darkModeScripts.kitty-theme = ''
${config.programs.kitty.package}/bin/kitty +kitten themes --config-file-name=themes.conf "milspec-dark"
'';
};
}
5 changes: 1 addition & 4 deletions home/apps/nu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,5 @@ in
+ mkCompletions completions;
};

xdg.configFile."nushell/config" = {
source = ./nu/config;
recursive = true;
};
xdg.configFile."nushell/config".source = ./nu/config;
}
8 changes: 5 additions & 3 deletions home/apps/nu/config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ $env.PROMPT_INDICATOR_VI_INSERT = ""
$env.PROMPT_INDICATOR_VI_NORMAL = ""
$env.PROMPT_MULTILINE_INDICATOR = ""
let in_supported_termprogram = ($env.TERM_PROGRAM? == "WezTerm") or ($env.TERM? == "xterm-kitty");
$env.config = {
show_banner: false
Expand Down Expand Up @@ -98,11 +100,11 @@ $env.config = {
# emacs, vi
edit_mode: vi
# enables terminal shell integration. Off by default, as some terminals have issues with this.
shell_integration: ($env.TERM_PROGRAM == "WezTerm")
shell_integration: $in_supported_termprogram,
# true or false to enable or disable right prompt to be rendered on last line of the prompt.
render_right_prompt_on_last_line: false
# enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this.
use_kitty_protocol: ($env.TERM_PROGRAM == "WezTerm")
use_kitty_protocol: $in_supported_termprogram,
# true enables highlighting of external commands in the repl resolved by which.
highlight_resolved_externals: false
# the maximum number of times nushell allows recursion before stopping it
Expand Down Expand Up @@ -167,7 +169,7 @@ $env.config = {
# str join
# str trim
# str split
correct_cursor_pos: false
correct_cursor_pos: true
}
style: {
text: green
Expand Down
10 changes: 2 additions & 8 deletions home/apps/vscode.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,12 @@ in
home.file = lib.mkIf isDarwin {
"Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON;
"Library/Application Support/Code/User/settings.json".source = settingsJSON;
"Library/Application Support/Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
"Library/Application Support/Code/User/snippets".source = snippetsDir;
};
xdg.configFile = lib.mkIf isLinux {
"Code/User/keybindings.json".source = keybindingsJSON;
"Code/User/settings.json".source = settingsJSON;
"Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
"Code/User/snippets".source = snippetsDir;
};
xdg.mimeApps.defaultApplications."text/plain" = "code.desktop";

Expand Down
5 changes: 1 addition & 4 deletions home/apps/wezterm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ in

xdg.configFile = {
"wezterm/wezterm.lua".source = mkSymlink "wezterm.lua";
"wezterm/config" = {
source = mkSymlink "config";
recursive = true;
};
"wezterm/config".source = mkSymlink "config";
"wezterm/bar".source = srcs.nekowinston-wezterm-bar.src;
"wezterm/milspec".source = srcs.milspec.src + "/extras/wezterm";
};
Expand Down
5 changes: 1 addition & 4 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ in
};

home.mac-wallpaper = ./wallpapers/dhm_1610.png;
xdg.configFile.sketchybar = {
recursive = true;
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/sketchybar";
};
xdg.configFile.sketchybar.source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/sketchybar";

programs = {
home-manager.enable = true;
Expand Down

0 comments on commit 1c44376

Please sign in to comment.