dualmonitors
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dualmonitors [2026/10/24 12:35] – created karcio | dualmonitors [2026/10/24 12:46] (current) – karcio | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | - Find your monitor names | + | ====== Set dual monitors ====== |
| + | ==== Find your monitor names ==== | ||
| < | < | ||
| swaymsg -t get_outputs | swaymsg -t get_outputs | ||
| </ | </ | ||
| You'll see names similar to: | You'll see names similar to: | ||
| - | * eDP-1 — laptop screen | + | |
| - | * HDMI-A-1 — external monitor | + | |
| - | | + | |
| + | ==== Create two scripts | ||
| Laptop only — create ~/ | Laptop only — create ~/ | ||
| - | bash | ||
| + | < | ||
| #!/bin/sh | #!/bin/sh | ||
| swaymsg ' | swaymsg ' | ||
| swaymsg ' | swaymsg ' | ||
| + | </ | ||
| Both monitors — create ~/ | Both monitors — create ~/ | ||
| - | bash | ||
| + | < | ||
| #!/bin/sh | #!/bin/sh | ||
| + | |||
| + | # Enable both monitors | ||
| swaymsg ' | swaymsg ' | ||
| swaymsg ' | swaymsg ' | ||
| - | swaymsg ' | ||
| - | Replace the output names with yours. The 1920 position is just an example; adjust it to match your laptop screen' | + | # Laptop screen: right |
| + | swaymsg ' | ||
| + | |||
| + | # Samsung monitor: left | ||
| + | swaymsg ' | ||
| + | </ | ||
| + | |||
| + | Replace the output names with yours. The 2560 position is just an example; adjust it to match your laptop screen' | ||
| Make both scripts executable: | Make both scripts executable: | ||
| - | bash | ||
| + | < | ||
| chmod +x ~/ | chmod +x ~/ | ||
| + | </ | ||
| Sway supports enabling and disabling individual outputs this way. | Sway supports enabling and disabling individual outputs this way. | ||
| - | GitHub | + | |
| - | - Ordered List Item3. | + | ==== Assign shortcuts |
| Add these lines to ~/ | Add these lines to ~/ | ||
| - | bash | ||
| + | < | ||
| bindsym $mod+F5 exec ~/ | bindsym $mod+F5 exec ~/ | ||
| bindsym $mod+F6 exec ~/ | bindsym $mod+F6 exec ~/ | ||
| + | </ | ||
| Reload Sway: | Reload Sway: | ||
| - | bash | ||
| + | < | ||
| swaymsg reload | swaymsg reload | ||
| + | </ | ||
| Now you can use: | Now you can use: | ||
| - | | + | * **Super + F5** — laptop screen only |
| - | + | * **Super + F6** — laptop and external monitor | |
| - | | + | |
dualmonitors.1792845320.txt.gz · Last modified: by karcio
