Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Installing a program

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Location
    White Hall, WV
    Beans
    278
    Distro
    Ubuntu 14.04 Trusty Tahr

    Installing a program

    Since my 3 cats like to join in when I am on the computer I was looking for a program I could activate with a few key strokes and lock the keyboard. I did find one for windows and it works great. I have actually found one for linux also and have downloaded but because I am so new to Ubuntu I just don't know what to do next. I make contact with the author and he send me some instructions but I still need help. Below are excerpts of his directions:


    No worries Michael I'll see if I can help you out. I think I have a Ubuntu VM somewhere around the place that I can play with. Off the top of my head though, you will need the following software installed. I don't know the Ubuntu package names for these but I should be able to get back to you with that later.

    Perl
    Gtk version 2
    Perl module Gtk2 (in ubuntu, this might be called perl-gtk2 or just perl-gtk or even gtk-perl or GtkPerl)

    That's it, if you can install those things then you have all the rewuirements. But I wrote it a long time ago, so it is possible that Ubuntu only has gtk 3 now. In that case you may be able to just edit the script (you can edit it with a text editor) and change all occurrences of Gtk2 to Gtk3.

    To run the script, it needs to be flagged as executable . you can do this in linux like this:

    cd /home/your-username/downloads/ (or where ever you saved it)
    chmod a+rx lock-keyboard-for-baby.pl (or whatever your file is called)

    Then you can run it by typing :
    ./lock-keyboard-for-baby.pl

    and see if it works.


    So how do I find out if I have Perl module Gtk2?

  2. #2
    Join Date
    Jan 2012
    Location
    Davenport, Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Installing a program

    Code:
    instmodsh
    Then at the cmd? prompt
    Code:
    l
    -that's a lowercase L.

    Hope this helps!

  3. #3
    Join Date
    Nov 2012
    Location
    White Hall, WV
    Beans
    278
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing a program

    Perl is listed but I don't know about the gtk2 so do I assume that is not installed? BTW, thank you for helping!
    Michael

  4. #4
    Join Date
    Oct 2011
    Location
    /root
    Beans
    956
    Distro
    Ubuntu

    Re: Installing a program

    What's the name of the program, where did you download it from, and what's the file extension (ex: .exe)?


  5. #5
    Join Date
    Mar 2006
    Location
    New Zealand
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Installing a program

    Does CTRL + ALT + L achieve what you want?

  6. #6
    Join Date
    Nov 2012
    Location
    White Hall, WV
    Beans
    278
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing a program

    Here is the website for the program: http://csincock.customer.netspace.ne...d-for-baby.htm

  7. #7
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Installing a program

    Pretty simple. There's nothing to install but the Perl Gtk2 libraries. Open up a terminal window and install the perl GTK2 libraries:

    Code:
    sudo apt-get install libgtk2-perl
    Once that's you can just run the script following the author's instructions. In short, copy the program into a text editor and save it somewhere. Then, make the program executable:

    Code:
     chmod +x <yourprogram>
    Then you can run it from the terminal with:

    Code:
     ./path/to/your/program/
    You could get fancier with it and create a launcher or something too if you wanted.

  8. #8
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Installing a program

    I don't know how the script works for you, but when the keyboard is locked
    I can't move windows with the mouse.

    In unity I create a launcher which uses xinput to disable and enable my input device.

    eg Get the ID of your device...
    Code:
    xinput -list
    Code:
    glen@Quantal:~$ xinput -list
    ⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
    ⎜   ↳ Honey Bee  Nostromo SpeedPad2           	id=9	[slave  pointer  (2)]
    ⎜   ↳ Logitech USB Receiver                   	id=13	[slave  pointer  (2)]
    ⎜   ↳ Logitech USB-PS/2 Optical Mouse         	id=11	[slave  pointer  (2)]
    ⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
        ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
        ↳ Power Button                            	id=6	[slave  keyboard (3)]
        ↳ Power Button                            	id=7	[slave  keyboard (3)]
        ↳ Honey Bee  Nostromo SpeedPad2           	id=8	[slave  keyboard (3)]
        ↳ Logitech Logitech USB Headset           	id=10	[slave  keyboard (3)]
        ↳ Logitech USB Receiver                   	id=12	[slave  keyboard (3)]
    ----
    My keyboard ID=12

    Create a .desktop file. Run in terminal ...
    Code:
    gedit ~/.local/share/applications/Catwalk.desktop
    Copy and paste this into gedit.
    Code:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Name=Catwalk
    Comment=disable enable keyboard
    Exec=/usr/bin/xinput --disable 12
    Icon=/home/glen/Desktop/Scratch_cat_large.png
    Categories=Utility;
    
    Actions=enable;
    
    [Desktop Action enable]
    Name=Enable Keyboard
    Exec=/usr/bin/xinput --enable 12
    OnlyShowIn=Unity;
    Edit the file to use your keyboard id
    and the path to an icon.

    Save the file.
    Open the dash and type in "catwalk" and drag to the launcher.
    Left click to disable the keyboard and right click to bring up the quicklist to enable.

    It would be better to use a toggle on/off script but I don't
    know how to get the disabled/enabled status of the keyboard.
    Attached Images Attached Images
    Last edited by stinkeye; March 5th, 2013 at 04:48 AM.

  9. #9
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,615
    Distro
    Ubuntu

    Re: Installing a program

    stinkeye's post is pretty well spot on.
    However run this in a terminal:
    Code:
    chmod + x  ~/.local/share/applications/Catwalk.desktop
    so the .desktop file is executable, or else the file will open the text editor (most likely).
    Or right-click>properties>permissions>check run as executable.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  10. #10
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Installing a program

    Quote Originally Posted by deadflowr View Post
    stinkeye's post is pretty well spot on.
    However run this in a terminal:
    Code:
    chmod + x  ~/.local/share/applications/Catwalk.desktop
    so the .desktop file is executable, or else the file will open the text editor (most likely).
    Or right-click>properties>permissions>check run as executable.
    Hi there deadflowr,
    a .desktop file doesn't need to be executable unless you want to place it on the desktop,
    whereby its being handled by nautilus when you click on it.
    Last edited by stinkeye; March 5th, 2013 at 04:56 AM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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