# The &kchildlock; Handbook

Rene Landert

    rene.landert@bluewin.ch

2008 2011 Rene Landert
&FDLNotice;
2011-06-15
0.90.3

&kchildlock; is a tool to monitor and restrict the usage time of a children spent on the computer.

KDE kchildlock restrict children usage computer

## Introduction

kchildlock is a tool to monitor and restrict the time a children spends on the computer. The limits can be specified per day of the week, by lower and upper hour limits, maximum daily usage time, and maximum weekly usage time. The same restriction limits can be applied to applications based on the user login. Please report any problems or feature requests to the author

    rene.landert@bluewin.ch

## Enable kchildlock

To enable kchildlock, open a shell and enter `kdesu systemsettings` or select from the Kickoff application launcher Configure Desktop.

How to configure kchildlock

Click on the tab Advanced at the top of the menu. You will now see in the section System the icon for kchildlock.

personal settings - system

By clicking on the Icon for kchildlock you start the configuration of the restrictions. The monitoring daemon 'kded_kchildlockdaemon.so' will start after the next user login, which enforces the configured restrictions. The daemon is started automatically by KDE each time a user logs in.

Only the 'root' user can change the settings in the configuration dialog, so you have to provide the root password.

root privileges are required

If the user does not provide the root password and clicks on the "Ignore" Button, he just can display the settings in the configuration dialog, but he can not save the changed values.

root privileges are required

To disable the restrictions, either uninstall the package or disable it on the general settings page.

If the limit for the usage time for the specified user is reached, the KDE session will be closed. The user will receive notifications 15, 10 and 5 minutes before the logout to finish his work (or end his game...). If restrictions for applications are enabled, the same kind of messages are displayed, and at last the application will be terminated.

Notification window

## Configuration

### The general configuration settings

On this page you configure the general settings.

kchildlock general settings

- The first checkbox is to enable or disable the restrictions globally.

- The second checkbox is to enable or disable the display of the system tray icon. This icon informs the user about the used and remaining times.

- The scan interval is the interval between two consecutive checks for the restrictions. By default the check will be executed once every minute.

### Add or delete users and groups

You select a new user or group by clicking on the icon with the small green plus sign. A window with the possibility to choose a user or a group from the list of available linux users or linux groups will appear. Pick the desired name.

kchildlock select a user
kchildlock select a group

After adding a new user or group, this user / group will be added to the list. Click on the desired user / group to edit the restrictions.

To delete the restricitions of user or group, highlight the desired name and click on the icon with big red cross. You have to confirm the deletion.

kchildlock select a user

### Export and Import of profiles

You can export all the settings to a directory. This directory will get the configuration files (these are the so called profiles). The settings of each user and group will be written in a file, the general settings will be written in a main configuration file. The profiles can be edited with any text editor. Click on the icon with the exporting arrow, then choose the directory.

kchildlock export profiles

You can import the settings for a defined user or group by clicking on the icon with the importing arrow. Then choose the profile.

kchildlock import a profile

### The settings for login time restrictions

HINT: The restrictions for a group will be applied to every member of the group. If the user has user restrictions too, both will be applied.

On the first tab you configure the login times for the highlighted user or group.

kchildlock login time settings

- enable Restriction for this user: enables the restrictions if checked. If not checked, all the other detailed restrictions on the lower part of the screen are ignored.

- Username: choose the user for whom the restrictions will be applied.

- same restrictions for every day: if checked, the same restrictions for the specified user will be applied to every weekday.

- red and green time slider: this slider shows the allowed times for active sessions. The green area shows the allowed time range, In the red area there is no session allowed. You can move the whole range, or only the upper or lower limit by clicking with the mouse on the yellow border and drag it to the left or right. The time limits are displayed beneath the slider.

- restrictions depend on weekday: if checked, the restrictions for the specified user will be applied to the individual days of the week.

- Monday ... Sunday: if checked, the restrictions for the specified user will be applied on this day of week. If not checked, there will be NO restriction on this day of week!

- red and green time slider: allow active sessions in the green time range.

In the above example, user "martin" is allowed to have an active session on the computer from 10:00 am to 8:00 pm on Mondays. If he logs in at 7:00 pm, he will be logged out at 8:00 pm. The same restrictions are applied on Tuesdays. On Wednesdays he may log in earlier the morning. On Saturdays there are NO restrictions, he may use the computer as long as the maximal weekly usage is not reached...

If you want to disallow the usage on a certain weekday, limit the usage to a short time window from ⪚ 03:00 to 03:15

### The settings for time duration restrictions

On the second tab you configure the time durations for the highlighted user or group.

kchildlock time duration settings

- enable Restriction for this user: meaning see previous chapter.

- Username: meaning see previous chapter.

- same restrictions for every day: meaning see previous chapter.

- max hrs and mins per day: allowed time (measured in hours and minutes) for the user to have an active session per day.

- restrictions depend on weekday: meaning see previous chapter.

- Monday ... Sunday: if checked, the restrictions for the specified user will be applied on this day of week. If not checked, there will be NO time limit on this day of week!

