Programming :: Execute Some Action After "x" Seconds Of Keyboard Inactivity?

Apr 3, 2010

I'm trying to execute some actions when there's no keyboard action in "x" seconds or minutes (after "x" seconds or minutes of keyboard inactivity), but is hard to find something about this...

and i don't know if this will make a lot of cpu usage

View 4 Replies


ADVERTISEMENT

Programming :: Java Needs To Quit If No Keyboard Input For Several Seconds

Mar 29, 2011

I've got a program that takes keyboard input with BufferedReader and readline(), but readline() is blocking so I can't increment any sort of counter to quit the application after a period of inactivity, because the program is just waiting for an input from readline(). Do I need to create multiple threads, where one thread counts down an inactivity timer, or is there some method of using non-blocking keyboard inputs?

View 1 Replies View Related

Ubuntu :: Bluetooth Keyboard And Mouse Not Working After Inactivity?

May 28, 2011

I've paired a bluetooth keyboard and mouse with my machine using the Gnome bluetooth wizard and the keyboard and mouse work fine. Then, if I let the computer sit for a few hours and then try to use the keyboard or mouse, nothing happens. When paired with my windows machine, and I start using the keyboard and mouse after a hour or two, the keyboard takes a second or two to start working again. I suspect that it turns itself off, and then has to reconnect, and that in Linux, the reconnection isn't working properly. I've found other instances on the forums of people with the same symptoms, but never any clear answers. Does anyone know what's going on?

View 1 Replies View Related

Ubuntu :: Allow Auto-log Off Feature Either An Extended Inactivity Time Or To Disable Inactivity-logouts

Oct 18, 2010

I would like to allow the auto-log off feature either an extended inactivity time or to disable inactivity-logouts.

I use my PC strictly at home, and have no security issues. I've set my username to no-password so that I just click [twice] to log back on. But I must do that to see the screen display - say to see what's playing on Pandora.

Can I set the auto-logout-time somewhere or disable the function?

View 1 Replies View Related

Ubuntu :: Execute PHP File Every 10 Seconds?

Jul 5, 2011

I have very basic info about Linux. I'm using Linux server 11.04 . I'm using the server as a web server to send SMS messages. I have a php page: read data from mysql and then send SMS (according to retrieved data) , this page is already done and store in www dir. I want this page is execute in the background each 10 sec. is that possible in crontab?

View 1 Replies View Related

Fedora :: Change The Language Of The Action Labels Shown In The Keyboard Shortcuts Window?

Sep 6, 2010

how can I change the language of the action labels shown in the Keyboard Shortcuts window? System language is set to English (United States), but the mentioned descriptions are displayed in Italian language.

View 2 Replies View Related

CentOS 5 :: Keyboard Will Hang For Few Seconds?

Mar 24, 2011

Keyboard Hanging, in CentOS. Some time when I login to Linux or when we come back to use Keyboard after a long time work with mouse, my keyboard will hang for few seconds. I don't know its my USB keyboard problem or another issue. I doubt it started after I install opera browser in CentOS or by VNC setup.

View 3 Replies View Related

Programming :: Following Drag Action And Drop - Some Tips?

Jun 4, 2011

I've got a non-urgent but itchy thing here - I'm implementing a drag-and-drop. All rolls well, but I'd like to have the component be "followed" - if there is a drag on the component, the form should be visible. I'd like to make a puzzle where the player can see the perimeter of the piece to see if it fits where (s)he'd want to drop it. Before I delve into the tons of code, I'd like to know if that (the following) can be done.

View 2 Replies View Related

OpenSUSE :: Map "Present Windows - All Desktops" Action Which Is Invoked By Activating The Top Left Corner Of Active Screens Via A Keyboard Shortcut?

Aug 25, 2010

Is it possible to map the same "Present Windows - All Desktops" action which is invoked by activating the top left corner of active screens via a keyboard shortcut? I basically want to ape OSX and have an expose-like button, the screen edge works fine for now, but I would love a keyboard shortcut also. Is it possible? Also, when I set up a custom keyboard shortcut to run yast, I initially tried using the same command from the KDE menu: /usr/bin/xdg-su -c /sbin/yast2

