Change most things over to use sway

Added most config, at least enough to get by for now

Update waybar config to remove hyprland-specific things

Misc updates to rofi, swaylock

Set greetd to start sway on machines by default now
This commit is contained in:
Evie Litherland-Smith 2024-04-12 17:56:13 +01:00
parent 2ce32bad4c
commit a4ab3c7288
9 changed files with 192 additions and 127 deletions

View file

@ -170,7 +170,16 @@
++ systemModules;
};
in {
nixosConfigurations = {
nixosConfigurations = let
swaygreet = {
services.greetd.settings = let
command = "sway";
in {
default_session = {inherit command;};
initial_session = {inherit command;};
};
};
in {
## Server
Legion = systemConfig {
@ -191,24 +200,14 @@
Northstar = systemConfig {
hostName = "Northstar";
systemModules = [
./system/laptop.nix
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
];
systemModules = [./system/laptop.nix swaygreet];
homeModules = [./home/sway/swayfx.nix];
};
Vanguard = systemConfig {
hostName = "Vanguard";
systemModules = [
./system/hyprland.nix
./system/games.nix
];
homeModules = [
./home/hyprland/default.nix
];
systemModules = [./system/desktop ./system/games.nix swaygreet];
homeModules = [./home/sway/swayfx.nix];
};
## Work
@ -216,26 +215,15 @@
Ronin = systemConfig {
hostName = "Ronin";
user = "elitherl";
systemModules = [
./system/laptop.nix
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
./home/email/work.nix
];
systemModules = [./system/laptop.nix swaygreet];
homeModules = [./home/sway/swayfx.nix ./home/email/work.nix];
};
Scorch = systemConfig {
hostName = "Scorch";
user = "elitherl";
systemModules = [
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
./home/email/work.nix
];
systemModules = [./system/desktop.nix swaygreet];
homeModules = [./home/sway/swayfx.nix ./home/email/work.nix];
};
};
};

View file

@ -14,7 +14,7 @@
plugins = with pkgs; [rofi-emoji];
pass = {
enable = true;
package = pkgs.rofi-wayland;
# package = pkgs.rofi-wayland;
extraConfig = ''
USERNAME_field='login'
'';

View file

@ -5,12 +5,12 @@
# Read `man 5 sway` for a complete reference.
### Variables
set $mod Mod1
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term foot
set $term alacritty
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
@ -19,24 +19,17 @@ set $menu rofi -show drun
include /etc/sway/config-vars.d/*
### Output configuration
output DSI-1 scale 2.0 transform 270
input type:touch map_to_output DSI-1
input type:touchpad click_method clickfinger
# this is for Lenovo's USI pen
input 10182:3632:hid-over-i2c_27C6:0E30 map_to_output DSI-1
bindsym $mod+F6 exec brightnessctl s 5%-
bindsym $mod+F7 exec brightnessctl s 5%+
output DP-1 scale 1.5
gaps inner 5
gaps outer 20
gaps outer 10
default_border pixel 2
### Input configuration
input * {
xkb_layout gb
xkb_options ctrl:nocaps
}
#
@ -52,41 +45,39 @@ set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
workspace $ws1 output DSI-1
workspace $ws2 output DSI-1
workspace $ws3 output DSI-1
workspace $ws4 output DSI-1
workspace $ws5 output DSI-1
workspace $ws6 output DSI-1
workspace $ws7 output DSI-1
workspace $ws8 output DSI-1
# workspace $ws1 output DSI-1
# workspace $ws2 output DSI-1
# workspace $ws3 output DSI-1
# workspace $ws4 output DSI-1
# workspace $ws5 output DSI-1
# workspace $ws6 output DSI-1
# workspace $ws7 output DSI-1
# workspace $ws8 output DSI-1
assign [app_id="foot"] $ws1
assign [class="(?i)firefox"] $ws2
assign [app_id="(?i)firefox"] $ws2
assign [class="(?i)chromium"] $ws2
assign [app_id="(?i)chromium"] $ws2
assign [class="org.kde.dolphin"] $ws3
assign [class="thunderbird"] $ws4
assign [class="Mailspring"] $ws4
assign [class="Element"] $ws5
assign [class="Signal"] $ws5
assign [class="Steam"] $ws6
assign [class="Bitwarden"] $ws7
assign [class="Nxplayer.bin"] $ws8
# assign [app_id="foot"] $ws1
# assign [class="(?i)firefox"] $ws2
# assign [app_id="(?i)firefox"] $ws2
# assign [class="(?i)chromium"] $ws2
# assign [app_id="(?i)chromium"] $ws2
# assign [class="org.kde.dolphin"] $ws3
# assign [class="thunderbird"] $ws4
# assign [class="Mailspring"] $ws4
# assign [class="Element"] $ws5
# assign [class="Signal"] $ws5
# assign [class="Steam"] $ws6
# assign [class="Bitwarden"] $ws7
# assign [class="Nxplayer.bin"] $ws8
for_window [app_id="pavucontrol"] floating enable
### Key bindings
bindsym $mod+F1 exec swaylock
bindsym $mod+Return exec $term
bindsym $mod+q kill
bindsym $mod+space exec $menu
bindsym $mod+e exec power-profiles
bindsym $mod+p exec wlogout
bindsym $mod+F1 exec swaylock
bindsym $mod+w exec chromium
bindsym $mod+f exec $term -e ranger
bindsym $mod+Shift+f exec dolphin
bindsym $mod+e exec emacsclient -c
bindsym $mod+w exec firefox
bindsym $mod+f exec thunar
floating_modifier $mod normal
@ -94,7 +85,7 @@ floating_modifier $mod normal
bindsym $mod+Shift+r reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+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'
bindsym $mod+Shift+q 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'
# Move your focus around
bindsym $mod+$left focus left
@ -185,11 +176,19 @@ bindsym $mod+r mode "resize"
#
# Read `man 5 sway-bar` for more information about this section.
include /etc/sway/config.d/*
# SwayFX additional settings
corner_radius 10
blur enable
blur_xray disable
blur_passes 3
blur_radius 5
corner_radius 10
shadows enable
shadow_blur_radius 4
titlebar_separator enable
scratchpad_minimize disable
exec dunst
# exec hyprpaper
exec waybar
# exec eww daemon
# vim: ft=i3config

View file

@ -10,7 +10,6 @@
imports = [../desktop.nix];
wayland.windowManager.sway = {
enable = true;
package = null;
swaynag.enable = true;
systemd.enable = true;
wrapperFeatures.gtk = true;
@ -24,23 +23,45 @@
};
modifier = "Mod4";
terminal = "${config.programs.alacritty.package}/bin/alacritty";
output = {
# DSI-1 = {
# scale = "2.0";
# transform = "270";
# bg = "~/nixos/wallpaper.jpg fill";
# };
};
menu = "${config.programs.rofi.finalPackage}/bin/rofi -show drun";
workspaceAutoBackAndForth = true;
bars = [];
gaps = {
inner = 5;
top = 10;
bottom = 10;
left = 10;
right = 10;
outer = 10;
};
fonts = {
names = [fonts.monospace.name fonts.emoji.name];
style = "regular";
size = 12.0; # fonts.sizes.desktop;
};
colors = with scheme.withHashtag; let
text = toString base05;
indicator = toString cyan;
in rec {
background = toString base00;
focused = rec {
inherit background text indicator;
border = toString scheme.withHashtag.${accentColour};
childBorder = border;
};
focusedInactive = rec {
inherit background text indicator;
border = toString scheme.withHashtag.${accentColour};
childBorder = border;
};
unfocused = rec {
inherit background text indicator;
border = toString base03;
childBorder = border;
};
};
startup = [
{command = "dunst";}
{command = "waybar";}
{command = "${pkgs.swaynotificationcenter}/bin/swaync";}
{command = "${pkgs.swaybg}/bin/swaybg -i ${../../wallpapers/waves/cat-waves.png}";}
{command = "${pkgs.waybar}/bin/waybar";}
{command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";}
{command = "${pkgs.protonmail-bridge}/bin/protonmail-bridge -n";}
];
assigns = {
"3: Files" = [
@ -55,6 +76,43 @@
{class = "^org.prismlauncher.PrismLauncher$";}
];
};
window = {
commands = [
{
command = "floating enable";
criteria = {app_id = "org.kde.polkit-kde-authentication-agent-1";};
}
{
command = "floating enable";
criteria = {app_id = "Pinentry";};
}
{
command = "floating enable";
criteria = {app_id = "pavucontrol";};
}
{
command = "floating enable";
criteria = {app_id = ".blueman-manager-wrapped";};
}
{
command = "floating enable";
criteria = {app_id = "nm-connection-editor";};
}
{
command = "floating enable";
criteria = {app_id = "org.prismlauncher.PrismLauncher";};
}
];
};
keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
"${modifier}+F1" = "exec swaylock";
"${modifier}+e" = "exec emacsclient -c";
"${modifier}+w" = "exec firefox";
"${modifier}+f" = "exec thunar";
};
};
};
}

18
home/sway/swayfx.nix Normal file
View file

@ -0,0 +1,18 @@
{pkgs, ...}: {
imports = [./default.nix];
wayland.windowManager.sway = {
package = pkgs.swayfx;
extraConfig = ''
corner_radius 10
blur enable
blur_xray disable
blur_passes 3
blur_radius 5
corner_radius 10
shadows enable
shadow_blur_radius 4
titlebar_separator enable
scratchpad_minimize disable
'';
};
}

View file

@ -1,8 +1,4 @@
{
config,
pkgs,
...
}: {
{pkgs, ...}: {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
@ -13,7 +9,7 @@
indicator-caps-lock = true;
ignore-empty-password = true;
show-failed-attempts = true;
effect-blur = with config.wayland.windowManager.hyprland.settings.decoration.blur; "${toString size}x${toString passes}";
effect-blur = "5x3";
effect-vignette = "0.5:0.5";
grace = 2;
fade-in = 0.2;

View file

@ -17,8 +17,8 @@
position = "top";
# Layout
"modules-left" = [
"hyprland/workspaces"
"hyprland/window"
"sway/workspaces"
"sway/window"
];
"modules-center" = [
"mpris"
@ -36,8 +36,36 @@
"tray"
];
# Module config
"hyprland/window" = {
"sway/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "󰟀 ";
"2" = "󰝚 ";
"3" = "󱧶 ";
"4" = "󰭻 ";
"5" = "󰹁 ";
"6" = "󰫃 ";
"7" = "󰫄 ";
"8" = "󰫅 ";
"9" = "󰫆 ";
"10" = "󰫇 ";
default = "󰫈 ";
urgent = "󰁡 ";
};
# show-special = false;
# sort-by-number = true;
all-outputs = false;
persistent-workspaces = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
};
};
"sway/window" = {
"format" = "{title}";
"max-length" = 50;
"rewrite" = {
"(.*) - GNU Emacs at (.*)" = " $1 [$2]";
"(Alacritty.*)" = " $1";
@ -57,34 +85,6 @@
"(X2Go Client)" = "󰢹 $1";
"(NoMachine|Nxplayer.bin) (.*)" = "󰢹 $1 $2";
};
"separate-outputs" = true;
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "󰟀 ";
"2" = "󰝚 ";
"3" = "󱧶 ";
"4" = "󰭻 ";
"5" = "󰹁 ";
"6" = "󰫃 ";
"7" = "󰫄 ";
"8" = "󰫅 ";
"9" = "󰫆 ";
"10" = "󰫇 ";
default = "󰫈 ";
urgent = "󰁡 ";
};
show-special = false;
sort-by-number = true;
all-outputs = false;
persistent-workspaces = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
};
};
mpris = {
"format" = "{status_icon} {player_icon} {artist} - {title}";

View file

@ -22,6 +22,7 @@
gsettings-desktop-schemas
hunspell
hunspellDicts.en_GB-large
swaybg
swayimg
swaylock-effects
pamixer
@ -98,7 +99,11 @@
};
};
xdg = {
portal.enable = true;
portal = {
enable = true;
config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop"];

View file

@ -1,4 +1,5 @@
{...}: {
imports = [./desktop.nix];
powerManagement.enable = true;
services.auto-cpufreq = {
enable = true;