SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

gLaptop v0.4

Covered by the GNU Public License
(See COPYING for more information)

Author: Scott Fritzinger <scottf@unr.edu>

Contributor: Evan Webb <spyder@cotcomsol.com>

        (Everyone can thank Evan for the 0.4 release. He did all the
        patches and improvements. Thanks Evan!)

Introduction

        This is the fourth release of gLaptop. It aims to be an all-in-one
        app for any laptop user.

        Features include:
                * Standby (turn off monitor/hard drive)
                * Suspend (save status to disk, and shutdown)
                * PC-Card (PCMCIA) swap button
                * Battery Meter (% remaining)
                * AC-online indicator (when on AC power)
                * Time-Remaining indicator (when on battery)
                * Show/hide Battery Meter
                * Variable number of customizable toggle buttons

        Not yet supported:
                * Hot-Swap Drive Support
                * Auto-shutdown/suspend at a given battery percentage.

        New in V0.4
                * Small display type, to fit into smaller panel

        Mail any "wish lists" to me at scottf@unr.edu

Requirements

  • GNOME 1.0+
  • apmd
  • pcmcia kernel extensions (optional)

    (you have this if the 'cardctl' program exists)

Installation

  1. If you're reading this, then you already have it unpacked. :) If you somehow accidentally got this file out without knowing what you did, then unpack the archive by

    tar zxvf gLaptop-0.4-1.tar.gz

  2. Change to the gLaptop-0.4-1 directory
  3. type 'make'

    NOTE: if you want more or less than 16 customizable toggle buttons, edit the main.h file, and change the value of MAX_BUTTONS. just note that you can view/hide any of the buttons, so if you leave it at 16 buttons, not all 16 buttons will be visible unless you say so in the "properties" configuration dialog. just try it at 16 and you'll see.

  4. type 'make install" (binary "glaptop_applet" is installed to /usr/local/bin, assumes /etc/CORBA/servers contains the corba server files, and /usr/share/applets is the base directory for your gnome applets.)
        To add to the gnome panel, right click on the panel, select
        "Add Applet", then under "Utility" select "gLaptop"

Using gLaptop

        I love tooltips, so chances are if you leave your cursor over a 
        button or entry for a couple seconds, there will be info on what
        that button/entry does. If you feel i am killing tooltips and
        you suddenly develop a fear of text that pops up out of nowhere,
        let me know :)

        If you ran past versions of gLaptop, you will need to edit
        your toggle buttons again (just the "description" field).

        Also, the toggle buttons, when clicked, display the output of
        the program that they run. This means that any text that is 
        printed from the script/program will be displayed in a window.
        This is handy in cases where you need feedback from the program.

Notes

        Some uses for the toggle buttons:
                * PPP on/off
                        A script can be run to turn on ppp, and then
                        the output can display the IP address, which
                        is of course displayed in a window. Example:
                        Label = "PPP"
                        Description = "Activate/Deactivate PPP"
                        "Button Pressed" = "ppp-on"
                        "Button Released" = "ppp-off"

                * Network Interface on/off
                        Again, turn on/off the network interface, and
                        if you use DHCP, you can display the IP address.
                        (No good example here. Be creative :)

                * Mount/umount drives
                        Press once to mount the drive; press again
                        to unmount. I use this one. Example:
                        Label = "Mnt CD"
                        Description = "Mount the CD-ROM Drive"
                        Button Pressed = "mount /dev/hdc /mnt/cdrom"
                        Button Released = "umount /mnt/cdrom"

ISSUES

  • Swapping PC-Cards may fail or take a long time. The PCMCIA kernel extensions don't like it when cardctl is called one right after another in a program (2 consecutive "system()" calls). Quick work around: it pauses for 1 second before calling cardctl for the second time.
  • No access to the /dev/apm_bios device. Not really a bug, just a system issue. If you want non-root access to it, either change permissions to provide global read/write (bad way(tm)), or create a group ("apm"), change permissions and group ownership on the device ("chmod g+rw /dev/apm_bios", "chgrp apm /dev/apm_bios") and add your user to that group (better way(tm))
  • Do NOT setuid the gLaptop executable as ROOT!!!!!!!!!!!!!!! This is a newbie mistake and should NOT be done. gLaptop uses system calls to execute the scripts and other things. If you setuid to root, then any user can execute ANY executable on your system which is VERY BAD! Instead, create the groups as described in the above (apm_bios) section.

More info

        More information on this program can be found at
                http://www.scs.unr.edu/~scottf/glaptop

        or by mailing me
                scottf@unr.edu


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.