dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: b1a9716fe72d49c7f732e1022b06391888fc2b1a
Parent: a421893c3d46fc9b27966dca2a76da8ee5ae2559
Author: 0x766F6964
Date:   Sun, 14 Feb 2021 17:56:19 -0700

have displaycon script list connected but disabled displays

xrandr --listmonitors and xrandr --listactivemonitors seem to do the
same thing and not what the manpage describes

Diffstat:
Mbin/displaycon | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/displaycon b/bin/displaycon @@ -7,10 +7,10 @@ case $(printf "rotate\nmanage" | dmenu -i -p "Action:") in monitor=$(xrandr --listactivemonitors | awk '{print $4}' |\ grep -v "^$" | dmenu -i -p "Monitor:") || exit 0 - cmd=$(printf "normal\nright\nleft\ninverted" |\ + direction=$(printf "normal\nright\nleft\ninverted" |\ dmenu -i -p "Direction:") || exit 0 - xrandr --output $monitor --rotate $cmd + xrandr --output $monitor --rotate $direction case $cmd in "left"|"right") bgs $HOME/.config/v_wallpaper.jpg @@ -22,8 +22,8 @@ case $(printf "rotate\nmanage" | dmenu -i -p "Action:") in ;; "manage") - monitor=$(xrandr --listmonitors | awk '{print $4}' |\ - grep -v "^$" | dmenu -i -p "Monitor:") || exit 0 + monitor=$(xrandr | grep ' connected' | cut -f 1 -d ' ' |\ + dmenu -i -p "Monitor:") || exit 0 case $(printf "enable\ndisable\nmove" | dmenu -i -p "Action:") in "enable"|"move") @@ -33,7 +33,11 @@ case $(printf "rotate\nmanage" | dmenu -i -p "Action:") in relative=$(xrandr --listactivemonitors | awk '{print $4}' |\ grep -v "^$" | dmenu -i -p "Relative:") || exit 0 - xrandr --output $monitor --$loc $relative + direction=$(printf "normal\nright\nleft\ninverted" |\ + dmenu -i -p "Direction:") || exit 0 + + xrandr --output $monitor --$loc $relative\ + --rotate $direction --auto ;; "disable") xrandr --output $monitor --off