Newer
Older

The support of VNC remote graphical desktops on JURECA enables us to presents the JSC to the HPC-Users in a fresh and modern way.
But a graphical desktop is of course not limited to eye-candy design alone.
A graphical desktop can increase productivity of each HPC-user as the workflows become more complex and change more often.
It also helps new users to shorten the time to debug, run and post-process their codes (e.g. debugging, performance and visualization tools are more easy to start use).
But different user groups and various research topics make sense for multiple desktop configurations.
The solution are XDG Desktop Profiles (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
They are located in *${XDG_PROFILES_DIR}* with each profile located in one subdirectory.
The current profile name is *${XDG_PROFILE}*.
A XDG desktop profile is a set of desktop configurations, most notable:
- background image
- desktop icons
- applications menu ("Start Menu")
- desktop widgets (information embedded into the background image)
- autostart
- application configurations
All of these settings are stored in files located in *${XDG_CONFIG_HOME}* for each user.
Global settings are stored in *${XDG_CONFIG_DIRS}*.
*${XDG_CONFIG_HOME}* is set to *${HOME}/.config/xdg_profiles/${XDG_PROFILE}*.
*${XDG_CONFIG_DIRS}* includes multiple directories starting with *${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/*
(in general *${XDG_CONFIG_HOME}* is set to *${HOME}/.config* and *${XDG_CONFIG_DIRS}* to */etc/xdg/*)
New configurations and modifications made by the user are stored in *${XDG_CONFIG_HOME}*.
These configurations overwrite all settings located in *${XDG_CONFIG_DIRS}*.
All XDG data, which is independent of a certain configuration, is stored in *${XDG_DATA_HOME}* for each user or in *${XDG_DATA_DIRS}* system-wide.
This can be
- background images
- .desktop-files for desktop icons, menus or autostart files
- icons
- submenus for the application menu
- mime type settings
- infoterm directories
*${XDG_DATA_HOME}* is set to *${HOME}/.local/xdg_profiles/${XDG_PROFILE}*.
*${XDG_DATA_DIRS}* includes multiple directories starting with *${XDG_PROFILES_DIR}/${XDG_PROFILE}/data/*
(in general *${XDG_DATA_HOME}* is set to *${HOME}/.local* and *${XDG_DATA_DIRS}* to */usr/local/share:/usr/share*)
#### ${XDG_CACHE_HOME}, ${XDG_RUNTIME_DIR}
Other XDG environment variables set are *${XDG_CASE_HOME}* and *${XDG_RUNTIME_DIR}*.
They are described in https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html.
#### ${XDG_PROFILES_DIR}/${XDG_PROFILE}
Each XDG desktop profile is stored in its own XDG_CONFIG-directory (e.g. */etc/xdg/xdg_profiles/\<profile\>/*) and inherit configurations from the desktop profiles 'default' and the linux-distribution-defaults in */etc/xdg*.
Hence, a new XDG desktop profile might consist only of some additional desktop icons, a different background image or an new sub-menu for the application menus added on top of the default profile.
The XDG Desktop Profile is chosen by setting *${XDG_PROFILE}* just before the VNC server is started.
On JURECA the command *vncserver* has the additional option *'profile'*
```shell
vncserver -profile vis
``
The VNC server calls *${HOME}/.vnc/xstartup[.turbovnc]* (use *dot.vnc/xstartup[.turbovnc]* from this repository),
which must call **xdg_profile_set.sh** currently located in *etc/xdg/* of this repository.
If the directory *etc/xdg/xdg_profiles/${XDG_PROFILE}* exists, xdg_profile_set.sh sets the *${XDG_CONFIG_\*}* and *${XDG_DATA_\*}* variables and some more.
Additionally this script clears cache, creates desktop links and copies other files.
Example: starting a VNC-server-job with an the visualization XDG desktop profile on a visualization the visualization partition of JURECA:
salloc -N 1 -p vis --gres=mem512,gpu:1 --start-xserver --time=1:00:00
srun -n 1 --cpu_bind=none --gres=gpu:1 bash -c 'vncserver -profile vis'
XDG Base Directory Specification are supported by most of the popular desktop systems found on Linux (GNOME, KDE, XFCE etc.). On JURECA we use XFCE4 as a light weighted desktop system.
XFCE4 specific configurations are stored in *${XDF_CONFIG_\*}/xfce4/* and
XFCE4 specific data is stored in *${XDF_DATA_\*}/xfce4/*. Examples are:
- desktop settings
- desktop settings file (including background image)
- ${XDF_CONFIG_\*}/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
- ${XDG_CONFIG_\*}/xfce4/desktop/menu.xml
- ${XDG_CONFIG_\*}/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
The background image is set in *${XDF_CONFIG_\*}/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml*.
The first XDF_CONFIG-directory, which includes this file sets the background image.
It is not processed by bash and must not include any system variables.
Background images of desktop profiles should be located in *${XDF_DATA_\*}/xfce4/backdrops/* to be found by XFCE4 on default.
XFCE4 can loop through background images.
Therefore multiple images must be listed in */etc/xdg/xdg_profiles/\<profile\>/xfce4/desktop/backdrop.list*.
backdrop-cycle-enable and backdrop-cycle-timer must be set in */etc/xdg/xdg_profiles/\<profile\>/xfce4/xfconf/xfce-perchannel.xml/xfce4-desktop.xml*.
##### .desktop files
Any .desktop file found in the XDG_DESKTOP directory is shown on the desktop.
XDG_DESKTOP_DIR can be set in ${XDG_CONFIG_HOME}/user-dirs.dirs and is ${HOME}/Desktop by default.
XDG Desktop Profiles must include a user-dirs.dir in *etc/xdg/xdg_profiles/\<profile\>/config/*,
which sets XDG_DESKTOP_DIR to ${HOME}/.local/xdg_profiles/\<profile\>/Desktop (== ${XDG_DATA_HOME}/Desktop).
The .desktop files of an XDG desktop profile must be located in *etc/xdg/xdg_profiles/\<profile\>/data/Desktop/*.
On each login links will be created in ${XDG_DATA_HOME}/Desktop/ to all files in this directory.
##### positions
In XFCE4 icons are positioned with row/column coordinates.
The position is stored in *${XDF_CONFIG_\*}/xfce4/desktop/icons.screen?-<resolution-identifier>.rc*.
If the size of each cell is changed, the coordinates remain the same but the grid gets enlarged.
XFCE4 will rearrange all icons on the desktop, if the screen resolution is smaller than the required resolution needed to fit the max. row or max. column.
Hence, icons be placed in the top left area of the desktop and must fit on a min. resolution of 1024x768 in each desktop profile.
The applications menu is generated from the file *etc/xdg/xdg_profiles/default/config/menus/xfce-applications.menu*.
It merges additional menus from *${XDG_CONFIG_\*}/menus/application-merged/*.
Sub-menu of XDG desktop profiles are located in *etc/xdg/xdg_profiles/\<profile\>/config/menus/application-merged/.
Profile-specific .directory-files must be placed in *etc/xdg/xdg_profiles/\<profile\>/data/desktop-directories/*.
Additional information can be found here *https://wiki.xfce.org/howto/customize-menu*.
Sub-menus of general profiles (like 'Visualization', 'Performance Analysis', etc.) can be placed in the profile 'default', too, to be visible in any profile.
##### Customize Menu Entries
Any menu entry belongs to a corresponding .desktop-file in *${XDG_DATA_DIRS}/applications*.
The category name (defined by xfce-applications.menu and its .directory-files) describes in which sub-menu it will be placed.
Example: vis.directory defines the category "Visualization".
Adding "Category=Visualization" to a .desktop-file will place it in the sub-menu "Visualization".
The application menu icon is set in *${XDF_CONFIG_\*}/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml*.
By default it is set in the default profile in *etc/xdg/xdg_profiles/default/config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml*
to the FZJ logo located in *etc/xdg/xdg_profiles/default/data/pixmaps/fzj-logo_64x64.png*.
##### MIME Types
MIME types are defined in ${XDG_DATA_DIRS}/mime/packages.
Add new mime types to Override.xml in this directory
##### Places
The file manager thunar reads ${HOME}/.gtk-bookmarks (and in new versions ${XDG_CONFIG_HOME}/gtk-3.0/bookmarks to add shortcuts to certain places.
Here we can add ${WORK} and ${ARCH} for example.
file://PATH_TO_YOUR_FOLDER PLACE_NAME
An info terminal can be part of a profile to present text information to the user.
Jens Henrik Goebbert
committed
<<<<<<< HEAD
It is located in *${XDG_DATA_DIR}/infoterm-\<cmd\>-\<profile\>*.
Jens Henrik Goebbert
committed
=======
It is located in *etc/xdg/xdg_profiles/\<profile\>/config/infoterm-\<profile\>*.
It is started via the desktop-file *etc/xdg/xdg_profiles/\<profile\>/config/autostart/infoterm-\<profile\>.desktop* on every start of XFCE4 with the desktop profile \<profile\>.
In all directories of XDG_CONFIG_DIRS the script infoterm-\<profile\>.sh is searched and (if found) executed:
```shell
IFS=:
for p in ${XDG_CONFIG_DIRS}; do
if [ -e ${p}/infoterm-\<profile\>/infoterm-\<profile\>.sh ]; then
${p}/infoterm-\<profile\>/infoterm-\<profile\>.sh
infoterm-\<profile\>.sh must be unique and only part of a single desktop profiles - do not use the same name in multiple desktop profiles.
Jens Henrik Goebbert
committed
>>>>>>> 9561c64f238d0d8ee272bb4c99c8121c96fa1761
It is started via the desktop-file *etc/xdg/xdg_profiles/\<profile\>/config/autostart/infoterm-\<cmd\>-\<profile\>.desktop* on every start of XFCE4 with the desktop profile \<profile\>.
The configuration of the info terminal is done partly in *infoterm-\<cmd\>-\<profile\>.sh* and partly by setting the application specific XDG_CONFIG_HOME to *etc/xdg/xdg_profiles/\<profile\>/data/infoterm-\<cmd\>-\<profile\>*.
This is for settings, which cannot be done via command line parameters like transparency and are only stored in configuration files.
##### window settings
An info terminal is supposed to stay in the background and should not be present in the tasklist or on the pagers.
This is achived via devilspie2 (https://savannah.nongnu.org/projects/devilspie2).
Devil's Pie can be configured to detect windows as they are created, and match the window to a set of rules.
If the window matches the rules, it can perform a series of actions on that window.
These rules are stored in *etc/xdg/xdg_profiles/\<profile\>/config/devilspie2/\*.lua*
and copied to *${XDG_CONFIG_HOME}/devilspie2/* on each VNC-server-start.
You can find an example in *etc/xdg/xdg_profiles/vis/config/devilspie2/infoterm-vis.lua*
Devil's Pie runs in the background and is called from *etc/xdg/xdg_profiles/default/autostart/devilspie2.desktop*
- use xdg_profile_clone.sh to clone an XDG profile and store it in ${HOME}/.local/xdg/xdg_profiles/\<profile\>
- login to your cloned profile and modify as you like
- use xdg_profile_publish.sh to make your new profile
1. Absolute paths are present in the configuration files of this repository. They have to be changed before use:
- **call ./setup.sh to change the paths**
2. copy or link dot.vnc/xstartup[.turbovnc] to your ~/.vnc directory
3. read TODO to know what's coming next
## Comments
1. System messages are received via DBus notification protocol (org.freedesktop.Notifications) implemented in libnotify.
Xfce4-notifyd (http://goodies.xfce.org/projects/applications/xfce4-notifyd) displays these messages to the user.
But the messages can also be caught and processed from anyone else (e.g. http://bazaar.launchpad.net/~jconti/recent-notifications/trunk/view/head:/recent_notifications/Notification.py)
Nice-to-know: Desktop notifications support HTML (http://www.galago-project.org/specs/notification/0.9/x161.html)