User Tools

Site Tools


dualmonitors

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dualmonitors [2026/10/24 12:37] – karciodualmonitors [2026/10/24 12:46] (current) – karcio
Line 1: Line 1:
 ====== Set dual monitors ====== ====== Set dual monitors ======
-  - Find your monitor names+==== Find your monitor names ==== 
 <code> <code>
 swaymsg -t get_outputs swaymsg -t get_outputs
Line 8: Line 9:
   * **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> <code>
Line 20: Line 20:
  
 Both monitors — create ~/.local/bin/dual-monitor: Both monitors — create ~/.local/bin/dual-monitor:
-bash+
 <code> <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'+ 
 +# Laptop screen: right 
 +swaymsg 'output eDP-1 position 0 0' 
 + 
 +# Samsung monitor: left 
 +swaymsg 'output HDMI-A-1 position -2560 0'
 </code> </code>
-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.+ 
 +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> <code>
 chmod +x ~/.local/bin/laptop-only ~/.local/bin/dual-monitor chmod +x ~/.local/bin/laptop-only ~/.local/bin/dual-monitor
 </code> </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> <code>
 bindsym $mod+F5 exec ~/.local/bin/laptop-only bindsym $mod+F5 exec ~/.local/bin/laptop-only
Line 45: Line 53:
 </code> </code>
 Reload Sway: Reload Sway:
-bash+
 <code> <code>
 swaymsg reload swaymsg reload
 </code> </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.1792845470.txt.gz · Last modified: by karcio