From a88f3ec73a2d3b9bf1eaa7c3c76b8d2e4cb08d6a Mon Sep 17 00:00:00 2001
From: Tobias Reisinger <tobias@msrg.cc>
Date: Wed, 4 Dec 2024 00:36:21 +0100
Subject: [PATCH] Add laptop configs

---
 .bin/host-mode##hostname.serguzim-laptop      | 27 +++++++++++++++++++
 .config/autostart.toml                        |  3 +++
 .../env.d/99-local##hostname.serguzim-laptop  | 11 ++++++++
 ...me.serguzim-laptop,class.monitor-presenter |  7 +++++
 ...ost.conf##hostname.serguzim-laptop,default |  8 ++++++
 5 files changed, 56 insertions(+)
 create mode 100755 .bin/host-mode##hostname.serguzim-laptop
 create mode 100755 .config/env.d/99-local##hostname.serguzim-laptop
 create mode 100644 .config/hypr/host.conf##hostname.serguzim-laptop,class.monitor-presenter
 create mode 100644 .config/hypr/host.conf##hostname.serguzim-laptop,default

diff --git a/.bin/host-mode##hostname.serguzim-laptop b/.bin/host-mode##hostname.serguzim-laptop
new file mode 100755
index 0000000..014edb7
--- /dev/null
+++ b/.bin/host-mode##hostname.serguzim-laptop
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+modes="monitor-std
+monitor-presenter"
+
+host_mode_monitor () {
+    echo "Loading portalo monitor layout ${1:-std}"
+    yadm config --unset-all local.class monitor-*
+
+    if [ -n "$1" ]; then
+        yadm config --add local.class "$1"
+    fi
+
+    swaymsg reload
+}
+
+if [ -z "$1" ]; then
+    mode=$(echo "$modes" | $DMENU -p "mode")
+else 
+    mode=$1
+fi
+
+case $mode in
+    "monitor-std")  host_mode_monitor ;;
+    "monitor-"*)    host_mode_monitor "$mode" ;;
+    *)              echo "'$mode' is not a valid mode" ;;
+esac
diff --git a/.config/autostart.toml b/.config/autostart.toml
index 0bd1bf1..943cd78 100644
--- a/.config/autostart.toml
+++ b/.config/autostart.toml
@@ -1,6 +1,9 @@
 [hosts.portalo]
 groups = ['common', 'chat', 'messenger']
 
+[hosts.serguzim-laptop]
+groups = ['common']
+
 [apps.autotiling]
 command = 'autotiling'
 hosts = []
diff --git a/.config/env.d/99-local##hostname.serguzim-laptop b/.config/env.d/99-local##hostname.serguzim-laptop
new file mode 100755
index 0000000..1e6fe76
--- /dev/null
+++ b/.config/env.d/99-local##hostname.serguzim-laptop
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+export AUDIO_DEVICE=""
+export AUTOSTART_DISPLAY="Hyprland"
+
+export MONITOR_PRIMARY="primary"
+export MONITOR_SECONDARY="secondary"
+
+export BROWSER_CHROMIUM="brave"
+
+export DUNST_MONITOR="0"
diff --git a/.config/hypr/host.conf##hostname.serguzim-laptop,class.monitor-presenter b/.config/hypr/host.conf##hostname.serguzim-laptop,class.monitor-presenter
new file mode 100644
index 0000000..4810064
--- /dev/null
+++ b/.config/hypr/host.conf##hostname.serguzim-laptop,class.monitor-presenter
@@ -0,0 +1,7 @@
+$mon1 = eDP-1
+$mon2 = HDMI-A-2
+
+monitor = $mon1,1600x900@60,0x0,auto
+monitor = $mon2,preferred,1600x0,auto
+
+source = ~/.config/hypr/lib/7_3_ws_layout.conf
diff --git a/.config/hypr/host.conf##hostname.serguzim-laptop,default b/.config/hypr/host.conf##hostname.serguzim-laptop,default
new file mode 100644
index 0000000..42a5767
--- /dev/null
+++ b/.config/hypr/host.conf##hostname.serguzim-laptop,default
@@ -0,0 +1,8 @@
+$mon1 = eDP-1
+$mon2 = HDMI-A-2
+$mon = $mon1
+
+monitor = $mon1,1600x900@60,0x0,auto
+monitor = $mon2,disable
+
+source = ~/.config/hypr/lib/single_mon.conf