diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 6f55ef7..db12767 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -31,8 +31,6 @@ in gnome.gnome-keyring.enable = true; # For remembering nextcloud login, among other things gvfs.enable = true; # For Trash }; - programs.hyprland.enable = true; - programs.sway.enable = true; xdg.portal.enable = true; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 5c8554d..1cee5da 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -8,12 +8,10 @@ # nvidiaXineramaInfoOrder sets primary display # DFP-0 is default and would set left monitor, DVI-D-0, to be primary screenSection = '' - Option "metamodes" "DVI-D-0: 1920x1080 +0+0 {rotation=left}, HDMI-0: 1920x1080 +1080+420" + Option "metamodes" "DVI-D-0: 1920x1080 +0+0, HDMI-0: 1920x1080 +1920+0, DP-3: 1920x1080 +1920+0" Option "nvidiaXineramaInfoOrder" "DFP-1" ''; }; - # https://www.sven.de/dpi/ - services.xserver.dpi = 92; services.blueman.enable = true; diff --git a/hosts/desktop/i3/default.nix b/hosts/desktop/i3/default.nix index 4159f01..550dbb4 100644 --- a/hosts/desktop/i3/default.nix +++ b/hosts/desktop/i3/default.nix @@ -2,6 +2,17 @@ { xsession.windowManager.i3.config = { + startup = [ + { + command = let layout = pkgs.substituteAll { + src = ./layout.sh; + tree = ./tree.json; + isExecutable = true; + }; in "${layout}"; + always = true; + notification = false; + } + ]; workspaceOutputAssign = [ { output = "HDMI-0"; diff --git a/hosts/desktop/i3/layout.sh b/hosts/desktop/i3/layout.sh new file mode 100644 index 0000000..6507f64 --- /dev/null +++ b/hosts/desktop/i3/layout.sh @@ -0,0 +1,24 @@ +# Exit layout script if Firefox or Discord is open, +# i3 has been reloaded +pgrep firefox || pgrep Discord && exit 0 + +# Switch to workspace 1 +i3-msg workspace 1 +# Start up Firefox in the background +firefox & +# Give Firefox some time to start up +sleep 1 + +# Switch to workspace 2, load layout, and open blank space +i3-msg "workspace 2; append_layout @tree@; open" +# Move blank space to appropriate space, +# i3 layout files don't support blank space +for i in {1..4}; do + i3-msg move left +done +# Start up Discord in the background +discord & +# Open YouTube for music +firefox --new-window https://youtube.com +# Go back to primary workspace +i3-msg workspace 1 diff --git a/hosts/desktop/i3/tree.json b/hosts/desktop/i3/tree.json new file mode 100644 index 0000000..0215807 --- /dev/null +++ b/hosts/desktop/i3/tree.json @@ -0,0 +1,20 @@ +// vim:ts=4:sw=4:et +{ + "layout": "splitv", + "type": "con", + "nodes": [ + { + "swallows": [{ "class": "^firefox$" }], + "type": "con" + }, + { + "swallows": [{ "title": "Discord Updater" }], + "type": "con" + }, + { + "swallows": [{ "class": "^discord$" }], + "type": "con" + } + ] +} +