However, when I use the keyboard shortcut to launch this command, I get problems when trying to use zypper after the initial launch using the keyboard shortcut(from yast GUI or CLI). The error basically states another instance of yast2 already exists. The problem is only with the app/repo management modules though; for instance I can launch yast (using keyboard shortcut or start menu) and access hardware info, sudo users etc, I just can't access software/repo management stuff. Even when I kill the offending PID from the CLI I still get the error and have to restart the box to rectify it proper. So I changed the keyboard shortcut command to : /usr/bin/kdesu /sbin/yast2

and this seems to have resolved the problem. My second question is what is the difference between the two in this particular instance and why does one cause problems (xdg-su) and the other does not (kdesu).

View 5 Replies View Related

Programming :: Plan Of Action For Script Which Is Able To Send / Receive Email

Feb 22, 2010

A bit clumsy subject, but I would like to make a script, which is able to send and receive email messages from CLI. The script should work like this:

1. read user input from stdin(for example a mail address)
2. send mail over SMTP(SSL, port 465) to a mail server
3. mail server sends an automatic response, script should just display this response email sent from mail server over IMAP(port 993)

At the moment I have a fallowing configuration in my Thunderbird:

Code:
IMAP mail.domain.com SSL 993
SMTP mail.domain.com SSL 465

Is it possible with 'mail' utility? Do I need to configure some sort of MTA at first(I use SUSE and I have Sendmail installed by default)? What are the steps, to get this script working?

View 1 Replies View Related

Programming :: Sets Sigpipe's Default Action To Ignore And Opens A Socket?

Jul 27, 2011

I'm studying an OS programming book, in particular network sockets. I have two questions(2nd one is down at the bottom). There is something I don't quite understand. What if this piece of code, which sets sigpipe's default action to ignore and opens a socket:

Code:
if ((u_ignore_sigpipe() != 0) || ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1))
return -1;

[code]....

View 3 Replies View Related

General :: Execute A Program Based On A Keypress From A Specific USB Keyboard?

May 4, 2011

I've been given one of these ubiquitous usb-sleep buttons which is basically a supersimple usb-keyboard. It's a big button that sends a SLEEP keypress to the computer when you slam it. But that is pretty boring. I'd love to remap it to do something more fun but I can't figure out how to bind to only the sleep press from the button and not from my ordinary keyboard.

The button identifies as

Bus 001 Device 035: ID 1130:600d Tenx Technology, Inc.

I'd like to know if there's either

a way of mapping a key from a specific keyboard to an action OR a way of remapping the sleep key from a specific keyboard to a new key-code or something like that.

View 1 Replies View Related

Programming :: Socket And Timer Programming - Server Doesn't Execute Any Msg Which Client Sent

May 16, 2011

i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.

#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netdb.h>
#include<unistd.h>
#include<pthread.h>
#include<string.h>
[Code]....

View 1 Replies View Related

Programming :: Read Keyboard Status (not: Wait For Keyboard Input)?

Jun 28, 2011

has bash a command that reads the keyboard status and exits? I want to write a loop of this form:

Code:
while [ 1 ] do
sleep (1)

[code]....

View 14 Replies View Related

General :: Write A Script To Execute A Fortran Code That Reads In Parameters From Keyboard Typing?

Apr 18, 2011

I am trying to write a script (especially C-shell) to execute a fortran code that reads in parameters from keyboard typing. I will have to process this .F code for many times with the parameters the same for all my data files, therefore, I don't have to type in everytime I execute the .F code. But I don't know what is the command in c shell to read in a text files that contains all the parameters I want and can make the shell read in appropriately to feed the .F code.

View 3 Replies View Related

Programming :: Convert TSC Cpu Cycles Into Seconds In C?

Sep 19, 2010

