# The &kmyapplication; Handbook

## Introduction

&kmyapplication; is an advanced shut down utility for &kde;.

Features:

- Turn Off Computer (logout and halt the system)

- Restart Computer (logout and reboot the system)

- Lock Session (lock the screen using a screen saver)

- End Current Session (end the current &kde; session and logout the user)

- Extras (additional, user commands)

- Time and delay options

- Command line and DCOP support

- System tray

- Visual and sound notifications

- &kde; Kiosk support

## Using &kmyapplication;

### Main Window

- Use the first combo box to select an action (turn off computer, extras, etc).

- Use the second combo box to select a delay type (no delay, time from now, etc).

- Click the Start button to activate the selected action. The action will be executed at the selected time.

- Click the Stop button or press Esc key to cancel an active action.

&kmyapplication; main window Main window

### System Tray

- Left mouse button - hide/show main window

- Middle mouse button - show menu with Actions (no delay!)

- Right mouse button - show context menu

## Command Line

    Usage: kshutdown [TQt-options] [TDE-options] [options] [time]

    A Shut Down Utility for TDE

    Generic options:
      --help                    Show help about options
      --help-tqt                Show TQt specific options
      --help-kde                Show TDE specific options
      --help-all                Show all options
      --author                  Show author information
      -v, --version             Show version information
      --license                 Show license information
      --                        End of options

    Options:
      -s, --shutdown            Turn off computer
      -h, --halt                Turn off computer
      -r, --reboot              Restart computer
      -k, --lock                Lock session
      -l, --logout              End current session
      -e, --extra <file>        Execute "Extras" command (.desktop file)
      --confirm                 Confirm command line action
      --standard                Show standard logout dialog
      -c, --cancel              Cancel an active action
      --init                    Don't show window at startup
      --test                    Enable test mode
      --default                 Disable test mode

    Arguments:
      time                      Time; Examples: 01:30 - absolute time (HH:MM); 10 - number of minutes to wait from now

## Kiosk

&kde; Kiosk allows you to control some critical features, such as Turn Off Computer or Restart Computer commands. To enable restrictions, you need to create a global configuration file - `kshutdownrc` in your global &kde; directory (`[prefix]/share/config`).

In some cases you need to restart &kmyapplication; to see effects.

Since version 0.3.1 Beta all Kiosk keys are prefixed with a "kshutdown_" string.

### Example kshutdownrc file with restrictions

    [TDE Action Restrictions][$i]
    # [$i] - user cannot override this group
    # false - feature is disabled
    # true - feature is enabled
    # by default all features are enabled

    # Disables the "Turn Off Computer" action
    kshutdown_action_shutdown=true
    # kshutdown_action_shutdown=false <- "false" will disable "Shut Down" action

    # Disables the "Restart Computer" action
    kshutdown_action_reboot=true

    # Disables the "Lock Session" action
    kshutdown_action_lockscreen=true

    # Disables the "End Current Session" action
    kshutdown_action_logout=true

    # Disables the "Extras" action
    kshutdown_action_extras=true

    # Disables the "Actions" page in the "Settings" dialog
    kshutdown_settings_actions=true

    # Disables the "Select a time" combo box,
    # and the command line "time" argument
    kshutdown_tab_time=true

    # Disables the "Statistics" dialog
    kshutdown_tab_stats=true

## DCOP API (KShutdownIface)

### Introduction

1. Make sure &kmyapplication; is running.

2. Type `kshutdown --init` to start &kmyapplication; without displaying its main window.

3. To display all DCOP functions, type `dcop kshutdown KShutdownIface`.

4. Run `dcop kshutdown MMainWindow hide` to hide the main window.

5. Run `dcop kshutdown MMainWindow show` to restore the main window.

### Functions

#### ASYNC cancel()

Cancels the active action.

#### bool shutDown(), bool shutdown()

Shuts down the system.

#### bool reboot()

Reboots the system.

#### bool lockScreen()

Locks the screen using a screen saver.

#### bool logout()

Logouts the current user and ends the session.

#### ASYNC configure()

[Since 0.6] Shows the settings dialog.

#### TQString getStatusInfo()

Returns a &kmyapplication; status information.

#### ASYNC makeInvisible()

[Since 0.9 Beta] Hiddes the main window and its system tray icon.

#### ASYNC makeVisible()

[Since 0.6] Shows and raises the main window. The window will be visible on the current desktop.

#### ASYNC setTestMode(bool yes)

Enables/disables the test mode.

##### Enable test mode

    dcop kshutdown KShutdownIface setTestMode true

##### Disable test mode

    dcop kshutdown KShutdownIface setTestMode false

## Credits and License

&kmyapplication;

Program Copyright 2005 Konrad Twardowski kdtonline@poczta.onet.pl

Documentation Copyright © 2005 Konrad Twardowski kdtonline@poczta.onet.pl

Czech FAQ Copyright © Robert Kratky

See Help | About &kmyapplication; for more credits.

&underFDL; &underGPL;
&documentation.index;