Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Looking for a program that clears the clipboard on a timer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5735

PostPosted: Fri Aug 27, 2010 8:41 pm    Post subject: Looking for a program that clears the clipboard on a timer Reply with quote

Every so often I accidentally middle click and dump unintentional text in places it shouldn't be (command lines, vim in normal mode, web searches etc). It'd be nice if there was something that cleared the paste buffer after some inactivity so that doesn't happen. Anyone know a program to do that?
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5618
Location: Removed by Neddy

PostPosted: Fri Aug 27, 2010 11:28 pm    Post subject: Reply with quote

uclip maybe
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Sat Aug 28, 2010 12:12 am    Post subject: Reply with quote

It might be possible to write a bash script to do this and put it on a cron job.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5735

PostPosted: Sat Aug 28, 2010 1:15 am    Post subject: Reply with quote

uclip doesn't seem to be in portage, but xclip is and sounds almost the same. Thanks, I'm using it on a keyboard button for now, later I might do something using libXScrnSaver...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5735

PostPosted: Sat Aug 28, 2010 1:43 am    Post subject: Reply with quote

Hmm, xclip doesn't seem to work for this.

So I made my own.

Code:
#!/usr/bin/perl
use X11::IdleTime;
use Clipboard;
my $timeout = 60;
while () {
    my $idle = GetIdleTime();
    if ( $idle < $timeout ) {
        sleep $timeout - $idle;
    }
    else {
        Clipboard->copy(' ');
        sleep $timeout;
    }
}


[Edit: should point out Clipboard.pm still needs xclip installed.]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum