4. Setting up WM environment

Introduction

If you will use Calculate Linux for a business, or if multiple users are expected to access the system, you may need to standardize the user interface and/or to add new settings. To do this manually, for each user login, would have been rather cumbersome; fortunately, calculate-client is here to help you. Here we describe the procedure of setting your WM environment with calculate-client.

Settings templates

Calculate utilities use templates, which are a versatile and powerful setup tool. With templates, you can specify your system settings, install and configure a server or just change the look of your desktop.

See our detailed guide on using templates. Here we dwell on some practical examples of configuring user applications.

Location

If you are a Calculate Directory Server user, the desktop can be configured depending on the needs of your firm. When you join a Linux computer to the domain with cl-client, the network disk is mounted in the /var/calculate/remote directory. It is a good place for storing settings templates for all user profiles.

First of all, have a look at the templates we suggest as examples, included in the calculate-client package and stored in /usr/lib/calculate/calculate-client. The CLD and CLDX directories contain desktop templates, for Calculate Linux Desktop KDE and Calculate Linux Desktop XFCE, respectively.

By default, calculate-client 2.1.x utilities can handle as many directories as you need in the template; those will divide all settings in their logical components, treated in the alphabetical order. Any directory may contain an accessory file, named .calculate_directory, which defines when templates from this directory can be applied. If this file does not exist, the template will be applied every time at login. If it contains a false condition, the template from this directory will not be applied.

For instance, let us create the template MyFirm for Calculate Linux Desktop clients:

mkdir -p /var/calculate/remote/client-profiles/CLD/MyFirm

If you are a Calculate Linux Desktop XFCE user, replace the template directory from CLD to CLDX, here and later on in the examples.

Create the .calculate_directory file in the template directory, if you want to add conditions of applying the MyFirm template. If, for instance, you want add a condition of applying the template at first login only, append the following to the file:

# Calculate cl_pass_step==first

If you are a Calculate Linux Desktop user and have no domain, you can create the abovementioned directories either locally or on the network disk.

Usage

calculate-client utilities control many KDE4 desktop settings. Depending on the application, one or more template files are created. The majority of settings are stored in .kde4/share/config. Files in this directory have names similar to those of the applications, but with rc added at the end of the name. Additional settings can be stored in the application directories located in .kde4/share/apps. These directories are also named after the applications, but this time, no rc is added.

To create a template, you just have to create a file with the same path in the directory of the remote template.

Make sure the interpreter always determines the file format correctly; the first line of the template must include the format name. For most KDE4 configuration files, this will be kde:

# Calculate format=kde

The interpeter reads kde format and will append the template file to the existing configuration file. Hence, all you have to do is specify the required setting modifications.

Note that the absence of header in the template file, depending of the contents of the latter, will be understood either as a text file or a binary file. This file will only overwrite the current one.

Remember, too, that kde format has all variables resolved within the scopes of their names. These scopes all have names of their own, put in square brackets. The template should always specify the scope the replaced variables belong to.

The examples below will help you see it all more clearly.

Examples

Browser home page

Let us edit Konqueror's settings in the MyFirm template: namely, let us change the home page for a user account.

Create a path in the template:

mkdir -p /var/calculate/remote/client-profiles/CLD/MyFirm/.kde4/share/config/

where you will put a konquerorrc file, containing the following lines:
# Calculate format=kde
[UserSettings]
#Home page
HomeURL=http://www.google.com

The first line is a system line: it defines the configuration file format. By default, the template you have created is joined to the current one, thus modifying the variable values. When the user selects "Home", the Google page will be opened, even if they try to modify the settings later.

However, the page that is displayed first when the browser is launched will remain the same. This is a setting that should be configured separately, as shown below.
First of all, create the following path:

mkdir -p /var/calculate/remote/client-profiles/CLD/MyFirm/.kde4/share/apps/konqueror/profiles

where you will create a webbrowsing file, containing the following lines:
# Calculate format=kde
[Profile]
#opening the homepage when Konqueror starts
View0_URL=http://www.google.com

Now, whenever the user launches their browser, the Google home page will be displayed. Pressing the "home" button in the browser will produce the same result, of course.

Note that in both examples, the scopes of the variables [UserSettings] and [Profile] are specified. It is important to do so by locating the variables as soon as they were declared. This is required by the syntax of the configuration file.

Proxy

Let us see one more example, assuming you need to change the proxy server. You will have to create the following path:

mkdir -p /var/calculate/remote/client-profiles/CLD/MyFirm/single/.kde4/share/config

where you will put a kioslaverc file, that will contain the following:
# Calculate format=kde
[Proxy Settings]
AuthMode=0
NoProxyFor=
Proxy Config Script=
ProxyType=1
ReversedException=false
ftpProxy=http://proxy.mydomain.ru:8080
httpProxy=http://proxy.mydomain.ru:8080
httpsProxy=http://proxy.mydomain.ru:8080

Thank you!