main()
{
unsigned long long tsc_start, tsc_end;
tsc_start = get_tsc();
// execute some code

[code]....

View 1 Replies View Related

Programming :: Bash: Convert Decimal To Minutes:seconds?

Jan 13, 2011

I have a script in the works that reads an MP3 file and gets the track length. Trouble is, it gives me the total seconds, like this:

Sample Track.mp3 = 225.55 seconds

What I'd like to have is that 225.55 converted into minutes:seconds format (in this case, 3:45). How can I do this?

View 10 Replies View Related

Programming :: Code That Will Never Execute

May 23, 2011

Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.

View 6 Replies View Related

Programming :: Execute The String That Sed Actually Outputs?

Aug 2, 2010

I've been able to get the right output that I need from sed, but how can I execute the string that sed actually outputs?

View 3 Replies View Related

Programming :: Can Php Script Execute X11 Applications

Jun 2, 2010

If I put

Code:

$r = exec('whoami');
echo $r;

into my php script, it works fine. However, if I put

Code:

$r = exec('myX11application');
echo $r;

it doesn't (to be precise, the script still works, but myX11application is not executed). Of course, scripts are run by user "apache", who doesn't have access to X11 server and doesn't even have DISPLAY variable defined.I installed virtual framebuffer Xvfb, created a small bash script:

Code:

Xvfb :2
export DISPLAY=:2
myX11application

and called it with exec from php, but it still doesn't run since it looks like Xvfb can't start if the normal X server is running (I need that for development purposes). The reported error from Xvfb is

Code:

(EE) config/hal: NewInputDeviceRequest failed (2)

Is there a solution to have php running your X11 applications with normal X server running?

View 6 Replies View Related

Programming :: Cannot Execute Binary File

Feb 11, 2011

I'm trying to compile a simple script for a ar71xx (bleeding edge /from snapshots) Openwrt router.I have previously compiled scripts for Kamikaze 8.09. I just copied the gcc file inside the SDK dir and used it without problems.

View 4 Replies View Related

Programming :: Execute Code For N Time?

Apr 23, 2011

I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:

Code:
pid = fork();
if(pid == 0) {

[code]....

View 2 Replies View Related

Programming :: Execute Commands After Run Command?

Jan 13, 2011

I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??

View 2 Replies View Related

Programming :: Execute External Program Using C?

Mar 30, 2011

Assume two applications, Application A and Application B. Both are written in C language.I had tried to use system() function in Application A to execute Application B. It success, but Application A cannot continue its own tasks before Application B exit. I want Application A to execute Application B, but Application A can continue its tasks without waiting for Application B to exit.

View 3 Replies View Related

Programming :: Execute Bash Script In C?

Jan 31, 2009

I want to execute a bash script in a C program. Bash script return some message and I want to store this message in a C program. Anybody know how can I do it.
I know I can use 'system("bash myscript.sh")' command in C. But I want to store the message which script return.

View 7 Replies View Related

Programming :: Execute Iptables Command On Php?

Jul 25, 2009

i want to execute iptables command via php. i can run simple command as echo 'iptables -h'; but i can't run ipables -L and i create excutable file (firewall.sh). i can run it on console but not done on php.

View 7 Replies View Related

Programming :: Shell Can't Execute Through Ssh But Local Well?

Jan 10, 2010

The two host one is Aix 5.3 and another is Suse 10sp2 the both have the same script which including the following parts:

if [ `date +%a` = "Mon" ];then
if [ "$RESULT" = "" ]; then
echo "The `hostname` $DATE ok"

[code]...

View 1 Replies View Related

Programming :: Execute SQLite Db Commands From C++?

Jun 10, 2010

Anyone know how to execute SQLite db commands from C++?

View 1 Replies View Related

Debian Programming :: Execute System Command Using Qt

Feb 19, 2014

I was writing code to execute system command, using GDM3 an logged in as root (just commented line #auth required

pam_succeed_if.so user != root quiet_success , in /etc/pam.d/gdm3).

When i execute:

Code: Select allvoid criarWindowsDialog::on_pushButton_2_clicked() {
    ui->commandTextEdit->append("Processo iniciado ...");
    QProcess processo;
    QString comando;
    QStringList args;
    QString fullCommand;
    QString stdOut;
    QString stdError;

[CODE]..

View 0 Replies View Related

Programming :: Execute Multiple Sql Files Using Scripting?

May 19, 2010

My query is i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" , script with which i can execute all these sql files in a single shot.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved