AcerHK GUI
v. 0.6

Thank you for trying out the AcerHK GUI.  I hope you find it useful and helpful.  I use it routinely to activate / disable the BT and Wireless Radios.  Here are a few notes that will help and also a list of features I hope to at one point in the future -- either myself or a contributor -- incorporate.  The acerhk driver this GUI supports also works on notebooks from other manufacturers (some Medion, Fujitsu-Siemens, Compal, Xbook...).  A good source to check
to see what works well with your system is the listing on the rfswitch page:
    http://rfswitch.sourceforge.net/?page=laptop_matrix

        NOTE:  this GUI requires you to have the acerhk driver installed.  Your system
            may already have that installed.  If it doesn't and you know it is required,
            you can get it from the following location.  HOWEVER, check your package
            repository first.  If not there, you will need to compile it from
            source.  https://sourceforge.net/projects/acerhk/
            
Note about source code:  
    v. 0.6:
    This version added better modprobe support and options for the user to configure system
    on first run.
        - Checks for modprobe success.
        - Alerts if modprobe unsuccessful.
        - If modprobe success, added option to modify the /etc/modules file
        - Checks to see if /etc/modules already has 'acerhk' 
            in it, if so, will not add again.  Notifies user of possible problem
            that the module is in 'modules' but isn't loaded.
	    
    Also, it must be noted that v 0.6 relies upon gksudo and sudo to accomplish
	the 'root' tasks.  If there are issues with this and your distribution
	please contact me to let me know and I'll attempt to find a different
	means to execute the 'root' commands.

    v. 0.5:
    The version 0.5 added full support for selecting the path to the driver, trying
to run modprobe if driver not found, and the ability to save settings for the
FUTURE and yet to be implemented Check Mail feature.  See change log for details.

    v. 0.4 and later:
    As of version 0.4, I switched the GUI to a GTK GUI based on pyGTK 2.0.  Users should have little difficulty with using it based on these new changes.  However, the source code requires several files now and I have not done anything to put them all in one place.  If you want them all in one place, recommend that you grab the Zip File and unzip.  These are the key files:
    
        acerhkgui               (python)        This is the main program and contains 
                                                all primary functions.
        acerhkgui.glade         (glade xml)     This is the glade file for the main 
                                                acerhkgui window.
        acerhkgui-prefs.glade   (glade xml)     This is the glade file for the preferences GUI
        
    v. 0.3 and earlier:  
    The wxGlade file is in the source directory; however, the resulting program code 
    is the actual program since python is an interpreted language.  
    Copy it from /usr/bin if installed by .deb/.rpm or from your install location 
    if using zip file.

INSTALLATION:
    I strongly recommend the .deb or the .rpm file for installing in your system.  
    This will greatly simplify the process for you.

    As of version 0.3, I have updated the script to take variables that are used 
    throughout the code to reduce, eliminate the amount of code searching you would 
    have to do if you installed from the zip file or your driver was in a non-standard 
    location.

    ZIP File Installation (Note, the .deb / .rpm will install files at different locatations)

        a.  Unzip the files in your /home/<userid>/bin 
        
            NOTE:  I highly recommend that you use the /bin location if you are 
                    using the zip file.  The zip file has the program configured
                    to use that as the default location.  If you use an alternate
                    location, then modify the script configuration variable
                    'icon_path = <your path to acerhk_gui>'
		>>> In version 0.6 this is on line 93, but lines numbers
		    will change between versions.

        b.  Next, ensure you have the following packages installed.  Use synaptic.
                python2.5
                python-gtk2
            
            Alternately you can use the following command from a terminal:
        
                CODE:  sudo apt-get install python2.5 python-gtk2
                
        NOTE:  this GUI requires you to have the acerhk driver installed.  Your system
            may already have that installed (as ubuntu includes it in the base
	    install).  If it doesn't and you know it is required,
            you can get it from the following location.  HOWEVER, check your package
            repository first.  If not there, you will need to compile it from
            source.  https://sourceforge.net/projects/acerhk/
            
            The acerhk driver:  "also works on notebooks from other manufacturers 
            (some Medion, Fujitsu-Siemens, Compal, Xbook...).
        
        c.  Next, ensure that the python is set to be executable.  You can do this 
            from nautilus (file browser) by selecting the file, right click, click 
            properties, click permissions, check boxes for executable.
        
            Alternately, from the location where acerhk_gui.py is installed
        
                CODE:  sudo chmod a+x acerhk_gui.py

        d.  Create a desktop file / launcher.  In the GNOME environment, that can be done
            through editing the applications menu or from the desktop by right clicking.  
            I click on the icon to open the select box and navigate to the acerhk directory 
            and select the large icon (or an Icon of your choice).
            
                NOTE:  The .deb and .rpm include the application launcher and place the utility 
                       in the "Applications, System" menu.

DEPENDS ON:
    a.  AcerHK being installed (driver -- see notes above).
    b.  python2.5
    c.  python-wxgtk2.8  <v 0.3 and earlier>
    d.  pyGTK 2.0 <v 0.4 and later>
    e.  sudo and gksudo

