fix(sway): Change default terminal to alacritty

Wezterm doesn't work well in sway-git
This commit is contained in:
Jalil David Salamé Messina 2024-01-21 21:09:39 +01:00
parent c9b2415384
commit 0430bc9878
Signed by: jalil
GPG key ID: F016B9E770737A0B
3 changed files with 26 additions and 12 deletions

View file

@ -37,13 +37,14 @@ in
programs.waybar.systemd.enable = true;
programs.waybar.settings = import ./waybar-settings.nix { inherit config lib; };
# Terminal
programs.wezterm.enable = true;
programs.wezterm.enable = cfg.terminal == "wezterm";
programs.wezterm.extraConfig = ''
config = {}
config.hide_tab_bar_if_only_one_tab = true
config.window_padding = { left = 1, right = 1, top = 1, bottom = 1 }
return config
'';
programs.alacritty.enable = cfg.terminal == "alacritty";
# PDF reader
programs.zathura.enable = true;
# Auto start sway

View file

@ -2,8 +2,15 @@
let
cfg = config.jhome.gui.sway;
modifier = "Mod4";
terminal = "wezterm";
menu = "${pkgs.fuzzel}/bin/fuzzel --terminal 'wezterm start'";
terminal = config.jhome.gui.terminal;
termCmd =
if terminal == "wezterm" then
"wezterm start"
else if terminal == "alacritty" then
"alacritty -e"
else
builtins.abort "no command configured for ${terminal}";
menu = "${pkgs.fuzzel}/bin/fuzzel --terminal '${termCmd}'";
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# the suggested way to set gtk settings is with gsettings

View file

@ -32,14 +32,14 @@ let
tempInfo.options.hwmon-path = lib.mkOption {
description = "Path to the hardware sensor whose temperature to monitor.";
type = lib.types.str;
type = types.str;
example = "/sys/class/hwmon/hwmon2/temp1_input";
};
sway.options = {
background = lib.mkOption {
description = lib.mdDoc "The wallpaper to use.";
type = lib.types.path;
type = types.path;
default = builtins.fetchurl {
url = "https://raw.githubusercontent.com/lunik1/nixos-logo-gruvbox-wallpaper/d4937c424fad79c1136a904599ba689fcf8d0fad/png/gruvbox-dark-rainbow.png";
sha256 = "036gqhbf6s5ddgvfbgn6iqbzgizssyf7820m5815b2gd748jw8zc";
@ -54,24 +54,24 @@ let
you can switch TTYs when logging in by using CTRL+ALT+F2 (for TTY2,
F3 for TTY3, etc).
'';
type = lib.types.bool;
type = types.bool;
default = true;
example = false;
};
exec = lib.mkOption {
description = "Run commands when starting sway.";
default = { };
type = lib.types.submodule {
type = types.submodule {
options = {
once = lib.mkOption {
description = lib.mdDoc "Programs to start only once (`exec`).";
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
default = [ ];
example = [ "signal-desktop --start-in-tray" ];
};
always = lib.mkOption {
description = lib.mdDoc "Programs to start whenever the config is sourced (`exec_always`).";
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
default = [ ];
example = [ "signal-desktop --start-in-tray" ];
};
@ -85,12 +85,18 @@ let
tempInfo = lib.mkOption {
description = lib.mdDoc "Temperature info to display in the statusbar.";
default = null;
type = lib.types.nullOr (lib.types.submodule tempInfo);
type = types.nullOr (types.submodule tempInfo);
};
sway = lib.mkOption {
description = "Sway window manager configuration.";
default = { };
type = lib.types.submodule sway;
type = types.submodule sway;
};
terminal = lib.mkOption {
description = "The terminal emulator to use.";
default = "alacritty";
example = "wezterm";
type = types.enum [ "wezterm" "alacritty" ];
};
};
in
@ -128,7 +134,7 @@ in
gui = lib.mkOption {
description = lib.mdDoc "Jalil's default GUI configuration.";
default = { };
type = lib.types.submodule gui;
type = types.submodule gui;
};
};
};