feat(home): Auto-open term and browser

This commit is contained in:
punkfairie 2025-03-01 10:20:25 -08:00
parent 8fbf5eb6ce
commit ae92090653
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
2 changed files with 47 additions and 25 deletions

View file

@ -4,16 +4,10 @@ in {
marleyos = { marleyos = {
bundles.desktop = enabled; bundles.desktop = enabled;
# wayland.hyprland = { wayland.niri = {
# enable = true; enable = true;
# monitors = { monitors = ["DP-1" "HDMI-A-1"];
# "DP-1" = "desc:Apple Computer Inc LED Cinema 2A91946Z0K0, 1920x1200, 0x0, 1"; };
# "HDMI-A-1" = "desc:Lenovo Group Limited LT2252p Wide 6V8ACF74, 1680x1050, 1920x0, 1";
# };
# mainMonitor = "DP-1";
# };
wayland.niri = enabled;
}; };
home.stateVersion = "24.05"; home.stateVersion = "24.05";

View file

@ -7,6 +7,12 @@
in { in {
options.marleyos.wayland.niri = { options.marleyos.wayland.niri = {
enable = lib.mkEnableOption "niri"; enable = lib.mkEnableOption "niri";
monitors = lib.mkOption {
type = with lib.types; nullOr (listOf str);
default = null;
description = "The monitors to configure";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -37,6 +43,13 @@ in {
prefer-no-csd = true; prefer-no-csd = true;
hotkey-overlay.skip-at-startup = true; hotkey-overlay.skip-at-startup = true;
spawn-at-startup = let
inherit (config.marleyos) apps;
in [
{command = ["sh" "-c" "${lib.getExe apps.terminal} -e tmux new -s main -A"];}
(cmd (lib.getExe apps.browser))
];
layout = { layout = {
gaps = 16; gaps = 16;
center-focused-column = "never"; center-focused-column = "never";
@ -76,21 +89,36 @@ in {
screenshot-path = "~/pictures/screenshots/%Y-%m-%d %H-%M-%S.png"; screenshot-path = "~/pictures/screenshots/%Y-%m-%d %H-%M-%S.png";
window-rules = [ window-rules =
[
{ {
matches = [{app-id = "^org\.wezfurlong\.wezterm$";}]; matches = [{app-id = "^org\.wezfurlong\.wezterm$";}];
default-column-width = {}; default-column-width.proportion = 1.0;
} }
{ {
matches = [ matches = [
{ {
app-id = "firefox$"; app-id = "^floorp$";
title = "^Picture-in-Picture$"; title = "^Picture-in-Picture$";
} }
{title = "^Picture in picture$";}
]; ];
open-floating = true; open-floating = true;
} }
]
++ (lib.optionals (cfg.monitors != null) [
{
matches = [
{
app-id = "^floorp$";
at-startup = true;
}
]; ];
open-on-output = builtins.elemAt cfg.monitors 1;
default-column-width.proportion = 1.0;
}
]);
binds = with config.lib.niri.actions; { binds = with config.lib.niri.actions; {
"Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Shift+Slash".action = show-hotkey-overlay;