- max hrs and mins per day: allowed time (measured in hours and minutes) for the user to have an active session on this weekday.

- total weekly usage: allowed time (measured in hours and minutes) for the user to have an active session on the whole week.

In the above example, user "martin" is allowed to work on the computer for 2 hours 30 minutes on mondays. If he logs in at 11:00 am, he will be logged out at 1:30 pm. The same restrictions are applied on Tuesdays, Wednesdays and Thursdays. On a Friday he may work 5 hours. On Saturdays there are NO restrictions, he may use the computer as long as the maximal weekly usage is not reached... This weekly limit is 8 hours per week in this example. The values for the usage times are reset to zero the first time you log in on a new week.

### The settings for application times restrictions

On the third tab you configure the allowed times for working with applications. You can specify up to five applications for each user / group.

kchildlock application times settings

- enable Restriction for Application: first click on the "enable" button and then enter the name of the appplication which is restricted. The name has to be a part of the unix process name, as you can see it on a command shell when you type the command 'ps ux'. To limit the mentioned chat program, you could give a name like e.g. 'kopete' or 'kopet' or 'opete' or 'kope'. Every unix process of the given user which contains the string will be terminated!

- red and green time slider: meaning see previous chapter.

In the above example, user "peter" is allowed to use the chat program 'kopete' from 12:00 am to 10:00 pm. If he starts the application before 12 am in the morning or after 10 pm, the application will be terminated immediately. The limitations to play 'Age of Empire' is from 4 pm to 11 pm. Outside these limits the game is over!

### The settings for application duration restrictions

On the fourth tab you configure the allowed amount of time per day and per week for working with applications. You can again specify up to five applications for each user / group.

kchildlock application duration settings

- enable Restriction for Application: meaning see previous chapter.

- max hrs and mins per day: allowed time (measured in hours and minutes) for the application to be active for this user per day.

- max hrs and mins per week: allowed time (measured in hours and minutes) for the application to be active for this user per week.

In the above example, user "henry" is allowed to use the chat program 'kopete' for maximal 2 hours 30 minutes each day and 8 hours the whole week. The limitations to play 'Age of Empire' are up to 1 hour 30 minutes each day and 4 hours the whole week. After this time the game is over! The values for the weekly usage times are reset to zero the first time you log in on a new week.

## User System Tray Information

If you enable the system tray icon for the user, he will get a appropriate icon in the system tray.

system tray icon

By doing a right mouseclick, he will see the following context menu:

context menu for system tray icon

After clicking on the menu "Show Restrictions" the current status will be displayed.

current status of restrictions

The displayed values are the current limitations, and the remaining time for today and for this week. The progress bar displays the percentage values for these times.

## Command Reference

### Technical informations

If you want to enable the logging function of the daemon, create a file '/var/opt/kchildlock/kchildlockd__debuglog.tmp' with any content. The generated log files will be named like '/var/opt/kchildlock/kchildlockd_yyyymmdd_HHMMSS_debuglog.tmp'.

Important files are:

/var/opt/kchildlock/kchildlockd__debuglog.tmp : to enable writing a debug log file

/var/opt/kchildlock/kchildlockd_yyyymmdd_HHMMSS_debuglog.tmp : debug log file, generated on HH:MM:SS on mm/dd/yyyy.

/var/opt/kchildlock/.kch_time.dat : keeps the consumed usage times of a all users

/usr/share/kde4/config/kchildlockrc : main configuration entered by the GUI

/usr/share/kde4/config/kchildlockrc_U_"username" : configuration for a specific user entered by the GUI

/usr/share/kde4/config/kchildlockrc_G_"groupname" : configuration for a specific group entered by the GUI

## Questions and Answers

&reporting.bugs; &updating.documentation;

## Credits and License

&kchildlock;

Program copyright 2008-2011 Rene Landert rene.landert@bluewin.ch

Contributors:

- Rene Landert rene.landert@bluewin.ch

Documentation copyright 2008-2011 Rene Landert rene.landert@bluewin.ch

&underFDL; &underGPL; &underBSDLicense; &underArtisticLicense; &underX11License;

## Installation

### How to obtain &kchildlock;

You can get kchildlock from the KDE applications home page or from The &kchildlock; home page.

### Requirements

In order to successfully use &kchildlock;, you need &kde; 4.x. and the package 'ConsoleKit'.

All required libraries as well as &kchildlock; itself can be found on The &kchildlock; home page.

You can find a list of changes at the same site.

### Compilation and Installation

In order to compile and install kchildlock on your system, do the following steps

- `cd' to the directory containing the package's source code.

- Type `cmake -G KDevelop3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DDATA_INSTALL_DIR=/usr/share/kde4/apps -DICON_INSTALL_DIR=/usr/share/icons' to configure the package for your environment. You may have to adapt the paths to your linux installation.

- Type 'make' to compile the package.

- Type `make install' to install the programs and any data files and documentation. This has to be done as root user.

&documentation.index;