Skip to content

Commit 9afc82e

Browse files
authored
docs: add a faq section (#21)
## What does this PR do? Add FAQ section. ## Related issues Closes #19 Closes #20
2 parents 21126e6 + f2c876a commit 9afc82e

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed

README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ An event-driven service that automatically manages Hyprland monitor configuratio
6565
* [Development Commands](#development-commands)
6666
* [Development Workflow](#development-workflow)
6767
* [Release Candidates](#release-candidates)
68+
* [FAQ](#faq)
69+
* [How do I assign workspaces to specific monitors?](#how-do-i-assign-workspaces-to-specific-monitors)
70+
* [How do I use the TUI to create or edit profiles?](#how-do-i-use-the-tui-to-create-or-edit-profiles)
71+
* [Can I use the TUI without running the hyprdynamicmonitors daemon?](#can-i-use-the-tui-without-running-the-hyprdynamicmonitors-daemon)
72+
* [Why are my comments becoming part of the configuration in templates?](#why-are-my-comments-becoming-part-of-the-configuration-in-templates)
6873
* [Alternative software](#alternative-software)
6974
<!--te-->
7075

@@ -879,6 +884,156 @@ To install the RC version from AUR:
879884
yay -S hyprdynamicmonitors-rc-bin
880885
```
881886

887+
## FAQ
888+
889+
### How do I assign workspaces to specific monitors?
890+
891+
You can include workspace assignments directly in your profile configuration files. HyprDynamicMonitors generates or links Hyprland configuration files, so any valid Hyprland configuration syntax works.
892+
893+
**Example with static configuration:**
894+
895+
In your profile configuration file (e.g., `hyprconfigs/triple-monitor.conf`):
896+
```hyprconfig
897+
# Monitor configuration
898+
monitor=desc:BOE 0x0C6B,preferred,0x0,1
899+
monitor=desc:LG Electronics LG ULTRAWIDE 408NTVSDT319,preferred,1920x0,1
900+
monitor=desc:Dell Inc. DELL P2222H B2RY1H3,preferred,3840x0,1
901+
902+
# Workspace assignments
903+
workspace=1,monitor:desc:BOE 0x0C6B,default:true
904+
workspace=2,monitor:desc:LG Electronics LG ULTRAWIDE 408NTVSDT319,default:true
905+
workspace=3,monitor:desc:Dell Inc. DELL P2222H B2RY1H3,default:true
906+
```
907+
908+
**Example with templates:**
909+
910+
In `hyprconfigs/dual-monitor.go.tmpl`:
911+
```go
912+
{{- $laptop := index .MonitorsByTag "laptop" -}}
913+
{{- $external := index .MonitorsByTag "external" -}}
914+
monitor={{$laptop.Name}},preferred,0x0,1
915+
monitor={{$external.Name}},preferred,1920x0,1
916+
917+
workspace=1,monitor:{{$laptop.Name}},default:true
918+
workspace=2,monitor:{{$external.Name}},default:true
919+
workspace=3,monitor:{{$external.Name}}
920+
```
921+
922+
You can also use the TUI (`hyprdynamicmonitors tui`) to create and edit profiles interactively.
923+
924+
### How do I use the TUI to create or edit profiles?
925+
926+
The TUI provides an interactive way to configure monitors and manage profiles. The workflow involves two main views:
927+
928+
**Step 1: Configure monitors in the Monitors view**
929+
- Adjust your monitor settings (resolution, position, scale, etc.)
930+
- Apply the configuration with `a` to test it in Hyprland
931+
- Once satisfied with the layout, proceed to save it as a profile
932+
933+
**Step 2: Switch to the HDM Profile view**
934+
- Press `Tab` to switch between Monitors view and HDM Profile view
935+
- Choose to either:
936+
- **Edit existing profile**: Press `a` to apply the current monitor configuration to the selected profile
937+
- **Create new profile**: Press `n` to create a new profile with the current monitor configuration
938+
939+
**Understanding the generated configuration:**
940+
941+
The TUI places generated configuration between comment markers in your profile config files:
942+
```hyprconfig
943+
# <<<<< TUI AUTO START
944+
monitor=eDP-1,2880x1920@120,0x0,1.5
945+
monitor=DP-1,3840x2160@60,2880x0,1
946+
# <<<<< TUI AUTO END
947+
```
948+
949+
You can add additional settings outside these markers, and they will be preserved across TUI updates. This is useful for:
950+
- Overriding specific settings
951+
- Adding workspace assignments
952+
- Including additional Hyprland configuration
953+
954+
**Manual editing:**
955+
956+
From the HDM Profile view, you can manually edit files using your `$EDITOR`:
957+
- Edit the profile configuration file (the Hyprland config)
958+
- Edit the HDM configuration file (the TOML config)
959+
960+
This allows you to fine-tune settings or add advanced configuration that the TUI doesn't directly support.
961+
962+
For more details, see the [TUI documentation](./docs/tui-help.md).
963+
964+
### Can I use the TUI without running the hyprdynamicmonitors daemon?
965+
966+
Yes, the TUI can be used standalone without the daemon running. However, functionality is limited:
967+
968+
**What works without the daemon:**
969+
- Experimenting with monitor configurations in the Monitors view
970+
- Applying configurations manually and ephemerally with `a` (changes are temporary until Hyprland restarts)
971+
- Testing different layouts and settings interactively
972+
973+
**What requires a valid configuration:**
974+
- Saving profiles to HyprDynamicMonitors configuration (HDM Profile view features)
975+
- Persisting monitor configurations that automatically apply on monitor connect/disconnect
976+
- Power state-based profile switching
977+
978+
**Typical standalone usage:**
979+
```bash
980+
# Use TUI to experiment with monitor layouts
981+
hyprdynamicmonitors tui
982+
983+
# Configure monitors interactively, apply with 'a' to test
984+
# Changes are applied to Hyprland but not persisted
985+
```
986+
987+
If you want to persist configurations created in the TUI, you need a valid HyprDynamicMonitors config file. You can start with a minimal config and build from there using the TUI's profile creation features.
988+
989+
### Why are my comments becoming part of the configuration in templates?
990+
991+
This is due to Go template whitespace trimming behavior. When you use `-}}`, it removes all whitespace (including newlines) after the template action.
992+
993+
**Problem example:**
994+
```go
995+
# auto generated by hyprdynamicmonitors
996+
997+
{{- $laptop := index .MonitorsByTag "LaptopMonitor" -}}
998+
{{- $external := index .MonitorsByTag "ExternalMonitor" -}}
999+
1000+
monitor={{$laptop.Name}}, disable
1001+
# change to your preferred external monitor config
1002+
monitor={{$external.Name}},preferred,0x0,1
1003+
```
1004+
1005+
The `-}}` after the variable definitions removes the newline, causing `monitor={{$laptop.Name}}, disable` to be pulled up into the comment above it, creating one long comment line.
1006+
1007+
**Solution 1: Remove trailing dash from the last template action**
1008+
```go
1009+
# auto generated by hyprdynamicmonitors
1010+
1011+
{{- $laptop := index .MonitorsByTag "LaptopMonitor" -}}
1012+
{{- $external := index .MonitorsByTag "ExternalMonitor" }}
1013+
1014+
monitor={{$laptop.Name}}, disable
1015+
# change to your preferred external monitor config
1016+
monitor={{$external.Name}},preferred,0x0,1
1017+
```
1018+
1019+
**Solution 2: Define all variables at the start, then add content**
1020+
```go
1021+
{{- $laptop := index .MonitorsByTag "LaptopMonitor" -}}
1022+
{{- $external := index .MonitorsByTag "ExternalMonitor" -}}
1023+
1024+
1025+
# auto generated by hyprdynamicmonitors
1026+
# change to your preferred external monitor config
1027+
monitor={{$laptop.Name}}, disable
1028+
monitor={{$external.Name}},preferred,0x0,1
1029+
```
1030+
1031+
**Key points:**
1032+
- `-}}` trims all whitespace **after** the action, including newlines
1033+
- This can cause the next line to merge with whatever comes before the template action
1034+
- Use `}}` (without trailing dash) on the last variable definition before your config
1035+
- Or group all variable definitions at the top, separated from config with blank lines
1036+
8821037
## Alternative software
8831038

8841039
Most similar tools are more generic, working with any Wayland compositor. In contrast, `hyprdynamicmonitors` is specifically designed for Hyprland (using its IPC) but provides several advantages:

0 commit comments

Comments
 (0)