TROUBLE SHOOTING:
    a.  If the icon is not visible on the application screen, edit the acerhk_gui.py file and change teh variable 'icon_path = "~/bin/acerhk_gui/" to your installatin path (between quotes)

    b.  If the buttons do not activate/deactivate the appropriate buttons, run acerhkgui from the command prompt.  You should see the following:
    
        1.  You will see if the driver was found at the location or not.  
            If not, the driver is either not loaded, not installed or it is at a
	    different location on your distribution.  On Ubuntu 8.10 and before, 
	    the location is:

                PATH:  /proc/driver/acerhk/
                
                In that location, you should find "blueled" and "wirelessled".  
                If that isn't the case, locate the file "wirelessled" and 
                the path to that file will need to be updated on in the 
                "global variable" section of the acerhk_gui.py file.

        1.1  As of version 0.5, the program will try a modprobe if not found.  If
	     this is the case, you can prevent the modprobe from happening every
	     time by adding acerhk to your modules file.  Version 0.6 will likely
	     add the ability to automatically add "acerhk" to the modules file.

        2.  If it was found, the driver information will be printed.  
            This will tell you if the driver is activated and in use or not.  
            My sample output is below:
            =======================================
            SAMPLE OUTPUT FROM MY ACERHK DRIVER:
            ---------------------------------------
                Acer hotkeys version 0.5.34
                Model(Type)	: TravelMate C300(new)
                request handler	: 0xc00fdcc0
                CMOS index	: 0x60
                events pending	: 0
                kernel polling	: active
                autoswitch wlan	: disabled
            =======================================
            
            NOTE:  If acerhk_gui has run successfully, a copy of this output is saved
                in your home directory as .acerhkdriverinfo.txt  
                It is a hidden file (hence the leading "dot")
    
    c.  Wireless LED doesn't Turn On:  
    
        This is due to fact that the led option is not set in the 
        configuration options.  
        
        In Ubuntu 8.10, you will need to edit the 
        /etc/modprobe.d/options file and 
        modify the options line for ipw2200 (on my system it is the ipw2200 
        but it could be different on yours) to be as follows:

            options ipw2200 associate=0 led=1
        
            set led=1 for led to be on or led=0 for led to be off all the time.
    
FUTURE ENHANCEMENTS: (The statuses here are out of date.  Check program code in
  text editor to see current status)

    Updates and plans -- These may not ever be incorporated and may 
    not even be possible; however, they are items that I think I can be enhanced.
    I have already started.  If it is prefixed with PART, that is partial progress
    toward my goal.  DONE: is complete.  After each planned enhancement, I
    may have a note that will provide you with information on where I sit with that.
    
    If there is a specific enhancement you wish, let me know, but I won't work
    on that until I get to it in my priority list.
    
    a.  I borke the previous a up.
    
    DONE: a.1 Testing to see if acerhk is installed and alerting user if not found.  
           ** UPDATE:  Now produces a GUI Dialog on startup if path isn't correct
            
    PART: a.2 Enable user to configure the path to the AcerHK driver
           ** NOTE:  All paths were updated to use a variable so a change to the 
            variable will affect the entire program and only has to be
            changed once.  This is the initial step to updating the 
            GUI with a configuration option to select path.
            ** NOTE:  The preferences dialog enables the path to be updated, however,
            in version 0.4 this is not persistent yet.  You will need to update the 
            variable in the main python program (/usr/bin/acerhkgui) to have it be
            persistent.  Version 0.5 will make this a persistent option and
            create a config file (pickled variables) that are loaded on start and saved
            through the dialog.
                    
    b.  Testing for and displaying radio status (on/off) of the wireless / bluetooth radios.
        ** NOTE:  No progress on this yet.  I am looking for information on how to do
        check the status of these devices.  Haven't spent any real time on this
        at this point.  Clues / Hints would be helpful!  :)
        
    c.  Configuring the mail-led to be associated with "new mail" and turn on 
        if new mail exists.
        ** NOTE:  added gui to provide for settings, but no supporting code 
	written yet.  Future version will incorporate this as a check.
        
    d.  Setting up driver options for the wireless/bluetooth drivers for default and at 
        boot time.
        ** NOTE:  This will likely require the ability to edit a users /etc files and
        I am not quite ready to start messing with those. :)  A precursor to that will
        be learning to write / read a configuration file that is modified from the GUI.
        
    e.  Configuring the keys associated with the driver.  
        ** NOTE: Presently, my Acer Travelmate C300 Tablet has the internet, 
        mail, wireless, bluetooth, and P1/P2 keys are not correctly 
        associated.  I want to be able to configure this from this utility.  
        For users with similar problems, you may find help in the application 
        "keytouch" -- available in repository.  This application did cause 
        Ubuntu 8.04 to hang on shutdown and not sure if this has been resolved yet.

    PART f.  Refactor the code and develop functions to shorten code and simplify editing.
        ** NOTE:  You know!!! Really use the power of OOP to reuse code!  Remember, 
        this is my first "learn to program" project.  It is fun and lets me really 
        apply what I am learning.
        ** UPDATE:  This is still being worked on, but a large portion has already
        been done.
        ** UPDATE:  With version 0.4, I have noticed that I need to refactor several
        functions to the main program and not in the main class.  The 0.5 version will
        pull those functions out of the main AcerhkguiApp and place in the main program
        as global functions
	** UPDATE: 0.5 :: refactoring continues.
        
    DONE:  g.  Create .deb / .rpm pakages for the application.
    
    h.  Create a command line interactive script.

    I.  Create a NCURSES interface.
    
    J.  Allow acerhkgui to take arguments to start in a particular mode.
    
    DONE:  k.  Enable GUI to display driver information
    
    l.  Expand the AcerHK GUI to work with Asus laptops that take the command:
            echo 1 > /proc/acpi/asus/wled

	Have started setting conditions for this, however, still a long ways off.

    m.  
