From 0217995cda2e5b3700b911b5561e99c659fba92b Mon Sep 17 00:00:00 2001 From: zachir Date: Sun, 9 Oct 2022 00:42:32 -0500 Subject: add tofi scripts, replacing barmenu --- monattach-tofi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 monattach-tofi (limited to 'monattach-tofi') diff --git a/monattach-tofi b/monattach-tofi new file mode 100755 index 0000000..f796355 --- /dev/null +++ b/monattach-tofi @@ -0,0 +1,22 @@ +#!/sbin/sh + +XSTATS="$(xrandr)" + +PRIMARY="$(echo "$XSTATS" | grep "primary" | awk '{print $1}')" +RIGHT=false + +for i in $@; do + case "$i" in + "right") + RIGHT="TRUE" ;; + "left") + RIGHT="FALSE" ;; + esac +done + +OUTPUT="$(echo "$XSTATS" | grep ' connected ' | grep -v '[0-9]*x[0-9]*+[0-9]*+[0-9]' | awk '{print $1}' | tofi --height 24 --prompt 'Which output?')" +[ -z "$OUTPUT" ] && exit 2 + +[ "$RIGHT" = "TRUE" ] && ARGS="--right-of $PRIMARY" || ARGS="--left-of $PRIMARY" + +xrandr --output "$OUTPUT" --mode 1920x1080 $ARGS -- cgit v1.2.3