if [ -z "$ISLIVE" ]; then
cd ~/instantos
- if ! grep -q '....' ~/instantos/monitor/max.txt; then
+ if ! iconf -i max; then
instantmonitor
fi
if [ $(echo "$RESOLUTIONS" | sort -u | wc -l) = "1" ]; then
echo "resolutions identical"
- iconf max $(head -1 <<<"$RESOLUTIONS")
+ iconf -i max $(head -1 <<<"$RESOLUTIONS")
else
let PIXELS1="$(head -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(head -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
let PIXELS2="$(tail -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(tail -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
if [ "$PIXELS1" -gt "$PIXELS2" ]; then
- iconf max "$(head -1 <<<$RESOLUTIONS)"
+ iconf -i max "$(head -1 <<<$RESOLUTIONS)"
else
- iconf max "$(tail -1 <<<$RESOLUTIONS)"
+ iconf -i max "$(tail -1 <<<$RESOLUTIONS)"
fi
fi
# alt tab like behaviour with rofi
if ! [ -n "$1" ]; then
# is multi monitor?
- if ! [ -e ~/instantos/monitor/right.txt ]; then
+ if ! iconf -i right; then
rofi -show window -kb-row-down 'Alt+Tab,Down' -kb-row-up 'Alt+Ctrl+Tab,Up' -kb-accept-entry '!Alt_L,!Alt+Tab,Return'
exit
else
}
# single monitor doesnt need fixes
-if ! [ -e ~/instantos/monitor/right.txt ]; then
+if ! iconf -i right; then
focuswin "$1"
exit
fi
getmonitor() {
xdotool key 'super+W'
XPOS=$(xdotool getmouselocation --shell | head -1 | grep -o '[0-9]*')
- if [ "$XPOS" -gt "$(cat ~/instantos/monitor/right.txt)" ]; then
+ if [ "$XPOS" -gt "$(iconf right)" ]; then
echo "1"
else
echo "0"