aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-04-17 18:57:09 -0500
committerJesús <heckyel@hyperbola.info>2019-04-17 18:57:09 -0500
commit867e1cf679c00dcd7b956da8d3e693a8314bf895 (patch)
treefd6896d088dc8e60f2d6d86bebbfef083d387073
parent3f467c8d36028e8e7dab12de9465dfbb5e74927b (diff)
downloadi3-config-867e1cf679c00dcd7b956da8d3e693a8314bf895.tar.lz
i3-config-867e1cf679c00dcd7b956da8d3e693a8314bf895.tar.xz
i3-config-867e1cf679c00dcd7b956da8d3e693a8314bf895.zip
improve display extends
-rw-r--r--config17
-rw-r--r--scripts/i3display.sh12
2 files changed, 15 insertions, 14 deletions
diff --git a/config b/config
index 3877eee..5f53546 100644
--- a/config
+++ b/config
@@ -256,8 +256,21 @@ exec --no-startup-id emacsclient -c
# i3lock
bindsym Pause exec "sh /home/$USER/.config/i3/scripts/i3lock.sh"
-# i3display 2 screen
-bindsym $mod+F4 exec "sh /home/$USER/.config/i3/scripts/i3display.sh"
+## Manual management of external displays
+# Set the shortcuts and what they do
+set $mode_display Ext Screen (v) VGA ON, (h) HDMI ON, (x) VGA OFF, (y) HDMI OFF
+mode "$mode_display" {
+ bindsym v exec --no-startup-id xrandr --output VGA1 --auto --right-of LVDS1, mode "default"
+ bindsym h exec --no-startup-id xrandr --output HDMI1 --auto --right-of LVDS1, mode "default"
+ bindsym x exec --no-startup-id xrandr --output VGA1 --auto --off, mode "default"
+ bindsym y exec --no-startup-id xrandr --output HDMI1 --auto --off, mode "default"
+
+ # back to normal: Enter or Escape
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+# Declare here the shortcut to bring the display selection menu
+bindsym $mod+x mode "$mode_display"
#open audio player
exec --no-startup-id audacious
diff --git a/scripts/i3display.sh b/scripts/i3display.sh
deleted file mode 100644
index 61818a7..0000000
--- a/scripts/i3display.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-IN="LVDS1"
-EXT="VGA1"
-if ( xrandr | grep -q "$EXT disconnected")
-then
- xrandr --output $IN --auto --output $EXT --off
-else
- xrandr --output $IN --auto --primary --output $EXT --auto --right-of $IN
- ## Only VGA
- # xrandr --output $IN --mode 1366x768
- # xrandr --output $EXT --mode 1366x768 --right-of $IN
-fi