tree-wide: drop sway (#194)
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / clean-install-build (push) Waiting to run
nix-build / rofi-bluetooth-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-build / slateport-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-12-08 22:16:10 -05:00
parent 1011572ae9
commit c7581ba6e1
30 changed files with 23 additions and 782 deletions

View file

@ -26,7 +26,6 @@ This flake takes a variety of upstream and third party flakes as inputs:
- [lanzaboote](https://github.com/nix-community/lanzaboote): secure boot for NixOS. - [lanzaboote](https://github.com/nix-community/lanzaboote): secure boot for NixOS.
- [nur](https://github.com/nix-community/NUR): extra packages from the nix user repository. - [nur](https://github.com/nix-community/NUR): extra packages from the nix user repository.
- [stylix](https://github.com/danth/stylix): system-wide color schemes and typography. - [stylix](https://github.com/danth/stylix): system-wide color schemes and typography.
- [sway](https://github.com/swaywm/sway): fantastic, rock-solid tiling compositor for wayland.
## Outputs ## Outputs
@ -37,7 +36,6 @@ This flake takes a variety of upstream and third party flakes as inputs:
- nixosModules.nixos: opinionated desktop, app, and service options. - nixosModules.nixos: opinionated desktop, app, and service options.
- nixosModules.users: basic user configuration options. - nixosModules.users: basic user configuration options.
- overlays.default: adds every package output to nixpkgs. - overlays.default: adds every package output to nixpkgs.
- overlays.rofi-bluetooth: overlays rofi-bluetooth with custom patches.
- overlays.tablet: tablet optimizations, mainly for electron apps. - overlays.tablet: tablet optimizations, mainly for electron apps.
In addition, this flake outputs NixOS configurations, home-manager configurations, and various hardware modules for all of my hosts and users. In addition, this flake outputs NixOS configurations, home-manager configurations, and various hardware modules for all of my hosts and users.

View file

@ -23,14 +23,14 @@
"org/nemo/preferences/menu-config" = { "org/nemo/preferences/menu-config" = {
background-menu-open-as-root = background-menu-open-as-root =
!(config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.sway.enable); !(config.ar.home.desktop.hyprland.enable);
selection-menu-open-as-root = selection-menu-open-as-root =
!(config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.sway.enable); !(config.ar.home.desktop.hyprland.enable);
}; };
"org/nemo/plugins".disabled-actions = "org/nemo/plugins".disabled-actions =
lib.optionals lib.optionals
(config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.sway.enable) [ (config.ar.home.desktop.hyprland.enable) [
"90_new-launcher.nemo_action" "90_new-launcher.nemo_action"
"add-desklets.nemo_action" "add-desklets.nemo_action"
"change-background.nemo_action" "change-background.nemo_action"

View file

@ -9,7 +9,6 @@
./gnome ./gnome
./hyprland ./hyprland
./kde ./kde
./sway
./wayland ./wayland
]; ];
@ -18,7 +17,6 @@
config.ar.home.desktop.gnome.enable config.ar.home.desktop.gnome.enable
|| config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.hyprland.enable
|| config.ar.home.desktop.kde.enable || config.ar.home.desktop.kde.enable
|| config.ar.home.desktop.sway.enable
) { ) {
dconf = { dconf = {
enable = true; enable = true;

View file

@ -1,157 +0,0 @@
# Sway
## Features
- Clamshell mode for laptops
- Default apps + theme integration
- Random wallpapers that cycle every 15 minutes
- Slick looks
- swayfx support
## Desktop Utilities
- Bluetooth: [blueberry.py](https://github.com/linuxmint/blueberry).
- Idle daemon: [swayidle](https://github.com/swaywm/swayidle).
- Launcher [rofi-wayland](https://github.com/lbonn/rofi).
- Notifications: [mako](https://github.com/emersion/mako).
- Panel: [waybar](https://github.com/Alexays/Waybar).
- Polkit: [mate-polkit](https://github.com/mate-desktop/mate-polkit).
- Wallpapers: [swaybg](https://github.com/swaywm/swaybg).
- WiFi: [networkmanager-dmenu](https://github.com/firecat53/networkmanager-dmenu).
## Keybindings
### Launching Apps
- SUPER + B: Open Browser.
- SUPER + E: Open Text Editor.
- SUPER + F: Open File Manager.
- SUPER + R: Open Launcher.
- SUPER + T: Open Terminal.
### Screenshots
- PRINT // CTRL + F12: Take screenshot of monitor or selected area.
### Session Control
- SUPER CTRL + L: Lock screen.
- SUPER + M: Logout/shutdown dialog.
### Workspaces
#### Switching Workspaces
- SUPER + {1..9}: Switch to numbered workspace.
- SUPER + Comma: Switch to previous numbered workspace.
- SUPER + Period: Switch to next numbered workspace.
- TOUCHPAD: 3 Finger Swipe Left/Up or Right/Down.
#### Multi-Monitor Workspace Management
- SUPER CTRL SHIFT + Down: Move current workspace to monitor below.
- SUPER CTRL SHIFT + Up: Move current workspace to monitor above.
- SUPER CTRL SHIFT + Left: Move current workspace to monitor left.
- SUPER CTRL SHIFT + Right: Move current workspace to monitor right.
______________________________________________________________________
- SUPER CTRL SHIFT + J: Move current workspace to monitor below.
- SUPER CTRL SHIFT + K: Move current workspace to monitor above.
- SUPER CTRL SHIFT + H: Move current workspace to monitor left.
- SUPER CTRL SHIFT + L: Move current workspace to monitor right.
### Window Management
- SUPER + C: Kill focused window.
- SUPER + F11: Show/hide top panel.
- SUPER + V: Toggle floating window.
- SUPER SHIFT + Backslash: Toggle vertical/horizontal splits.
- SUPER SHIFT + G: Toggle tabbed layout.
- SUPER SHIFT + TAB: Open Window list.
- SUPER SHIFT + W: Toggle fullscreen.
#### Focus
- SUPER + Down: Change focus down.
- SUPER + Up: Change focus up.
- SUPER + Left: Change focus left.
- SUPER + Right: Change focus right.
______________________________________________________________________
- SUPER + J: Change focus down.
- SUPER + K: Change focus up.
- SUPER + H: Change focus left.
- SUPER + L: Change focus right.
#### Movement
- SUPER SHIFT + Down: Move window down.
- SUPER SHIFT + Up: Move window up.
- SUPER SHIFT + Left: Move window left.
- SUPER SHIFT + Right: Move window right.
______________________________________________________________________
- SUPER SHIFT + J: Move window down.
- SUPER SHIFT + K: Move window up.
- SUPER SHIFT + H: Move window left.
- SUPER SHIFT + L: Move window right.
#### Moving between Workspaces
- SUPER SHIFT + {1..9}: Move to specified numbered workspace.
- SUPER SHIFT + Comma: Move to previous numbered workspace.
- SUPER SHIFT + Period: Move to next numbered workspace.
#### Scratchpad
- SUPER + S: Switch to scratchpad (overlay).
- SUPER SHIFT + S: Move window to scratchpad.
### Modes
These modes provide special submaps where you are free to use various key binds without pressing the full key combo, because certain keys are assumed.
#### Resize Mode
- CTRL ALT + R: Enter resize mode.
- Down: Resize active window (0,10).
- Up: Resize active window (0,-10)
- Left: Resize active window (-10,0).
- Right: Resize active window (10,0).
______________________________________________________________________
- J: Resize active window (0,10).
- K: Resize active window (0,-10)
- H: Resize active window (-10,0).
- L: Resize active window (10,0).
- ESCAPE: Exit resize mode.
#### Move Mode
- CTRL ALT + M: Enter move mode.
- {1..0}: Move to numbered workspace.
- Comma: Move to previous numbered workspace.
- Period: Move to next numbered workspace.
______________________________________________________________________
- Down: Move window down.
- Up: Move window up.
- Left: Move window left.
- Right: Move window right.
______________________________________________________________________
- J: Move window down.
- K: Move window up.
- H: Move window left.
- L: Move window right.
- ESCAPE: Exit move mode.

View file

@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.home.desktop.sway.enable {
ar.home.theme.gtk.hideTitleBar =
if config.wayland.windowManager.sway.package == pkgs.swayfx
then false
else true;
wayland.windowManager.sway = import ./settings.nix {inherit config lib pkgs;};
xdg.portal = {
enable = true;
configPackages = [pkgs.xdg-desktop-portal-wlr];
extraPortals = [pkgs.xdg-desktop-portal-wlr];
};
};
}

View file

@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
swaymsg = lib.getExe' config.wayland.windowManager.sway.package "swaymsg";
in {
clamshell = pkgs.writeShellScript "sway-clamshell" ''
docked() {
[ "$(${swaymsg} -t get_outputs | ${lib.getExe pkgs.jq} '. | length')" -ne 1 ] && return 0
return 1
}
if [ "$1" == "on" ]; then
docked && swaymsg output eDP-1 disable
elif [ "$1" == "off" ]; then
swaymsg output eDP-1 enable
fi
'';
}

View file

@ -1,293 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.ar.home;
focused = config.lib.stylix.colors.withHashtag.base0D;
helpers = import ../wayland/helpers.nix {inherit config lib pkgs;};
modifier = "Mod4";
scripts = import ./scripts.nix {inherit config lib pkgs;};
unfocused = config.lib.stylix.colors.withHashtag.base03;
urgent = config.lib.stylix.colors.withHashtag.base08;
in {
enable = true;
checkConfig = false;
wrapperFeatures.gtk = true;
systemd = {
enable = true;
extraCommands = lib.mkDefault [
"systemctl --user stop sway-session.target"
"systemctl --user start sway-session.target"
];
variables = ["--all"];
};
config = {
bars = [];
modifier = modifier;
colors = {
focused.indicator = lib.mkForce focused;
focusedInactive.indicator = lib.mkForce unfocused;
placeholder.indicator = lib.mkForce unfocused;
unfocused.indicator = lib.mkForce unfocused;
urgent.indicator = lib.mkForce urgent;
};
defaultWorkspace = "workspace number 1";
floating.criteria = [
{app_id = ".blueman-manager-wrapped";}
{app_id = "blueberry.py";}
{app_id = "com.github.wwmm.easyeffects";}
{app_id = "nm-connection-editor";}
{app_id = "pavucontrol";}
{app_id = "solaar";}
{title = "Open File";}
{title = "Open Folder";}
{window_role = "bubble";}
{window_role = "dialog";}
{window_role = "pop-up";}
{window_type = "dialog";}
];
focus = {
followMouse = "always";
newWindow = "focus";
};
gaps = {
inner = 5;
outer = 6;
};
input = {
"type:touchpad" = {
click_method = "clickfinger";
dwt = "enabled";
natural_scroll = "enabled";
scroll_method = "two_finger";
tap = "enabled";
tap_button_map = "lrm";
};
"type:keyboard" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
};
keybindings =
{
"${modifier}+B" = "exec ${lib.getExe cfg.defaultApps.webBrowser}";
"${modifier}+C" = "kill";
"${modifier}+Comma" = "workspace prev";
"${modifier}+Control+L" = "exec ${lib.getExe' pkgs.systemd "loginctl"} lock-session";
"${modifier}+E" = "exec ${lib.getExe cfg.defaultApps.editor}";
"${modifier}+F" = "exec ${lib.getExe cfg.defaultApps.fileManager}";
"${modifier}+F11" = "exec pkill -SIGUSR1 waybar"; # Show/hide waybar
"${modifier}+M" = ''exec ${lib.getExe config.programs.rofi.package} -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"'';
"${modifier}+Period" = "workspace next";
"${modifier}+R" = "exec ${lib.getExe config.programs.rofi.package} -show combi";
"${modifier}+S" = "scratchpad show";
"${modifier}+Shift+Backslash" = "layout toggle split";
"${modifier}+Shift+Comma" = "move container to workspace prev; workspace prev";
"${modifier}+Shift+G" = "layout toggle splitv tabbed";
"${modifier}+Shift+Period" = "move container to workspace next; workspace next";
"${modifier}+Shift+R" = "exec ${lib.getExe config.programs.rofi.package} -show run";
"${modifier}+Shift+S" = "move scratchpad";
"${modifier}+Shift+Tab" = "exec ${lib.getExe config.programs.rofi.package} -show window";
"${modifier}+Shift+V" = "floating toggle";
"${modifier}+Shift+W" = "fullscreen toggle";
"${modifier}+T" = "exec ${lib.getExe cfg.defaultApps.terminal}";
"Control+F12" = "exec ${helpers.screenshot}";
"Ctrl+Mod1+M" = "mode move";
"Ctrl+Mod1+R" = "mode resize";
"PRINT" = "exec ${helpers.screenshot}";
}
// builtins.listToAttrs (
builtins.concatMap (workspace: [
{
name = "${modifier}+${toString workspace}";
value = "workspace number ${toString workspace}";
}
{
name = "${modifier}+Shift+${toString workspace}";
value = "move container to workspace number ${toString workspace}; workspace ${toString workspace}";
}
]) [1 2 3 4 5 6 7 8 9]
)
// lib.attrsets.concatMapAttrs
(key: direction: {
"${modifier}+${key}" = "focus ${direction}";
"${modifier}+Shift+${key}" = "move ${direction}";
"${modifier}+Control+Shift+${key}" = "move workspace to output ${direction}";
})
cfg.desktop.windowManagerBinds;
modes = {
move =
{
Comma = "move container to workspace prev; workspace prev";
Escape = "mode default";
Period = "move container to workspace next; workspace next";
S = "move scratchpad";
}
// builtins.listToAttrs (
builtins.concatMap (workspace: [
{
name = toString workspace;
value = "move container to workspace number ${toString workspace}; workspace ${toString workspace}";
}
]) [1 2 3 4 5 6 7 8 9]
)
// lib.attrsets.concatMapAttrs
(key: direction: {"${key}" = "move ${direction}";})
cfg.desktop.windowManagerBinds;
resize = {
Escape = "mode default";
Left = "resize shrink width 10 px";
Down = "resize grow height 10 px";
Up = "resize shrink height 10 px";
Right = "resize grow width 10 px";
};
};
startup = [
{command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";}
{command = lib.getExe pkgs.autotiling;}
];
window = {
titlebar = false;
commands = [
{
command = "border pixel 4"; # Workaround for libadwaita + CSD apps not having borders when floating.
criteria = {all = true;};
}
{
command = "floating enable; sticky toggle; resize 35ppt 10ppt";
criteria = {
title = "^Picture-in-Picture$";
app_id = "firefox";
};
}
{
command = "focus; sticky toggle";
criteria = {app_id = "gcr-prompter";};
}
{
command = "focus; sticky toggle";
criteria = {app_id = "polkit-gnome-authentication-agent-1";};
}
{
command = "floating enable; resize set 40ppt 20ppt; move position center";
criteria = {title = "File Operation Progress";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {title = "Open Folder";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {title = "Open File";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {app_id = "blueberry.py";};
}
{
command = "resize set 60ppt 80ppt; move position center";
criteria = {app_id = "solaar";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {app_id = ".blueman-manager-wrapped";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {app_id = "nm-connection-editor";};
}
{
command = "resize set 40ppt 60ppt; move position center";
criteria = {app_id = "pavucontrol";};
}
];
};
workspaceAutoBackAndForth = true;
};
extraConfig =
''
bindsym --locked XF86MonBrightnessUp exec ${helpers.brightness.up}
bindsym --locked XF86MonBrightnessDown exec ${helpers.brightness.down}
bindsym --locked XF86AudioRaiseVolume exec ${helpers.volume.up}
bindsym --locked XF86AudioLowerVolume exec ${helpers.volume.down}
bindsym --locked XF86AudioMute exec ${helpers.volume.mute}
bindsym --locked XF86AudioMicMute exec ${helpers.volume.micMute}
bindsym --locked XF86AudioPlay exec ${helpers.media.play}
bindsym --locked XF86AudioPrev exec ${helpers.media.prev}
bindsym --locked XF86AudioNext exec ${helpers.media.next}
mode "move" {
bindgesture pinch:inward+down move down
bindgesture pinch:inward+left move left
bindgesture pinch:inward+right move right
bindgesture pinch:inward+up move up
bindgesture swipe:down move container to workspace prev; workspace prev
bindgesture swipe:left move container to workspace next; workspace next
bindgesture swipe:right move container to workspace prev; workspace prev
bindgesture swipe:up move container to workspace next; workspace next
}
bindgesture swipe:down workspace prev
bindgesture swipe:left workspace next
bindgesture swipe:right workspace prev
bindgesture swipe:up workspace next
bindswitch --reload --locked lid:on exec ${scripts.clamshell} on
bindswitch --reload --locked lid:off exec ${scripts.clamshell} off
default_border pixel 4
default_floating_border pixel 4
''
+ lib.strings.optionalString (config.wayland.windowManager.sway.package
== pkgs.swayfx) ''
blur enable
blur_passes 2
blur_radius 8
# corner_radius ${toString cfg.theme.borders.radius}
shadow_blur_radius 8
shadow_color ${config.lib.stylix.colors.withHashtag.base00}
shadow_offset 4 4
shadows enable
shadows_on_csd disable
default_dim_inactive 0.05
layer_effects gtk-layer-shell blur enable
layer_effects gtk-layer-shell blur_ignore_transparent enable
layer_effects launcher blur enable
layer_effects launcher blur_ignore_transparent enable
layer_effects logout_dialog blur enable
layer_effects notifications blur enable
layer_effects notifications blur_ignore_transparent enable
layer_effects rofi blur enable
layer_effects rofi blur_ignore_transparent enable
layer_effects swaybar blur enable
layer_effects swaybar blur_ignore_transparent enable
layer_effects swayosd blur enable
layer_effects swayosd blur_ignore_transparent enable
layer_effects waybar blur enable
layer_effects waybar blur_ignore_transparent enable
'';
}

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf (config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.sway.enable) { config = lib.mkIf (config.ar.home.desktop.hyprland.enable) {
ar.home = { ar.home = {
apps = { apps = {
kitty.enable = lib.mkDefault true; kitty.enable = lib.mkDefault true;
@ -16,7 +16,6 @@
hypridle.enable = lib.mkDefault config.ar.home.desktop.hyprland.enable; hypridle.enable = lib.mkDefault config.ar.home.desktop.hyprland.enable;
mako.enable = lib.mkDefault true; mako.enable = lib.mkDefault true;
pipewire-inhibit.enable = lib.mkDefault true; pipewire-inhibit.enable = lib.mkDefault true;
swayidle.enable = lib.mkDefault config.ar.home.desktop.sway.enable;
swayosd.enable = lib.mkDefault true; swayosd.enable = lib.mkDefault true;
waybar.enable = lib.mkDefault true; waybar.enable = lib.mkDefault true;
}; };

View file

@ -96,7 +96,7 @@ in {
desktop = { desktop = {
autoSuspend = lib.mkOption { autoSuspend = lib.mkOption {
description = "Whether to autosuspend on idle."; description = "Whether to autosuspend on idle.";
default = cfg.desktop.hyprland.enable || cfg.desktop.sway.enable; default = cfg.desktop.hyprland.enable;
type = lib.types.bool; type = lib.types.bool;
}; };
@ -142,14 +142,6 @@ in {
type = lib.types.bool; type = lib.types.bool;
}; };
sway = {
enable = lib.mkOption {
description = "Sway with full desktop session components.";
default = osConfig.ar.desktop.sway.enable;
type = lib.types.bool;
};
};
windowManagerBinds = lib.mkOption { windowManagerBinds = lib.mkOption {
description = "Default binds for window management."; description = "Default binds for window management.";
@ -201,7 +193,6 @@ in {
pipewire-inhibit.enable = lib.mkEnableOption "Inhibit idle when audio is playing with Pipewire."; pipewire-inhibit.enable = lib.mkEnableOption "Inhibit idle when audio is playing with Pipewire.";
randomWallpaper.enable = lib.mkEnableOption "Lightweight swaybg-based random wallpaper daemon."; randomWallpaper.enable = lib.mkEnableOption "Lightweight swaybg-based random wallpaper daemon.";
swayidle.enable = lib.mkEnableOption "Swayidle idle daemon.";
swayosd.enable = lib.mkEnableOption "OSD for brightness and volume keys."; swayosd.enable = lib.mkEnableOption "OSD for brightness and volume keys.";
waybar.enable = lib.mkEnableOption "Waybar wayland panel."; waybar.enable = lib.mkEnableOption "Waybar wayland panel.";
}; };

View file

@ -7,7 +7,6 @@
./mpd ./mpd
./pipewire-inhibit ./pipewire-inhibit
./randomWallpaper ./randomWallpaper
./swayidle
./swayosd ./swayosd
./waybar ./waybar
]; ];

View file

@ -13,9 +13,9 @@ in {
}; };
systemd.user.services.gammastep = { systemd.user.services.gammastep = {
Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"); Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target");
Service.Restart = lib.mkForce "no"; Service.Restart = lib.mkForce "no";
Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
}; };
}; };
} }

View file

@ -36,7 +36,7 @@ in {
systemd.user.services.mako = { systemd.user.services.mako = {
Unit = { Unit = {
After = "graphical-session.target"; After = "graphical-session.target";
BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
Description = "Lightweight Wayland notification daemon"; Description = "Lightweight Wayland notification daemon";
Documentation = "man:mako(1)"; Documentation = "man:mako(1)";
PartOf = "graphical-session.target"; PartOf = "graphical-session.target";
@ -51,7 +51,7 @@ in {
Type = "dbus"; Type = "dbus";
}; };
Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
}; };
}; };
} }

View file

@ -10,7 +10,7 @@ in {
systemd.user.services.pipewire-inhibit-idle = { systemd.user.services.pipewire-inhibit-idle = {
Unit = { Unit = {
After = "graphical-session.target"; After = "graphical-session.target";
BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
Description = "inhibit idle when audio is playing with Pipewire."; Description = "inhibit idle when audio is playing with Pipewire.";
PartOf = "graphical-session.target"; PartOf = "graphical-session.target";
}; };
@ -20,7 +20,7 @@ in {
Restart = "no"; Restart = "no";
}; };
Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
}; };
}; };
} }

View file

@ -14,7 +14,7 @@ in {
systemd.user.services.randomWallpaper = { systemd.user.services.randomWallpaper = {
Unit = { Unit = {
After = "graphical-session.target"; After = "graphical-session.target";
BindsTo = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (config.ar.home.desktop.sway.enable) "sway-session.target"; BindsTo = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target";
Description = "Lightweight swaybg-based random wallpaper daemon."; Description = "Lightweight swaybg-based random wallpaper daemon.";
PartOf = "graphical-session.target"; PartOf = "graphical-session.target";
}; };
@ -36,7 +36,7 @@ in {
TasksMax = "infinity"; TasksMax = "infinity";
}; };
Install.WantedBy = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (config.ar.home.desktop.sway.enable) "sway-session.target"; Install.WantedBy = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target";
}; };
}; };
} }

View file

@ -1,76 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.ar.home;
in {
config = lib.mkIf cfg.services.swayidle.enable {
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "swaylock && sleep 2";
}
{
event = "lock";
command = "swaylock";
}
];
timeouts =
[
{
timeout = 30;
command = "brightnessctl -sd chromeos::kbd_backlight set 0";
resumeCommand = "brightnessctl -rd chromeos::kbd_backlight";
}
{
timeout = 120;
command = "brightnessctl -s set 10";
resumeCommand = "brightnessctl -r";
}
]
++ lib.optional cfg.desktop.autoSuspend {
timeout = 600;
command = "systemctl suspend";
}
++ lib.optional (!cfg.desktop.autoSuspend)
{
timeout = 600;
command = "swaylock";
}
++ lib.optional (!cfg.desktop.autoSuspend && cfg.desktop.sway.enable)
{
timeout = 630;
command = "swaymsg \"output * dpms off\"";
resumeCommand = "swaymsg \"output * dpms on\"";
};
};
systemd.user.services.swayidle = {
Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.sway.enable) "sway-session.target");
Service = {
Environment = lib.mkForce [
"PATH=${
lib.makeBinPath ((with pkgs; [
bash
brightnessctl
coreutils
swaylock
systemd
])
++ lib.optional (cfg.desktop.sway.enable) config.wayland.windowManager.sway.package)
}"
];
Restart = lib.mkForce "no";
};
Unit.BindsTo = lib.optional (cfg.desktop.sway.enable) "sway-session.target";
};
};
}

View file

@ -17,9 +17,9 @@ in {
}; };
systemd.user.services.swayosd = { systemd.user.services.swayosd = {
Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"); Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target");
Service.Restart = lib.mkForce "no"; Service.Restart = lib.mkForce "no";
Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
}; };
xdg.configFile."swayosd/style.css" = { xdg.configFile."swayosd/style.css" = {

View file

@ -24,8 +24,7 @@ in {
rofi-power-menu rofi-power-menu
systemd systemd
]) ])
++ lib.optional (cfg.desktop.hyprland.enable) config.wayland.windowManager.hyprland.package ++ lib.optional (cfg.desktop.hyprland.enable) config.wayland.windowManager.hyprland.package;
++ lib.optional (cfg.desktop.sway.enable) config.wayland.windowManager.sway.package;
programs.waybar = { programs.waybar = {
enable = true; enable = true;
@ -39,15 +38,11 @@ in {
modules-left = modules-left =
["group/tablet"] ["group/tablet"]
++ lib.optionals (cfg.desktop.hyprland.enable) ++ lib.optionals (cfg.desktop.hyprland.enable)
["hyprland/submap"] ["hyprland/submap"];
++ lib.optionals (cfg.desktop.sway.enable)
["sway/scratchpad" "sway/mode"];
modules-center = modules-center =
lib.optionals (cfg.desktop.hyprland.enable) lib.optionals (cfg.desktop.hyprland.enable)
["hyprland/workspaces"] ["hyprland/workspaces"];
++ lib.optionals (cfg.desktop.sway.enable)
["sway/workspaces"];
modules-right = [ modules-right = [
"tray" "tray"
@ -73,34 +68,8 @@ in {
on-click = ''hyprctl dispatch submap reset''; on-click = ''hyprctl dispatch submap reset'';
}; };
"sway/workspaces" = {
all-outputs = true;
format = "{icon} {name}";
format-icons = {
default = "󰝥";
focused = "󰪥";
urgent = "";
};
sort-by = "id";
};
"sway/mode" = {
on-click = ''swaymsg mode default'';
};
"sway/scratchpad" = {
format = "{icon} {count}";
format-icons = ["" ""];
on-click = "swaymsg scratchpad show";
show-empty = false;
tooltip = true;
tooltip-format = "{app}: {title}";
};
"custom/app-close" = { "custom/app-close" = {
on-click = ''hyprctl dispatch killactive || swaymsg kill''; on-click = ''hyprctl dispatch killactive'';
format = "󰅗"; format = "󰅗";
tooltip-format = "Close the focused window."; tooltip-format = "Close the focused window.";
}; };
@ -364,11 +333,11 @@ in {
}; };
systemd.user.services.waybar = { systemd.user.services.waybar = {
Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"); Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target");
Service.Restart = lib.mkForce "no"; Service.Restart = lib.mkForce "no";
Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target";
}; };
xdg.configFile."nwg-drawer/drawer.css".text = '' xdg.configFile."nwg-drawer/drawer.css".text = ''

View file

@ -29,7 +29,7 @@ in {
targets.gtk.extraCss = builtins.concatStringsSep "\n" [ targets.gtk.extraCss = builtins.concatStringsSep "\n" [
(lib.optionalString ( (lib.optionalString (
(cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) && (config.stylix.polarity == "light") && !cfg.desktop.gnome.enable (cfg.desktop.hyprland.enable) && (config.stylix.polarity == "light") && !cfg.desktop.gnome.enable
) '' ) ''
tooltip { tooltip {
&.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); } &.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); }

View file

@ -1,5 +1,4 @@
{ {
config,
lib, lib,
pkgs, pkgs,
... ...
@ -7,61 +6,6 @@
imports = [./laptop.nix]; imports = [./laptop.nix];
wayland.windowManager = { wayland.windowManager = {
sway.config = {
floating.criteria = [{app_id = "Bitwarden";} {app_id = "org.keepassxc.KeePassXC";}];
gaps = {
# smartBorders = "on";
# smartGaps = true;
};
input."type:keyboard".xkb_options = "caps:ctrl_modifier";
keybindings = {
"${config.wayland.windowManager.sway.config.modifier}+N" = "exec ${lib.getExe' pkgs.obsidian "obsidian"}";
"${config.wayland.windowManager.sway.config.modifier}+P" = "exec ${lib.getExe pkgs.rofi-rbw-wayland}";
};
startup = [
{command = lib.getExe config.ar.home.defaultApps.editor;}
{command = lib.getExe config.ar.home.defaultApps.webBrowser;}
{command = lib.getExe pkgs.fractal;}
{command = lib.getExe config.programs.thunderbird.package;}
{command = lib.getExe' pkgs.obsidian "obsidian";}
];
output = {
"Guangxi Century Innovation Display Electronics Co., Ltd 27C1U-D 0000000000001" = {
scale = "1.5";
pos = "-2560 0";
};
"HP Inc. HP 24mh 3CM037248S " = {
scale = "1.0";
pos = "-1920 0";
};
};
window.commands = [
{
command = "resize set 80ppt 80ppt; move position center;";
criteria = {app_id = "Bitwarden";};
}
{
command = "resize set 80ppt 80ppt; move position center; sticky toggle;";
criteria = {app_id = "org.keepassxc.KeePassXC";};
}
{
command = "move to scratchpad";
criteria = {app_id = "org.gnome.Fractal";};
}
{
command = "move to scratchpad";
criteria = {app_id = "vesktop";};
}
];
};
hyprland.settings = { hyprland.settings = {
bind = [ bind = [
"SUPER,N,exec,${lib.getExe' pkgs.obsidian "obsidian"}" "SUPER,N,exec,${lib.getExe' pkgs.obsidian "obsidian"}"

View file

@ -6,20 +6,6 @@
}: { }: {
config = lib.mkIf config.ar.home.laptopMode { config = lib.mkIf config.ar.home.laptopMode {
wayland.windowManager = { wayland.windowManager = {
sway.config = {
assigns = {
"workspace 1:web" = [{app_id = "firefox";} {app_id = "brave-browser";}];
"workspace 2:note" = [{app_id = "obsidian";}];
"workspace 3:code" = [{app_id = "codium-url-handler";} {app_id = "dev.zed.Zed";}];
"workspace 4:mail" = [{app_id = "betterbird";} {app_id = "thunderbird";}];
"workspace 5:work" = [{app_id = "firework";}];
};
startup = [
{command = "sleep 2 && ${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} workspace 1:web";}
];
};
hyprland.settings = { hyprland.settings = {
exec-once = [ exec-once = [
"sleep 2 && hyprctl dispatch workspace 2 && sleep 2 && hyprctl dispatch workspace 3 && sleep 2 && hyprctl dispatch workspace 4 && sleep 2 && hyprctl dispatch workspace 1;" "sleep 2 && hyprctl dispatch workspace 2 && sleep 2 && hyprctl dispatch workspace 3 && sleep 2 && hyprctl dispatch workspace 4 && sleep 2 && hyprctl dispatch workspace 1;"

View file

@ -41,24 +41,6 @@ self: {
hyprland.settings = { hyprland.settings = {
bind = ["SUPER,P,exec,${lib.getExe pkgs.rofi-rbw-wayland}"]; bind = ["SUPER,P,exec,${lib.getExe pkgs.rofi-rbw-wayland}"];
}; };
sway.config = {
input."type:keyboard" = lib.mkForce {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
keybindings = {
"${config.wayland.windowManager.sway.config.modifier}+P" = "exec ${lib.getExe pkgs.rofi-rbw-wayland}";
};
output = {
"Guangxi Century Innovation Display Electronics Co., Ltd 27C1U-D 0000000000001" = {
scale = "1.5";
pos = "-2560 0";
};
};
};
}; };
xdg.mimeApps = { xdg.mimeApps = {

View file

@ -2,8 +2,6 @@
home-manager = { home-manager = {
sharedModules = [ sharedModules = [
{ {
wayland.windowManager.sway.config.output = {"BOE 0x095F Unknown".scale = "1.5";};
ar.home = { ar.home = {
desktop.hyprland.laptopMonitors = ["desc:BOE 0x095F,preferred,auto,1.566667"]; desktop.hyprland.laptopMonitors = ["desc:BOE 0x095F,preferred,auto,1.566667"];

View file

@ -2,13 +2,6 @@
home-manager = { home-manager = {
sharedModules = [ sharedModules = [
{ {
wayland.windowManager.sway.config.output = {
"eDP-1" = {
adaptive_sync = "on";
scale = "2.0";
};
};
ar.home = { ar.home = {
desktop.hyprland.laptopMonitors = ["desc:BOE NE135A1M-NY1,2880x1920@60, 0x0, 2, vrr, 0"]; desktop.hyprland.laptopMonitors = ["desc:BOE NE135A1M-NY1,2880x1920@60, 0x0, 2, vrr, 0"];

View file

@ -12,7 +12,6 @@
"file:///mnt/Archive" "file:///mnt/Archive"
]; ];
wayland.windowManager.sway.config.output = {"LG Electronics LG ULTRAWIDE 311NTAB5M720".scale = "1.0";};
xdg.userDirs.music = "/mnt/Media/Music"; xdg.userDirs.music = "/mnt/Media/Music";
ar.home = { ar.home = {

View file

@ -2,13 +2,6 @@
home-manager = { home-manager = {
sharedModules = [ sharedModules = [
{ {
wayland.windowManager.sway.config.output = {
"eDP-2" = {
adaptive_sync = "on";
scale = "1.25";
};
};
ar.home = { ar.home = {
desktop.hyprland.laptopMonitors = ["desc:China Star Optoelectronics Technology Co. Ltd MNG007QA1-1,1920x1200@165, 0x0, 1.25, vrr, 1"]; desktop.hyprland.laptopMonitors = ["desc:China Star Optoelectronics Technology Co. Ltd MNG007QA1-1,1920x1200@165, 0x0, 1.25, vrr, 1"];

View file

@ -2,8 +2,6 @@
home-manager = { home-manager = {
sharedModules = [ sharedModules = [
{ {
wayland.windowManager.sway.config.output = {"LG Display 0x0569 Unknown".scale = "1.25";};
ar.home = { ar.home = {
desktop.hyprland.laptopMonitors = ["desc:LG Display 0x0569,preferred,auto,1.25"]; desktop.hyprland.laptopMonitors = ["desc:LG Display 0x0569,preferred,auto,1.25"];

View file

@ -9,7 +9,6 @@
./gnome ./gnome
./hyprland ./hyprland
./kde ./kde
./sway
./waylandComp.nix ./waylandComp.nix
]; ];
@ -19,7 +18,6 @@
|| config.ar.desktop.hyprland.enable || config.ar.desktop.hyprland.enable
|| config.ar.desktop.kde.enable || config.ar.desktop.kde.enable
|| config.ar.desktop.steam.enable || config.ar.desktop.steam.enable
|| config.ar.desktop.sway.enable
) { ) {
boot = { boot = {
consoleLogLevel = 0; consoleLogLevel = 0;

View file

@ -1,12 +0,0 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.ar.desktop.sway.enable {
programs.sway = {
enable = true;
extraPackages = lib.mkDefault [];
};
};
}

View file

@ -4,7 +4,7 @@
config, config,
... ...
}: { }: {
config = lib.mkIf (config.ar.desktop.hyprland.enable || config.ar.desktop.sway.enable) { config = lib.mkIf (config.ar.desktop.hyprland.enable) {
programs = { programs = {
gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3;
}; };
@ -38,29 +38,6 @@
session required pam_unix.so # unix (order 10200) session required pam_unix.so # unix (order 10200)
''; '';
}; };
swaylock = {
text = ''
# Account management.
account required pam_unix.so # unix (order 10900)
# Authentication management.
auth sufficient pam_unix.so likeauth try_first_pass likeauth nullok # unix (order 11500)
${
lib.strings.optionalString config.services.fprintd.enable
"auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so # fprintd (order 11300)"
}
auth required pam_deny.so # deny (order 12300)
# Password management.
password sufficient pam_unix.so nullok yescrypt # unix (order 10200)
# Session management.
session required pam_env.so conffile=/etc/pam/environment readenv=0 # env (order 10100)
session required pam_unix.so # unix (order 10200)
'';
};
}; };
}; };
} }

View file

@ -34,7 +34,6 @@
hyprland.enable = lib.mkEnableOption "Hyprland wayland session."; hyprland.enable = lib.mkEnableOption "Hyprland wayland session.";
kde.enable = lib.mkEnableOption "KDE desktop session."; kde.enable = lib.mkEnableOption "KDE desktop session.";
steam.enable = lib.mkEnableOption "Steam + Gamescope session."; steam.enable = lib.mkEnableOption "Steam + Gamescope session.";
sway.enable = lib.mkEnableOption "Sway wayland session.";
}; };
laptopMode = lib.mkEnableOption "Enable laptop configuration."; laptopMode = lib.mkEnableOption "Enable laptop configuration.";