better functionality
This commit is contained in:
parent
35d62e92e9
commit
4d94f87790
1 changed files with 8 additions and 7 deletions
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
LIST="$(xrandr | sed '/disconnected/d;/connected/!d;s/ .*$//g')"
|
LIST=`xrandr | sed '/ connected/!d;s/ .*$//'`
|
||||||
MONITORS="$(printf '%s' "$LIST" | tr '\n' ' ')"
|
MONITORS=`printf '%s' "${LIST}" | tr '\n' ' '`
|
||||||
|
|
||||||
CMD="$(printf 'xrandr' ; for MONITOR in $MONITORS ; do
|
CMD="$(FIRST=1 ; for i in ${MONITORS} ; do
|
||||||
SELECT="$(printf '%s' "$LIST" | menu "Next monitor (to right):")"
|
CURR=`printf '%s' "${LIST}" | sed "/${LAST:=empty}/d" | menu "Next monitor (to right):"`
|
||||||
[ -z "$SELECT" ] && exit 0
|
[ -z "${CURR}" ] && exit 0
|
||||||
[ -n "$LAST" ] && printf ' --output %s --right-of %s' "$SELECT" "$LAST"
|
[ "${FIRST}" ] && printf 'xrandr --output %s' "${CURR}" && FIRST=
|
||||||
LAST="$SELECT"
|
[ "${LAST}" ] && printf ' --left-of %s' "${CURR}"
|
||||||
|
LAST="${CURR}"
|
||||||
done)"
|
done)"
|
||||||
|
|
||||||
$($CMD)
|
$($CMD)
|
||||||
|
|
Loading…
Reference in a new issue