feat(sway): cleanup
This commit is contained in:
parent
ded6d601af
commit
96a2ec0dac
4 changed files with 263 additions and 263 deletions
|
@ -6,6 +6,15 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
condition = (
|
||||
builtins.elem osConfig.dotfiles.desktop [
|
||||
"hyprland"
|
||||
"sway"
|
||||
"swayfx"
|
||||
]
|
||||
);
|
||||
isSwayFx = osConfig.dotfiles.desktop == "swayfx";
|
||||
|
||||
fonts = {
|
||||
names = [
|
||||
"IBM Plex Sans"
|
||||
|
@ -21,9 +30,20 @@ let
|
|||
red = "#f38ba8";
|
||||
mauve = "#cba6f7";
|
||||
};
|
||||
|
||||
mod = "Mod4";
|
||||
modMove = "${mod}+Shift";
|
||||
modFocus = "${mod}+Ctrl";
|
||||
hyper = "Mod4+Mod1+Shift+Ctrl";
|
||||
|
||||
filebrowser = lib.getExe pkgs.nautilus;
|
||||
playerctl = lib.getExe pkgs.playerctl;
|
||||
screenshot = "${lib.getExe pkgs.sway-contrib.grimshot} copy area";
|
||||
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
|
||||
swayosd-server = "${pkgs.swayosd}/bin/swayosd-server";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (osConfig.dotfiles.desktop == "sway") {
|
||||
config = lib.mkIf condition {
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home = {
|
||||
|
@ -53,21 +73,17 @@ in
|
|||
udiskie.enable = true;
|
||||
};
|
||||
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
modifier = "Mod4";
|
||||
in
|
||||
{
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = null;
|
||||
checkConfig = false;
|
||||
config = rec {
|
||||
inherit modifier;
|
||||
modifier = mod;
|
||||
focus.wrapping = "no";
|
||||
focus.mouseWarping = "container";
|
||||
startup = [
|
||||
{
|
||||
command = "${pkgs.autotiling}/bin/autotiling -l2";
|
||||
command = "${lib.getExe pkgs.autotiling} -l2";
|
||||
always = true;
|
||||
}
|
||||
{ command = "1password --silent"; }
|
||||
|
@ -82,7 +98,7 @@ in
|
|||
always = true;
|
||||
}
|
||||
{
|
||||
command = "${pkgs.swayosd}/bin/swayosd-server";
|
||||
command = swayosd-server;
|
||||
always = true;
|
||||
}
|
||||
{ command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; }
|
||||
|
@ -97,19 +113,7 @@ in
|
|||
scale = "2";
|
||||
bg = "${../wallpapers/dhm_1610.png} fill #171320";
|
||||
};
|
||||
keybindings =
|
||||
let
|
||||
mod = modifier;
|
||||
modMove = "${mod}+Shift";
|
||||
modFocus = "${mod}+Ctrl";
|
||||
hyper = "Mod4+Mod1+Shift+Ctrl";
|
||||
|
||||
filebrowser = lib.getExe pkgs.nautilus;
|
||||
screenshot = "${lib.getExe pkgs.sway-contrib.grimshot} copy area";
|
||||
playerctl = lib.getExe pkgs.playerctl;
|
||||
swayosd = pkgs.swayosd + "/bin/swayosd-client";
|
||||
in
|
||||
{
|
||||
keybindings = {
|
||||
"${mod}+Shift+b" = "border none";
|
||||
"${mod}+b" = "border pixel 2";
|
||||
"${mod}+n" = "border normal";
|
||||
|
@ -197,12 +201,12 @@ in
|
|||
# rofi instead of drun
|
||||
"${mod}+space" = "exec --no-startup-id ${menu} -show drun -dpi $dpi";
|
||||
# 1password
|
||||
"${mod}+Shift+space" = "exec ${pkgs._1password-gui}/bin/1password --quick-access";
|
||||
"${mod}+Shift+space" = "exec ${lib.getExe pkgs._1password-gui} --quick-access";
|
||||
|
||||
# audio
|
||||
"XF86AudioRaiseVolume" = "exec ${swayosd} --output-volume 5";
|
||||
"XF86AudioLowerVolume" = "exec ${swayosd} --output-volume -5";
|
||||
"XF86AudioMute" = "exec ${swayosd} --output-volume mute-toggle";
|
||||
"XF86AudioRaiseVolume" = "exec ${swayosd-client} --output-volume 5";
|
||||
"XF86AudioLowerVolume" = "exec ${swayosd-client} --output-volume -5";
|
||||
"XF86AudioMute" = "exec ${swayosd-client} --output-volume mute-toggle";
|
||||
"XF86AudioNext" = "exec --no-startup-id ${playerctl} next";
|
||||
"XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous";
|
||||
"XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause";
|
||||
|
@ -263,21 +267,21 @@ in
|
|||
hideEdgeBorders = "none";
|
||||
border = 2;
|
||||
};
|
||||
gaps = {
|
||||
gaps = lib.mkIf isSwayFx {
|
||||
inner = 5;
|
||||
outer = 2;
|
||||
};
|
||||
bars = [
|
||||
{
|
||||
inherit fonts;
|
||||
mode = "hide";
|
||||
position = "top";
|
||||
statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ~/.config/i3status-rust/config-top.toml";
|
||||
statusCommand = "${lib.getExe config.programs.i3status-rust.package} ~/.config/i3status-rust/config-top.toml";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
extraConfig =
|
||||
''
|
||||
for_window [floating] border pixel 2
|
||||
|
||||
# floating sticky
|
||||
|
@ -305,10 +309,13 @@ in
|
|||
# keep apps in scratchpad
|
||||
for_window [class="discord"] move scratchpad sticky
|
||||
|
||||
# fullscreen apps inhibit idle
|
||||
for_window [class=".*"] inhibit_idle fullscreen
|
||||
|
||||
set $mode_gaps Gaps: (o)uter, (i)nner
|
||||
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
bindsym ${modifier}+Shift+g mode "$mode_gaps"
|
||||
bindsym ${mod}+Shift+g mode "$mode_gaps"
|
||||
|
||||
mode "$mode_gaps" {
|
||||
bindsym o mode "$mode_gaps_outer"
|
||||
|
@ -340,7 +347,8 @@ in
|
|||
bindsym Return mode "$mode_gaps"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
''
|
||||
+ lib.optionalString isSwayFx ''
|
||||
shadows enable
|
||||
shadow_color #11111b99
|
||||
shadow_blur_radius 20
|
||||
|
@ -351,8 +359,6 @@ in
|
|||
blur enable
|
||||
blur_passes 2
|
||||
blur_radius 4
|
||||
|
||||
layer_effects "swaync-notification-window" blur enable; shadows enable; corner_radius 5;
|
||||
'';
|
||||
systemd = {
|
||||
enable = true;
|
||||
|
|
|
@ -5,44 +5,28 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.dotfiles) desktop;
|
||||
condition = (
|
||||
builtins.elem config.dotfiles.desktop [
|
||||
builtins.elem desktop [
|
||||
"hyprland"
|
||||
"sway"
|
||||
"swayfx"
|
||||
]
|
||||
);
|
||||
binary =
|
||||
{
|
||||
swayfx = "sway";
|
||||
sway = "sway";
|
||||
hyprland = "hypr";
|
||||
}
|
||||
.${desktop} or (throw "greetd: desktop not supported");
|
||||
in
|
||||
{
|
||||
config = lib.mkIf condition {
|
||||
programs.regreet = {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = {
|
||||
path = ../../../home/wallpapers/dhm_1610.png;
|
||||
fit = "Cover";
|
||||
settings.default_session.command = "${lib.getExe pkgs.greetd.tuigreet} --cmd '${pkgs.dbus}/bin/dbus-run-session ${binary}'";
|
||||
};
|
||||
GTK = {
|
||||
cursor_theme_name = "macOS-Monterey";
|
||||
font_name = "IBM Plex Sans 16";
|
||||
icon_theme_name = "WhiteSur";
|
||||
theme_name = "WhiteSur-Dark";
|
||||
};
|
||||
};
|
||||
font.name = "IBM Plex Sans";
|
||||
cursorTheme = {
|
||||
name = "macOS-Monterey";
|
||||
package = pkgs.apple-cursor;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "WhiteSur-Dark";
|
||||
package = pkgs.whitesur-icon-theme;
|
||||
};
|
||||
theme = {
|
||||
name = "WhiteSur-Dark";
|
||||
package = pkgs.whitesur-gtk-theme;
|
||||
};
|
||||
};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.greetd = {
|
||||
enableGnomeKeyring = true;
|
||||
|
|
|
@ -4,8 +4,17 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
condition = (
|
||||
builtins.elem config.dotfiles.desktop [
|
||||
"hyprland"
|
||||
"sway"
|
||||
"swayfx"
|
||||
]
|
||||
);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (config.dotfiles.desktop == "sway") {
|
||||
config = lib.mkIf condition {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# file management
|
||||
p7zip
|
||||
|
@ -28,7 +37,7 @@
|
|||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
package = pkgs.swayfx;
|
||||
package = lib.mkIf (config.dotfiles.desktop == "swayfx") pkgs.swayfx;
|
||||
extraPackages = with pkgs; [
|
||||
swaylock-effects
|
||||
swayidle
|
||||
|
@ -61,8 +70,8 @@
|
|||
"org.freedesktop.impl.portal.Settings" = [ "darkman" ];
|
||||
};
|
||||
extraPortals = with pkgs; [
|
||||
darkman
|
||||
xdg-desktop-portal-gtk
|
||||
darkman
|
||||
];
|
||||
wlr.enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
|
|
|
@ -74,6 +74,7 @@ rec {
|
|||
"gnome"
|
||||
"hyprland"
|
||||
"sway"
|
||||
"swayfx"
|
||||
]
|
||||
);
|
||||
default = if (pkgs.stdenv.isLinux && isGraphical) then "sway" else null;
|
||||
|
|
Loading…
Reference in a new issue