Skip to content

Commit

Permalink
feat: kitty
Browse files Browse the repository at this point in the history
feat: kitty
  • Loading branch information
yqrashawn committed Dec 26, 2024
1 parent 95b2e0a commit c19c4f9
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 2 deletions.
6 changes: 6 additions & 0 deletions modules/yqrashawn/darwin/preferences.nix
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ in {
echo 'link ~/.config/zed'
ln -s ~/.nixpkgs/modules/yqrashawn/home-manager/dotfiles/zed ~/.config/zed
fi
if [ ! -e ~/.config/kitty/kitty.conf ]; then
echo 'link ~/.config/kitty/kitty.conf'
ln -s ~/.nixpkgs/modules/yqrashawn/home-manager/dotfiles/kitty.conf ~/.config/kitty/kitty.conf
ln -s ~/.nixpkgs/modules/yqrashawn/home-manager/dotfiles/kitty-map.conf ~/.config/kitty/kitty-map.conf
ln -s ~/.nixpkgs/modules/yqrashawn/home-manager/dotfiles/macos-launch-services-cmdline ~/.config/kitty/macos-launch-services-cmdline
fi
'';
};
};
Expand Down
1 change: 1 addition & 0 deletions modules/yqrashawn/etc-zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let
paths = [
"$HOME/Library/CloudStorage/Dropbox/sync/scripts"
"$HOME/common-lisp/lem"
"/Applications/kitty.app/Contents/MacOS"
"/Applications/Firefox Developer Edition.app/Contents/MacOS"
"$HOME/.qlot/bin"
"$HOME/.web3j"
Expand Down
14 changes: 13 additions & 1 deletion modules/yqrashawn/home-manager/dotfiles/karabiner.edn
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
;; "PATH=/run/current-system/sw/bin:/opt/homebrew/bin:/usr/local/bin:$PATH hs -A -n -q -t 0.1 -c 'hs.application.launchOrFocus(\"%s\")'"
:hsl
"/opt/homebrew/bin/hs -A -n -q -t 0.01 -c 'hs.application.launchOrFocus(\"%s\")'"
:kitten "/Applications/kitty.app/Contents/MacOS/kitten @ --to unix:/tmp/tkitty %s"
:kitten-focus-window "/Applications/kitty.app/Contents/MacOS/kitten @ --to unix:/tmp/tkitty focus-window --match %s"
:show
"osascript -e 'set appName to \"%s\"\nset startIt to false\ntell application \"System Events\"\n if not (exists process appName) then\n set startIt to true\n else\n set frontmost of process appName to true\n end if\nend tell\nif startIt then\n tell application appName to activate\nend if'\n"
:show-in-firefox
Expand Down Expand Up @@ -433,7 +435,8 @@
[:##close_bracket :!SOdown_arrow]]}
{:des "launcher mode"
:rules [:launch-mode
[:j [:op "/Applications/kitty.app"]]
;; [:j [:op "/Applications/kitty.app"]]
[:j [:sh "open -a kitty --args -o allow_remote_control=yes --single-instance"]]
;; [:j [:op "/Applications/Rio.app"]]
;; [:k :same_wind_app :Emacs]
[:k [:hsl "/Applications/Emacs.app"]]
Expand Down Expand Up @@ -605,6 +608,15 @@
[:p :!CSopen_bracket]
[:n :!CSclose_bracket]
[:s :!Creturn_or_enter]
[:v [:kitten "launch --location=vsplit"]]
;; [:h [:kitten-focus-window "neighbor:left"]]
;; [:j [:kitten-focus-window "neighbor:bottom"]]
;; [:k [:kitten-focus-window "neighbor:top"]]
;; [:l [:kitten-focus-window "neighbor:right"]]
[:h :!CSleft_arrow]
[:j :!CSdown_arrow]
[:k :!CSup_arrow]
[:l :!CSright_arrow]
:tmux-windresize-mode
[:h [:!Tq :!Sh]] ; resize window
[:j [:!Tq :!Sj]] ; resize window
Expand Down
4 changes: 4 additions & 0 deletions modules/yqrashawn/home-manager/dotfiles/kitty-map.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
map cmd+shift+left neighboring_window left
map cmd+shift+right neighboring_window right
map cmd+shift+up neighboring_window up
map cmd+shift+down neighboring_window down
51 changes: 51 additions & 0 deletions modules/yqrashawn/home-manager/dotfiles/kitty.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated by Home Manager.
# See https://sw.kovidgoyal.net/kitty/conf.html
font_family PragmataPro Mono Liga Regular
italic_font PragmataPro Mono Liga Italic
bold_font PragmataPro Mono Liga Bold
bold_italic_font PragmataPro Mono Liga Bold Italic

font_size 20.0

disable_ligatures cursor

font_features PragmataProMonoLiga +calt
font_features PragmataProMonoLiga-Bold +calt
font_features PragmataProMonoLiga-Italic +ss06 +calt
font_features PragmataProMonoLiga-BoldItalic +ss07 +calt

# modify_font underline_thickness 400%
# modify_font underline_position 2

scrollback_lines 10000

shell_integration enabled

copy_on_select yes
enable_audio_bell no
input_delay 0
macos_option_as_alt yes
macos_show_window_title_in all
macos_traditional_fullscreen yes
macos_titlebar_color background
repaint_delay 10
strip_trailing_spaces smart
sync_to_monitor no
tab_bar_edge bottom
# term xterm-256color
term xterm-kitty
visual_bell_duration 0.0
window_alert_on_bell no
paste_actions quote-urls-at-prompt,confirm-if-large



# Send a notification when a command takes more than 10 seconds in a invisible window
notify_on_cmd_finish invisible 10.0
# allow_remote_control yes
# listen_on unix:/tmp/kitty

enabled_layouts splits:split_axis=vertical,stack

include current-theme.conf
include kitty-map.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--single-instance -o allow_remote_control=yes --listen-on unix:/tmp/tkitty
2 changes: 1 addition & 1 deletion modules/yqrashawn/home-manager/kitty/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, pkgs, ... }: {
programs.kitty = {
enable = true;
enable = false;
# package = pkgs.kitty;
package = pkgs.stable.kitty;
font = {
Expand Down

0 comments on commit c19c4f9

Please sign in to comment.