Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-09-23 07:53:42

191jordan
Member
From: Australia
Registered: 2014-08-11
Posts: 14

Executing command by mouse movement

I want to be able to execute a command when I move the mouse pointer to a certain part of the screen. Eg I have a 1440x900 monitor and I want to be able to execute a command when I move the mouse pointer to within 50px of the left screen edge. So if my mouse pointer is within a column area of the screen of 50x900 I want the command to execute. Is this possible?

Offline

#2 2014-09-23 20:43:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Executing command by mouse movement

You'll have to use a third-party tool for this. Maybe something like Brightside? I believe it only does corners though.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2014-09-24 03:35:25

191jordan
Member
From: Australia
Registered: 2014-08-11
Posts: 14

Re: Executing command by mouse movement

yeah I was aware of Brightside, but not what I was looking for, thanks anyway

Offline

#4 2014-09-24 06:01:18

Simon_P
Member
From: United Kingdom
Registered: 2014-09-18
Posts: 15

Re: Executing command by mouse movement

Maybe you can do this in a script using xdotool getmouselocation ? Example just prints out message with time when mouse passes into left 50 pixels:

#!/bin/bash

px=0
while
    mdata=`xdotool getmouselocation`
    mx=`echo "$mdata"|cut -f1 -d' '|cut -d: -f2`
    if [ $px -ge 50 ] && [ $mx -lt 50 ]; then
        date "+activate %s"
    fi
    px=$mx
    sleep 0.1
do
    :
done

Offline

#5 2014-09-24 06:22:31

191jordan
Member
From: Australia
Registered: 2014-08-11
Posts: 14

Re: Executing command by mouse movement

hmmm thanks for that Simon_P, xdotool was my next stop, or resort to Easystroke mouse gestures which I'm keen on avoiding

i'll give it a go

cheers

Last edited by 191jordan (2014-09-24 06:23:24)

Offline

Board footer

Powered by FluxBB