{ pkgs, ... }:
{
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps
config = rec {
modifier = "Mod4";
# Use kitty as default terminal
terminal = "foot";
keybindings = {
# Brightness Controls
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
"XF86MonBrightnessUp" = "exec brightnessctl s 5%+";
# Volume Controls
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"Mod4+q" = "kill";
"Mod4+Return" = "exec foot";
"Mod4+Shift+q" = "kill";
"Mod4+d" = "exec wmenu-run";
"Mod4+Left" = "focus left";
"Mod4+Down" = "focus down";
"Mod4+Up" = "focus up";
"Mod4+Right" = "focus right";
"Mod4+Shift+Left" = "move left";
"Mod4+Shift+Down" = "move down";
"Mod4+Shift+Up" = "move up";
"Mod4+Shift+Right" = "move right";
"Mod4+b" = "splith";
"Mod4+v" = "splitv";
"Mod4+f" = "fullscreen toggle";
"Mod4+a" = "focus parent";
"Mod4+s" = "layout stacking";
"Mod4+w" = "layout tabbed";
"Mod4+e" = "layout toggle split";
"Mod4+Shift+space" = "floating toggle";
"Mod4+space" = "focus mode_toggle";
"Mod4+1" = "workspace number 1";
"Mod4+2" = "workspace number 2";
"Mod4+3" = "workspace number 3";
"Mod4+4" = "workspace number 4";
"Mod4+5" = "workspace number 5";
"Mod4+6" = "workspace number 6";
"Mod4+7" = "workspace number 7";
"Mod4+8" = "workspace number 8";
"Mod4+9" = "workspace number 9";
"Mod4+0" = "workspace number 10";
"Mod4+Shift+1" = "move container to workspace number 1";
"Mod4+Shift+2" = "move container to workspace number 2";
"Mod4+Shift+3" = "move container to workspace number 3";
"Mod4+Shift+4" = "move container to workspace number 4";
"Mod4+Shift+5" = "move container to workspace number 5";
"Mod4+Shift+6" = "move container to workspace number 6";
"Mod4+Shift+7" = "move container to workspace number 7";
"Mod4+Shift+8" = "move container to workspace number 8";
"Mod4+Shift+9" = "move container to workspace number 9";
"Mod4+Shift+0" = "move container to workspace number 10";
"Mod4+Shift+minus" = "move scratchpad";
"Mod4+minus" = "scratchpad show";
"Mod4+p" = "[app_id=\"trilium\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
"Mod4+g" = "exec glide-browser";
"Mod4+Shift+i" = "exec makoctl invoke && makoctl dismiss";
"Mod4+i" = "exec makoctl dismiss";
"Mod4+Shift+c" = "reload";
"Mod4+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"Mod4+r" = "mode resize";
"Mod4+c" = "[app_id=\"discord\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
"Mod4+j" = "[class=\"Jami\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
};
bars = [
{
command = "${pkgs.waybar}/bin/waybar";
}
];
output = {
eDP-1 = {
scale = "1.25";
};
};
input = {
"type:touchpad" = {
# Enables or disables tap for specified input device.
tap = "enabled";
# Enables or disables natural (inverted) scrolling for the specified input device.
natural_scroll = "enabled";
# Enables or disables disable-while-typing for the specified input device.
dwt = "disabled";
};
};
bindswitches = {
"lid:on" = {
reload = true;
locked = true;
action = "exec systemctl suspend-then-hibernate";
};
};
startup = [
{ command = "swaybg -i ~/.background-image -m fill"; }
{ command = "discord --enable-features=UseOzonePlatform --ozone-platform=wayland"; }
{ command = "trilium"; }
{ command = "jami"; }
];
window.commands = [
{
criteria = {
app_id = "discord";
};
command = "move scratchpad";
}
{
criteria = {
app_id = "trilium";
};
command = "move scratchpad";
}
{
criteria = {
class = "Jami";
};
command = "move scratchpad";
}
];
};
};
programs.waybar = {
enable = true;
style = ./waybar.css;
settings = {
mainBar = {
layer = "top";
position = "bottom"; # Puts the bar at the bottom
height = 30;
# Define what goes where on the bar
modules-left = [
"sway/workspaces"
"sway/mode"
];
modules-center = [ "sway/window" ];
modules-right = [
"backlight"
"pulseaudio"
"battery"
"clock"
"tray"
];
backlight = {
format = "{icon} {percent}%";
format-icons = [
"đ"
"đ"
"đ"
"đ"
"đ"
];
};
pulseaudio = {
format = "{icon} {volume}%";
format-muted = "đ Muted";
format-icons = {
default = [
"đ"
"đ"
"đ"
];
};
scroll-step = 1;
on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
};
clock = {
format = "{:%Y-%m-%d %H:%M}";
tooltip-format = "{:%Y %B}\n{calendar}";
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}% ({time})";
format-charging = "⥠{capacity}% ({time})";
format-plugged = "đ {capacity}% ({time})";
format-icons = [
"đĒĢ"
"đ"
"đ"
"đ"
"đ"
];
};
};
};
};
services.swayidle.events = {
"before-sleep" = "${pkgs.swaylock}/bin/swaylock -fF";
};
services.swayidle.enable = true;
# Configure Qt to use kvantum theming
qt = {
enable = true;
platformTheme.name = "org.kde.breezedark.desktop";
style = {
name = "org.kde.breezedark.desktop";
};
};
# Install packages for better Qt support and kvantum themes
home.packages = with pkgs; [
kdePackages.breeze
];
# Environment variables for kvantum theming
home.sessionVariables = {
QT_QPA_PLATFORMTHEME = "org.kde.breezedark.desktop";
QT_STYLE_OVERRIDE = "org.kde.breezedark.desktop";
GTK_THEME = "Materia-dark-compact";
};
}