LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   xrandr freezes mouse pointer in script (https://www.linuxquestions.org/questions/linux-software-2/xrandr-freezes-mouse-pointer-in-script-4175609283/)

bremenpl 07-06-2017 03:09 AM

xrandr freezes mouse pointer in script
 
Hello there,
I am using Xubuntu 16.04. I have a script that sleeps and asks xrandr for monitors connected in a loop. My problem is that this script, each time it runs xrandr, freezes my mouse pointer... This does not happen when running the command manually. This is a minimal example:

Code:

#!/bin/bash

while true
do
  sleep 4

  xrandr | grep " connected" | wc -l
done

Above script returns amount of monitors connected. When I turn it on, each time xrandr is called mouse cursor freezes for a while. What could be the case of this? Also, maybe there is a better way of finding out how many monitors are connected? Maybe a file watcher? But which file?

I would appreciate all help and hints regarding this.

BW-userx 07-06-2017 08:45 PM

Quote:

Originally Posted by bremenpl (Post 5731308)
Hello there,
I am using Xubuntu 16.04. I have a script that sleeps and asks xrandr for monitors connected in a loop. My problem is that this script, each time it runs xrandr, freezes my mouse pointer... This does not happen when running the command manually. This is a minimal example:

Code:

#!/bin/bash

while true
do
  sleep 4

  xrandr | grep " connected" | wc -l
done

Above script returns amount of monitors connected. When I turn it on, each time xrandr is called mouse cursor freezes for a while. What could be the case of this? Also, maybe there is a better way of finding out how many monitors are connected? Maybe a file watcher? But which file?

I would appreciate all help and hints regarding this.

I only got one monitor but it does not lock up my mouse whatsoever.

I did this just cuz..
Code:

#!/bin/bash

while true
do
  sleep 4
  ShootME=$(  xrandr | grep " connected" | wc -l )
  echo "$ShootME"
done

it still does the same sends it to the term screen


All times are GMT -5. The time now is 01:36 AM.