LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-06-2017, 03:09 AM   #1
bremenpl
LQ Newbie
 
Registered: Apr 2013
Posts: 21

Rep: Reputation: Disabled
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.
 
Old 07-06-2017, 08:45 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by bremenpl View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Pointer Freezes yooden Linux - Desktop 2 08-29-2014 02:16 AM
Mouse pointer freezes after login - Kubuntu 6.06 jon_benge Linux - Hardware 4 07-02-2006 10:02 AM
move mouse pointer from shell script malo_umoran Slackware 1 11-06-2004 08:31 AM
Mouse pointer freezes, keyboard still works MikeZila Slackware 2 10-03-2004 10:50 AM
mouse pointer randomly freezes R3N3G4D3 Linux - General 1 10-08-2003 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration