24 lines
465 B
Bash
Executable File
24 lines
465 B
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
PRIMARY=
|
|
SECONDARY=
|
|
OFFLINE=
|
|
|
|
update() {
|
|
PRIMARY=$(xrandr --listmonitors | awk '/ 0:/{ print $4 }')
|
|
SECONDARY=$(xrandr | awk '/ connected/ { print $1 }' | fgrep -v $PRIMARY)
|
|
OFFLINE=$(xrandr | awk '/disconnected/ { print $1 }')
|
|
}
|
|
update
|
|
|
|
menu() {
|
|
cat <<EOF | fzf -e --preview='xrandr | grep -A1 {1}'
|
|
$PRIMARY (primary)
|
|
$(for i in $SECONDARY; do echo "$i (secondary)"; done)
|
|
$(for i in $OFFLINE; do echo "$i (offline)"; done)
|
|
EOF
|
|
}
|
|
menu
|
|
|