Add swayfx and some fancy styling
This commit is contained in:
402
alex/sway.nix
402
alex/sway.nix
@@ -1,52 +1,364 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
terminal = "foot"; # Or your preferred terminal
|
||||
menu = "wofi --show drun --allow-images";
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us";
|
||||
xkb_variant = "dvorak";
|
||||
};
|
||||
};
|
||||
let
|
||||
# Catppuccin Mocha Palette
|
||||
base = "#1e1e2e";
|
||||
mantle = "#181825";
|
||||
surface0 = "#313244";
|
||||
surface1 = "#45475a";
|
||||
text = "#cdd6f4";
|
||||
lavender = "#b4befe";
|
||||
blue = "#89b4fa";
|
||||
sapphire = "#74c7ec";
|
||||
red = "#f38ba8";
|
||||
peach = "#fab387";
|
||||
yellow = "#f9e2af";
|
||||
green = "#a6e3a1";
|
||||
mauve = "#cba6f7";
|
||||
overlay0 = "#6c7086";
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
swaybg
|
||||
swayidle
|
||||
swaylock-effects
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
mako
|
||||
libnotify
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
|
||||
bars = []; # Removes the duplicate default bar issue
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = pkgs.swayfx;
|
||||
checkConfig = false;
|
||||
|
||||
startup = [
|
||||
{ command = "waybar"; }
|
||||
];
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
terminal = "wezterm";
|
||||
menu = "wofi --show drun --allow-images";
|
||||
|
||||
keybindings = let
|
||||
modifier = "Mod4";
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+d" = "exec wofi --show drun --allow-images";
|
||||
"XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
"XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"XF86MonBrightnessUp" = "exec light -A 5";
|
||||
"XF86MonBrightnessDown" = "exec light -U 5";
|
||||
};
|
||||
};
|
||||
};
|
||||
fonts = {
|
||||
names = [ "JetBrainsMono Nerd Font" ];
|
||||
style = "Regular";
|
||||
size = 11.0;
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
modules-left = [ "sway/workspaces" ];
|
||||
modules-right = [ "pulseaudio" "clock" ];
|
||||
pulseaudio = {
|
||||
format = "{volume}% {icon}";
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us";
|
||||
xkb_variant = "dvorak";
|
||||
};
|
||||
"type:touchpad" = {
|
||||
dwt = "enabled";
|
||||
tap = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
};
|
||||
};
|
||||
|
||||
programs.wofi.enable = true;
|
||||
gaps = {
|
||||
inner = 10;
|
||||
outer = 5;
|
||||
};
|
||||
|
||||
colors = {
|
||||
focused = {
|
||||
border = lavender;
|
||||
background = base;
|
||||
text = text;
|
||||
indicator = lavender;
|
||||
childBorder = lavender;
|
||||
};
|
||||
focusedInactive = {
|
||||
border = overlay0;
|
||||
background = base;
|
||||
text = text;
|
||||
indicator = overlay0;
|
||||
childBorder = overlay0;
|
||||
};
|
||||
unfocused = {
|
||||
border = overlay0;
|
||||
background = base;
|
||||
text = overlay0;
|
||||
indicator = overlay0;
|
||||
childBorder = overlay0;
|
||||
};
|
||||
urgent = {
|
||||
border = red;
|
||||
background = base;
|
||||
text = red;
|
||||
indicator = red;
|
||||
childBorder = red;
|
||||
};
|
||||
};
|
||||
|
||||
output = {
|
||||
"*" = {
|
||||
bg = "${base} solid_color";
|
||||
};
|
||||
};
|
||||
|
||||
bars = [];
|
||||
|
||||
startup = [
|
||||
{ command = "waybar"; }
|
||||
{ command = "mako"; }
|
||||
];
|
||||
|
||||
keybindings = let
|
||||
modifier = "Mod4";
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+Return" = "exec wezterm";
|
||||
"${modifier}+d" = "exec wofi --show drun --allow-images";
|
||||
"${modifier}+Shift+q" = "kill";
|
||||
"${modifier}+Shift+c" = "reload";
|
||||
"${modifier}+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'";
|
||||
|
||||
"${modifier}+Shift+s" = "exec grim -g \"$(slurp)\" - | wl-copy";
|
||||
|
||||
"XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5+উন্ট";
|
||||
"XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5-উন্ট";
|
||||
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"XF86MonBrightnessUp" = "exec light -A 5";
|
||||
"XF86MonBrightnessDown" = "exec light -U 5";
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
default_border pixel 2
|
||||
default_floating_border pixel 2
|
||||
|
||||
corner_radius 10
|
||||
shadows enable
|
||||
shadow_blur_radius 20
|
||||
shadow_color #00000077
|
||||
|
||||
blur enable
|
||||
blur_passes 3
|
||||
blur_radius 5
|
||||
layer_effects "waybar" blur enable; shadows enable;
|
||||
layer_effects "wofi" blur enable; shadows enable;
|
||||
'';
|
||||
};
|
||||
|
||||
services.mako = {
|
||||
enable = true;
|
||||
settings = {
|
||||
font = "JetBrainsMono Nerd Font 11";
|
||||
background-color = "${base}dd";
|
||||
border-color = lavender;
|
||||
border-radius = 10;
|
||||
border-size = 2;
|
||||
text-color = text;
|
||||
default-timeout = 5000;
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
margin-top = 5;
|
||||
margin-left = 10;
|
||||
margin-right = 10;
|
||||
spacing = 4;
|
||||
|
||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right = [ "pulseaudio" "network" "cpu" "memory" "battery" "tray" ];
|
||||
|
||||
"sway/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = true;
|
||||
};
|
||||
|
||||
"clock" = {
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt>{calendar}</tt>";
|
||||
format-alt = "{:%Y-%m-%d}";
|
||||
};
|
||||
|
||||
"cpu" = {
|
||||
format = "{usage}% ";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"memory" = {
|
||||
format = "{}% ";
|
||||
};
|
||||
|
||||
"battery" = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-charging = "{capacity}% ";
|
||||
format-plugged = "{capacity}% ";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
};
|
||||
|
||||
"network" = {
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "{ipaddr}/{cidr} ";
|
||||
tooltip-format = "{ifname} via {gwaddr} ";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ⚠";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
|
||||
"pulseaudio" = {
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = ["" "" ""];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
style = ''
|
||||
* {
|
||||
font-family: "JetBrainsMono Nerd Font";
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: ${base};
|
||||
color: ${text};
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
border-radius: 10px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
button {
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: inherit;
|
||||
box-shadow: inset 0 -3px ${text};
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: ${text};
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: ${surface1};
|
||||
box-shadow: inset 0 -3px ${lavender};
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: ${red};
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: ${surface0};
|
||||
border-bottom: 3px solid ${text};
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpd {
|
||||
padding: 0 10px;
|
||||
color: ${text};
|
||||
background-color: ${surface0};
|
||||
border-radius: 10px;
|
||||
margin: 5px 2px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: ${mauve};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#battery {
|
||||
background-color: ${green};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#battery.charging, #battery.plugged {
|
||||
color: ${base};
|
||||
background-color: ${green};
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: ${red};
|
||||
color: ${text};
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background-color: ${peach};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#memory {
|
||||
background-color: ${yellow};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#network {
|
||||
background-color: ${sapphire};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: ${blue};
|
||||
color: ${base};
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: ${overlay0};
|
||||
color: ${text};
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: ${surface0};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.wofi.enable = true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Enable the Sway binary and hardware wrappers
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
package = pkgs.swayfx;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user