From d91d0a8a5377318219ddf1df99853355acd08952 Mon Sep 17 00:00:00 2001 From: Bruno Carlin Date: Fri, 6 Jul 2018 09:28:30 +0200 Subject: [PATCH] add keybindings to automatically setup screens with xrandr in i3 --- i3wm/.config/i3/config | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/i3wm/.config/i3/config b/i3wm/.config/i3/config index 75731cf..11c82b6 100644 --- a/i3wm/.config/i3/config +++ b/i3wm/.config/i3/config @@ -170,6 +170,19 @@ mode "resize" { bindsym Mod4+r mode "resize" + +# Screen display +set $mode_display Display (b) Bureau, (s) single +mode "$mode_display" { + bindsym b exec xrandr --output DP2-1 --auto --right-of eDP1 --output DP1-2 --auto --right-of DP2-1 + bindsym s exec xrandr --output DP2-1 --off --output DP1-2 --off + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym Mod4+F8 mode "$mode_display" + ## Media keys # volume control bindsym XF86AudioLowerVolume exec /usr/bin/pactl set-sink-volume @DEFAULT_SINK@ '-5%'