Results 1 to 6 of 6

Thread: Locking the keyboard during a script command

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    Locking the keyboard during a script command

    .
    I have a simple script that does some useful housekeeping jobs;
    however, it will hang up and require a re-command if any keyboard activity
    occurs during the small time it takes to perform the housekeeping jobs.

    Are there some simple commands that would allow me to lock-out
    the keyboard just before and re-activate the keyboard just after
    the script operations are in process?

  2. #2
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by utu View Post
    .
    I have a simple script that does some useful housekeeping jobs;
    however, it will hang up and require a re-command if any keyboard activity
    occurs during the small time it takes to perform the housekeeping jobs.

    Are there some simple commands that would allow me to lock-out
    the keyboard just before and re-activate the keyboard just after
    the script operations are in process?
    Are you referring to locking the keyboard when you are running the script from a lxterminal ( or any other terminal emulators ) or you want to lock the entire keyboard and mouse for the entire X Window session ? If it is the formal you can consider using nohup and redirect input to null.

    $ nohup command arg ..... < /dev/null

    If it is the latter, I am not aware of a way to do it. In LXDE, locking is easy but automatically unlock is tough.

  3. #3
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ kl522

    I have a small /etc/rc.local script which does things at boot.
    Takes about 60 seconds. Any keyboard activity at all prior to
    its completion seems to reset the clock for another 60 second wait.

    I thought there might be something like 'init x' added before
    and 'init y' added after the script would lock out the keyboard
    while the script is doing its thing.

    This begs the question about what happens if the script itself
    hangs up.
    Last edited by utu; 05-13-2011 at 02:34 PM.

  4. #4
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by utu View Post
    @ kl522

    I have a small /etc/rc.local script which does things at boot.
    Takes about 60 seconds. Any keyboard activity at all prior to
    its completion seems to reset the clock for another 60 second wait.
    Try 'nohup', that's what it is meant for, making whatever script/command immune to standard input.

  5. #5
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ kl522

    Took a few lines out of /etc/rc.local and made a separate
    script called /etc/setup.
    Replaced those lines in the original /etc/rc.local with
    nohup /etc/setup &.
    Keyboard input no longer upsets the process.

    Thanks.

  6. #6
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ kl522

    Two amendments:
    (1) /etc/rc.local doesn't like the '&'; I've deleted it; and
    (2) I've added '> /dev/null 2>&1' in its place to do away with
    a lot of nohup messages showing up in home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Vintage Industrial micro systems dual 8

Vintage Industrial micro systems dual 8" Floppy disc drive for Altair system

$450.00



Cromemco TU-ART S-100 Serial and Parrallel Board - IMSAI Altair picture

Cromemco TU-ART S-100 Serial and Parrallel Board - IMSAI Altair

$69.95



Cromemco PRI S-100 Printer Interface - Altair IMSAI picture

Cromemco PRI S-100 Printer Interface - Altair IMSAI

$45.00



External Half Height Case For a 5 1/4 Inch Floppy Disk (Altair, IMSAI) picture

External Half Height Case For a 5 1/4 Inch Floppy Disk (Altair, IMSAI)

$49.95



S-100 backplane motherboard bare PCB 9 slot (for Altair/IMSAI) picture

S-100 backplane motherboard bare PCB 9 slot (for Altair/IMSAI)

$34.99



Morrow MIS S-100 20 Slot Backplane PDC Motherboard 1977 Altair IMSAI Board picture

Morrow MIS S-100 20 Slot Backplane PDC Motherboard 1977 Altair IMSAI Board

$295.00



1976 Scelbi 6800 Software Cookbook Altair 680 SWTPC Assembly Language Motorola picture

1976 Scelbi 6800 Software Cookbook Altair 680 SWTPC Assembly Language Motorola

$39.99



2x Intel C8080A White Ceramic Gold 76' Vintage 8-Bit CPU Microprocessor Altair picture

2x Intel C8080A White Ceramic Gold 76' Vintage 8-Bit CPU Microprocessor Altair

$449.99



CP/M 86 1.1R 8086 Highmonitor 8 Inch Floppy Diskette 80s IMSAI Altair picture

CP/M 86 1.1R 8086 Highmonitor 8 Inch Floppy Diskette 80s IMSAI Altair

$40.00



MITS Altair 8800 System Full Provenance and Documentation  picture

MITS Altair 8800 System Full Provenance and Documentation

$15000.00