ghostty: Finish module

This commit is contained in:
Erwin Boskma 2024-12-15 16:03:09 +01:00
parent 9376cd32dc
commit 1f3925415d
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg
4 changed files with 173 additions and 75 deletions

View file

@ -16,7 +16,7 @@ in
settings = lib.mkOption {
description = "Ghostty config.";
type = lib.types.submodule {
freeformType = iniFormat.type;
freeformType = lib.types.attrsOf iniFormat.lib.types.atom;
};
default = { };
};

View file

@ -27,6 +27,11 @@ in
description = "Wallpaper to use for the lockscreen";
type = types.path;
};
terminal = mkOption {
description = "Default terminal to run";
type = types.str;
default = lib.getExe pkgs.foot;
};
output = mkOption {
description = "An attribute set that defines output modules. See the sway-output(5) manpage for options";
type = types.attrsOf (types.attrsOf types.str);
@ -241,11 +246,15 @@ in
"${mod}+Pause" = "mode passthrough";
"${mod}+c" = mkIf config.eboskma.programs.emacs.enable "exec ${config.programs.emacs.package}/bin/emacsclient -c";
"${mod}+c" =
mkIf config.eboskma.programs.emacs.enable "exec ${config.programs.emacs.package}/bin/emacsclient -c";
"${mod}+Print" = "exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name')";
"${mod}+Shift+Print" = ''exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Shift+Ctrl+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Print" =
"exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name')";
"${mod}+Shift+Print" =
''exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Shift+Ctrl+Print" =
''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Shift+Alt+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"'';
"XF86AudioRaiseVolume" = "exec ${pkgs.pamedia}/bin/pamedia up";
@ -263,7 +272,8 @@ in
};
};
terminal = "${pkgs.foot}/bin/foot";
# terminal = "${pkgs.foot}/bin/foot";
terminal = cfg.terminal;
window = {
border = 1;

View file

@ -70,6 +70,88 @@ in
enable = true;
server = false;
};
ghostty = {
enable = true;
settings = {
font-family = "Iosevka NF";
font-size = 12;
theme = "catppuccin-mocha";
background-opacity = 0.9;
keybind = [
"ctrl+comma=open_config"
"ctrl+shift+comma=reload_config"
"ctrl+shift+q=quit"
"ctrl+enter=toggle_fullscreen"
"ctrl+shift+v=paste_from_clipboard"
"shift+insert=paste_from_selection"
"ctrl+shift+a=select_all"
"shift+up=adjust_selection:up"
"shift+right=adjust_selection:right"
"shift+down=adjust_selection:down"
"shift+left=adjust_selection:left"
"alt+one=goto_tab:1"
"alt+two=goto_tab:2"
"alt+three=goto_tab:3"
"alt+four=goto_tab:4"
"alt+five=goto_tab:5"
"alt+six=goto_tab:6"
"alt+seven=goto_tab:7"
"alt+eight=goto_tab:8"
"alt+nine=goto_tab:9"
"ctrl+minus=decrease_font_size:1"
"ctrl+equal=increase_font_size:1"
"ctrl+plus=increase_font_size:1"
"ctrl+zero=reset_font_size"
"ctrl+shift+n=new_window"
"ctrl+shift+t=new_tab"
"ctrl+shift+o=new_split:right"
"ctrl+shift+e=new_split:down"
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+tab=previous_tab"
"ctrl+shift+left=previous_tab"
"ctrl+page_up=previous_tab"
"ctrl+tab=next_tab"
"ctrl+page_down=next_tab"
"ctrl+shift+right=next_tab"
"super+ctrl+right_bracket=goto_split:next"
"super+ctrl+left_bracket=goto_split:previous"
"ctrl+alt+up=goto_split:top"
"ctrl+alt+right=goto_split:right"
"ctrl+alt+down=goto_split:bottom"
"ctrl+alt+left=goto_split:left"
"super+ctrl+shift+up=resize_split:up,10"
"super+ctrl+shift+right=resize_split:right,10"
"super+ctrl+shift+down=resize_split:down,10"
"super+ctrl+shift+left=resize_split:left,10"
"super+ctrl+shift+equal=equalize_splits"
"ctrl+shift+page_down=jump_to_prompt:1"
"ctrl+shift+page_up=jump_to_prompt:-1"
"ctrl+alt+shift+j=write_scrollback_file:open"
"ctrl+shift+w=close_surface"
"shift+page_up=scroll_page_up"
"shift+home=scroll_to_top"
"shift+end=scroll_to_bottom"
"shift+page_down=scroll_page_down"
"ctrl+shift+j=write_scrollback_file:paste"
"alt+f4=close_window"
"ctrl+shift+enter=toggle_split_zoom"
"ctrl+shift+i=inspector:toggle"
];
window-decoration = false;
gtk-single-instance = true;
};
};
git = {
enable = true;
name = "Erwin Boskma";
@ -143,6 +225,7 @@ in
sway = {
enable = true;
package = pkgs.swayfx;
terminal = lib.getExe pkgs.ghostty;
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png";
output = {
"DP-2" = {
@ -231,7 +314,6 @@ in
fd
ffmpeg-full
geekbench
inputs.ghostty.packages.${pkgs.system}.ghostty
godot_4
hashcat
helvum
@ -345,9 +427,12 @@ in
};
configFile = {
"gtk-4.0/assets".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk-dark.css";
"gtk-4.0/assets".source =
"${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source =
"${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source =
"${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk-dark.css";
};
};

View file

@ -71,81 +71,83 @@ in
ghostty = {
enable = true;
settings = {
# font-family = "Iosevka NF";
# font-size = 16;
# theme = "catppuccin-mocha";
# background-opacity = 0.9;
# keybind = [
# "ctrl+comma=open_config"
# "ctrl+shift+comma=reload_config"
# "ctrl+shift+q=quit"
# "ctrl+enter=toggle_fullscreen"
font-family = "Iosevka NF";
font-size = 16;
theme = "catppuccin-mocha";
background-opacity = 0.9;
keybind = [
"ctrl+comma=open_config"
"ctrl+shift+comma=reload_config"
"ctrl+shift+q=quit"
"ctrl+enter=toggle_fullscreen"
# "ctrl+shift+v=paste_from_clipboard"
# "shift+insert=paste_from_selection"
# "ctrl+shift+a=select_all"
# "shift+up=adjust_selection:up"
# "shift+right=adjust_selection:right"
# "shift+down=adjust_selection:down"
# "shift+left=adjust_selection:left"
"ctrl+shift+v=paste_from_clipboard"
"shift+insert=paste_from_selection"
"ctrl+shift+a=select_all"
"shift+up=adjust_selection:up"
"shift+right=adjust_selection:right"
"shift+down=adjust_selection:down"
"shift+left=adjust_selection:left"
# "alt+one=goto_tab:1"
# "alt+two=goto_tab:2"
# "alt+three=goto_tab:3"
# "alt+four=goto_tab:4"
# "alt+five=goto_tab:5"
# "alt+six=goto_tab:6"
# "alt+seven=goto_tab:7"
# "alt+eight=goto_tab:8"
# "alt+nine=goto_tab:9"
"alt+one=goto_tab:1"
"alt+two=goto_tab:2"
"alt+three=goto_tab:3"
"alt+four=goto_tab:4"
"alt+five=goto_tab:5"
"alt+six=goto_tab:6"
"alt+seven=goto_tab:7"
"alt+eight=goto_tab:8"
"alt+nine=goto_tab:9"
# "ctrl+minus=decrease_font_size:1"
# "ctrl+equal=increase_font_size:1"
# "ctrl+plus=increase_font_size:1"
# "ctrl+zero=reset_font_size"
"ctrl+minus=decrease_font_size:1"
"ctrl+equal=increase_font_size:1"
"ctrl+plus=increase_font_size:1"
"ctrl+zero=reset_font_size"
# "ctrl+shift+n=new_window"
# "ctrl+shift+t=new_tab"
# "ctrl+shift+o=new_split:right"
# "ctrl+shift+e=new_split:down"
# "ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+n=new_window"
"ctrl+shift+t=new_tab"
"ctrl+shift+o=new_split:right"
"ctrl+shift+e=new_split:down"
"ctrl+shift+c=copy_to_clipboard"
# "ctrl+shift+tab=previous_tab"
# "ctrl+shift+left=previous_tab"
# "ctrl+page_up=previous_tab"
# "ctrl+tab=next_tab"
# "ctrl+page_down=next_tab"
# "ctrl+shift+right=next_tab"
"ctrl+shift+tab=previous_tab"
"ctrl+shift+left=previous_tab"
"ctrl+page_up=previous_tab"
"ctrl+tab=next_tab"
"ctrl+page_down=next_tab"
"ctrl+shift+right=next_tab"
# "super+ctrl+right_bracket=goto_split:next"
# "super+ctrl+left_bracket=goto_split:previous"
# "ctrl+alt+up=goto_split:top"
# "ctrl+alt+right=goto_split:right"
# "ctrl+alt+down=goto_split:bottom"
# "ctrl+alt+left=goto_split:left"
"super+ctrl+right_bracket=goto_split:next"
"super+ctrl+left_bracket=goto_split:previous"
"ctrl+alt+up=goto_split:top"
"ctrl+alt+right=goto_split:right"
"ctrl+alt+down=goto_split:bottom"
"ctrl+alt+left=goto_split:left"
# "super+ctrl+shift+up=resize_split:up,10"
# "super+ctrl+shift+right=resize_split:right,10"
# "super+ctrl+shift+down=resize_split:down,10"
# "super+ctrl+shift+left=resize_split:left,10"
# "super+ctrl+shift+equal=equalize_splits"
"super+ctrl+shift+up=resize_split:up,10"
"super+ctrl+shift+right=resize_split:right,10"
"super+ctrl+shift+down=resize_split:down,10"
"super+ctrl+shift+left=resize_split:left,10"
"super+ctrl+shift+equal=equalize_splits"
# "ctrl+shift+page_down=jump_to_prompt:1"
# "ctrl+shift+page_up=jump_to_prompt:-1"
"ctrl+shift+page_down=jump_to_prompt:1"
"ctrl+shift+page_up=jump_to_prompt:-1"
# "ctrl+alt+shift+j=write_scrollback_file:open"
# "ctrl+shift+w=close_surface"
"ctrl+alt+shift+j=write_scrollback_file:open"
"ctrl+shift+w=close_surface"
# "shift+page_up=scroll_page_up"
# "shift+home=scroll_to_top"
# "shift+end=scroll_to_bottom"
# "shift+page_down=scroll_page_down"
# "ctrl+shift+j=write_scrollback_file:paste"
# "alt+f4=close_window"
# "ctrl+shift+enter=toggle_split_zoom"
# "ctrl+shift+i=inspector:toggle"
# ];
# window-decoration = false;
"shift+page_up=scroll_page_up"
"shift+home=scroll_to_top"
"shift+end=scroll_to_bottom"
"shift+page_down=scroll_page_down"
"ctrl+shift+j=write_scrollback_file:paste"
"alt+f4=close_window"
"ctrl+shift+enter=toggle_split_zoom"
"ctrl+shift+i=inspector:toggle"
];
window-decoration = false;
gtk-single-instance = true;
};
};
git = {
@ -210,6 +212,7 @@ in
sway = {
enable = true;
package = pkgs.sway;
terminal = lib.getExe pkgs.ghostty;
swayidle = false;
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-3840.png";
output = {