2023-06-04 11:33:21 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
modifier = config.wayland.windowManager.sway.config.modifier;
|
2023-06-04 11:39:46 +01:00
|
|
|
term = config.wayland.windowManager.sway.config.terminal;
|
2023-06-20 15:26:07 +01:00
|
|
|
# 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
|
|
|
|
# for gsettings to work, we need to tell it where the schemas are
|
|
|
|
# using the XDG_DATA_DIR environment variable
|
|
|
|
# run at the end of sway config
|
|
|
|
configure-gtk = pkgs.writeTextFile {
|
|
|
|
name = "configure-gtk";
|
|
|
|
destination = "/bin/configure-gtk";
|
|
|
|
executable = true;
|
|
|
|
text = let
|
|
|
|
schema = pkgs.gsettings-desktop-schemas;
|
|
|
|
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
|
|
|
gtk-theme = config.gtk.theme.name;
|
|
|
|
icon-theme = config.gtk.iconTheme.name;
|
|
|
|
cursor-theme = config.gtk.cursorTheme.name;
|
|
|
|
in ''
|
|
|
|
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
|
|
|
gnome_schema=org.gnome.desktop.interface
|
|
|
|
gsettings set $gnome_schema gtk-theme '${gtk-theme}'
|
|
|
|
gsettings set $gnome_schema icon-theme '${icon-theme}'
|
|
|
|
gsettings set $gnome_schema cursor-theme '${cursor-theme}'
|
|
|
|
'';
|
|
|
|
};
|
2023-06-04 11:33:21 +01:00
|
|
|
in {
|
2023-06-02 12:21:19 +01:00
|
|
|
imports = [
|
2023-06-19 06:53:21 +01:00
|
|
|
./swaylock.nix
|
2023-06-02 12:21:19 +01:00
|
|
|
./waybar.nix
|
|
|
|
./gtk.nix
|
|
|
|
./dunst.nix
|
|
|
|
./rofi.nix
|
2023-06-20 15:26:07 +01:00
|
|
|
../gui/foot.nix
|
2023-06-02 12:21:19 +01:00
|
|
|
];
|
|
|
|
home.packages = with pkgs; [
|
2023-06-20 15:26:07 +01:00
|
|
|
configure-gtk
|
2023-06-02 12:21:19 +01:00
|
|
|
pipewire
|
|
|
|
wireplumber
|
|
|
|
wl-clipboard
|
|
|
|
swayimg
|
|
|
|
brightnessctl
|
|
|
|
];
|
|
|
|
programs.rofi.package = pkgs.rofi-wayland;
|
2023-06-04 09:38:51 +01:00
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
2023-06-20 15:26:07 +01:00
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
xwayland = true;
|
|
|
|
extraSessionCommands = ''
|
|
|
|
export GDK_BACKEND=wayland,x11
|
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"'';
|
2023-06-04 09:38:51 +01:00
|
|
|
config = {
|
2023-06-19 06:53:21 +01:00
|
|
|
input."*".xkb_layout = "gb";
|
|
|
|
output."*".bg = "~/nixos/wallpaper.jpg fill";
|
2023-06-04 10:01:07 +01:00
|
|
|
fonts = {
|
|
|
|
names = ["FiraCode Nerd Font" "FiraCode Nerd Font Mono"];
|
|
|
|
size = 12.0;
|
|
|
|
};
|
2023-06-19 06:53:21 +01:00
|
|
|
gaps = {
|
|
|
|
inner = lib.mkDefault 5;
|
|
|
|
outer = lib.mkDefault 20;
|
|
|
|
};
|
2023-06-20 13:35:45 +01:00
|
|
|
bars = [{command = "${pkgs.waybar}/bin/waybar";}];
|
2023-06-20 15:26:07 +01:00
|
|
|
assigns = {
|
|
|
|
"2" = [{app_id = "firefox";}];
|
|
|
|
"3" = [
|
2023-06-21 14:51:45 +01:00
|
|
|
{class = "Signal";}
|
2023-06-20 15:26:07 +01:00
|
|
|
{app_id = "fractal";}
|
|
|
|
{app_id = "discord";}
|
|
|
|
{class = "teams-for-linux";}
|
|
|
|
];
|
|
|
|
"4" = [{class = "Nxplayer.bin";}];
|
|
|
|
};
|
|
|
|
floating.criteria = [
|
|
|
|
{app_id = "foot";}
|
|
|
|
{app_id = "pavucontrol";}
|
|
|
|
{app_id = ".blueman-manager-wrapped";}
|
|
|
|
{app_id = "otpclient";}
|
|
|
|
{app_id = "thunar";}
|
|
|
|
{app_id = "^swayimg.*$";}
|
|
|
|
{class = "Nxplayer.bin";}
|
|
|
|
];
|
|
|
|
startup = [
|
|
|
|
{
|
|
|
|
command = "dbus-sway-environment";
|
|
|
|
always = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
command = "configure-gtk";
|
|
|
|
always = true;
|
|
|
|
}
|
|
|
|
{command = "dunst";}
|
|
|
|
];
|
|
|
|
modifier = lib.mkDefault "Mod1";
|
|
|
|
terminal = lib.mkDefault "${pkgs.wezterm}/bin/wezterm";
|
|
|
|
window.titlebar = false;
|
|
|
|
workspaceAutoBackAndForth = true;
|
|
|
|
keybindings = lib.mkOptionDefault {
|
|
|
|
"${modifier}+Return" = "exec ${term}";
|
|
|
|
"${modifier}+Shift+Return" = "exec ${pkgs.foot}/bin/foot";
|
|
|
|
"${modifier}+space" = "exec ${pkgs.rofi}/bin/rofi -show drun";
|
|
|
|
"${modifier}+F1" = "exec ${pkgs.swaylock}/bin/swaylock";
|
|
|
|
"${modifier}+w" = "exec ${pkgs.firefox}/bin/firefox";
|
|
|
|
"${modifier}+f" = "exec ${pkgs.xfce.thunar}/bin/thunar";
|
|
|
|
};
|
2023-06-20 13:35:45 +01:00
|
|
|
colors = {
|
|
|
|
focused = {
|
|
|
|
border = "#4c7899";
|
|
|
|
background = "#285577";
|
|
|
|
text = "#ffffff";
|
|
|
|
indicator = "#2e9ef4";
|
|
|
|
childBorder = "#285577";
|
|
|
|
};
|
|
|
|
focusedInactive = {
|
|
|
|
border = "#333333";
|
|
|
|
background = "#5f676a";
|
|
|
|
text = "#ffffff";
|
|
|
|
indicator = "#484e50";
|
|
|
|
childBorder = "#5f676a";
|
|
|
|
};
|
|
|
|
unfocused = {
|
|
|
|
border = "#333333";
|
|
|
|
background = "#222222";
|
|
|
|
text = "#888888";
|
|
|
|
indicator = "#292d2e";
|
|
|
|
childBorder = "#222222";
|
|
|
|
};
|
|
|
|
urgent = {
|
|
|
|
border = "#2f343a";
|
|
|
|
background = "#900000";
|
|
|
|
text = "#ffffff";
|
|
|
|
indicator = "#900000";
|
|
|
|
childBorder = "#900000";
|
|
|
|
};
|
|
|
|
placeholder = {
|
|
|
|
border = "#000000";
|
|
|
|
background = "#0c0c0c";
|
|
|
|
text = "#ffffff";
|
|
|
|
indicator = "#000000";
|
|
|
|
childBorder = "#0c0c0c";
|
|
|
|
};
|
|
|
|
background = "#ffffff";
|
|
|
|
};
|
2023-06-04 09:38:51 +01:00
|
|
|
};
|
|
|
|
};
|
2023-05-16 09:11:39 +01:00
|
|
|
}
|