User Tools

Site Tools


dualmonitors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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