Commit 7e825544 authored by Jens Henrik  Goebbert's avatar Jens Henrik Goebbert

major update

parent 690be2c7
......@@ -9,7 +9,9 @@ A graphical desktop can increase productivity of each HPC-user as the workflows
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)
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}*.
## What is an XDG Desktop Profile?
......@@ -21,22 +23,33 @@ A XDG desktop profile is a set of desktop configurations, most notable:
- desktop widgets (information embedded into the background image)
- autostart
- application configurations
- bookmarks
#### ${XDG_CONFIG_*}
All of these settings are stored in files located in *${XDG_CONFIG_HOME}* for each user.
Global settings are stored in *${XDG_CONFIG_DIRS}*.
The default of *${XDG_CONFIG_HOME}* is *${HOME}/.config/* and the default of global settings is */etc/xdg/*.
*${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}*.
#### ${XDG_DATA_*}
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.
The default for *${XDG_DATA_HOME}* is *${HOME}/.local* and for *${XDG_DATA_DIRS}* it is */usr/local/share:/usr/share*.
#### /etc/xdg/xdg_profiles/\<profile\>/
Each XDG desktop profile is stored in its own XDG_CONFIG-directory (*/etc/xdg/xdg_profiles/\<profile\>/*) and inherit configurations from the desktop profiles 'default' and the linux-distribution-defaults in */etc/xdg*.
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_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.
......@@ -45,17 +58,18 @@ Hence, a new XDG desktop profile might consist only of some additional desktop i
The XDG Desktop Profile is chosen with *${XDG_PROFILE}* just before the VNC server is started.
```shell
export XDG_PROFILE=vis
vncserver -fg -geometry 1920x1080
vncserver -geometry 1920x1080
```
The VNC server calls *${HOME}/.vnc/xstartup* (use *dot.vnc/xstartup* from this repository),
which must call **xdg_profile.sh** currently located in *etc/xdg/* of this repository.
The VNC server calls *${HOME}/.vnc/xstartup[.turbovnc]* (use *dot.vnc/xstartup[.turbovnc]* from this repository),
which must call **xdg_profile_init.sh** currently located in *etc/xdg/* of this repository.
If the directory *etc/xdg/xdg_profiles/${XDG_PROFILE}* exists, xdg_profile.sh sets the *${XDG_CONFIG_\*}* and *${XDG_DATA_\*}* variables. .
If the directory *etc/xdg/xdg_profiles/${XDG_PROFILE}* exists, xdg_profile_init.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:
```shell
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 'export XDG_PROFILE=vis; vncserver -fg -geometry 1920x1080'
srun -n 1 --cpu_bind=none --gres=gpu:1 bash -c 'export XDG_PROFILE=vis; vncserver -geometry 1920x1080'
```
......@@ -128,44 +142,31 @@ The application menu icon is set in *${XDF_CONFIG_\*}/xfce4/xfconf/xfce-perchann
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
#### Info-Terminal
An info terminal can be part of a profile to present text information to the user.
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
break
fi
done
```
infoterm-\<profile\>.sh must be unique and only part of a single desktop profiles - do not use the same name in multiple desktop profiles.
It is located in *${XDG_DATA_DIR}/infoterm-\<cmd\>-\<profile\>*.
The configuration of the info terminal is done partly in *infoterm-\<profile\>.sh* and partly by setting the application specific XDG_CONFIG_HOME to *etc/xdg/xdg_profiles/\<profile\>/config/infoterm-\<profile\>*.
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.
## How to generate a new profile
#### Create the XDG desktop profile
1. Rename your ${HOME}/.config to start with no user-specific configurations.
2. Start VNC with the default profile:
```shell
export XDG_PROFILE=default
vncserver -fg -geometry 1920x1080
```
3. Make your changes (background, icons, menu entries)
4. logout
#### Store the XDG desktop profile
1. Copy *${HOME}/.config/xdg_profiles/default* to *etc/xdg/xdg_profiles/\<new-profile-name\>/config/*
2. Replace absolute paths pointing to locations inside your ${HOME} (use setup.sh).
3. Copy .desktop-files generated in ${HOME}/Desktop to *etc/xdg/xdg_profiles/\<new-profile-name\>/data/*.
- 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
## IMPORTANT NOTICE:
......@@ -173,4 +174,4 @@ vncserver -fg -geometry 1920x1080
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 to your ~/.vnc directory
2. copy or link dot.vnc/xstartup[.turbovnc] to your ~/.vnc directory
# set XDG base directory (public and private one)
export XDG_BASE=/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg
export XDG_BASE_HOME=${HOME}/.local/xdg
# set XDG profiles directory
export XDG_PROFILES_DIR=${XDG_PROFILES_DIR:-/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg/xdg_profiles}
# set XDG config variables depending on XDG_PROFILE
. ${XDG_BASE}/xdg_profile_set.sh
# initialize XDG profiles
source ${XDG_PROFILES_DIR}/../xdg_profile_init.sh
# run XFCE4
# run XFCE4
# (replaces the current shell with startxfce4, without forking a new process)
exec startxfce4
# ---- nothing will be called after 'exec', as it replaces the current program! ----
# set XDG base directory (public and private one)
export XDG_BASE=/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg
export XDG_BASE_HOME=${HOME}/.local/xdg
# set XDG profiles directory
export XDG_PROFILES_DIR=${XDG_PROFILES_DIR:-/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg/xdg_profiles}
# set XDG config variables depending on XDG_PROFILE
. ${XDG_BASE}/xdg_profile_set.sh
# initialize XDG profiles
source ${XDG_PROFILES_DIR}/../xdg_profile_init.sh
# run XFCE4
# run XFCE4
# (replaces the current shell with startxfce4, without forking a new process)
exec startxfce4
# ---- nothing will be called after 'exec', as it replaces the current program! ----
......@@ -3,10 +3,10 @@
print_usage() {
echo "Usage: ${0} [OPTION]..."
echo "List information of XDG profile categories."
echo "Categories are searched in XDG_BASE/xdg_profiles and XDG_BASE_HOME/xdg_profiles."
echo "Categories are searched in XDG_PROFILES_DIR and XDG_PROFILES_HOME."
echo "Currently they are set to: "
echo " XDG_BASE =${XDG_BASE}"
echo " XDG_BASE_HOME=${XDG_BASE_HOME}"
echo " XDG_PROFILES_DIR =${XDG_PROFILES_DIR}"
echo " XDG_PROFILES_HOME=${XDG_PROFILES_HOME}"
echo
echo "Mandatory arguments to long options are mandatory for short options too."
echo " -h, --help Print usage."
......@@ -16,8 +16,8 @@ print_usage() {
print_categories() {
# check
if [[ ! -d ${XDG_BASE} ]]; then
echo "ERROR: XDG_BASE not set."
if [[ ! -d ${XDG_PROFILES_DIR} ]]; then
echo "ERROR: XDG_PROFILES_DIR not set."
return
fi
......@@ -26,7 +26,7 @@ print_categories() {
local XDG_PROFILE_CATEGORIES_DESCRIPTION=()
local XDG_PROFILE_CATEGORIES_CREATOR=()
if [[ -f ${XDG_BASE}/xdg_profiles/xdg_profiles.info ]]; then
if [[ -f ${XDG_PROFILES_DIR}/xdg_profiles.info ]]; then
while read line; do
# read each line starting with "XDG_PROFILE_CATEGORY="
prefix="XDG_PROFILES_CATEGORY="
......@@ -36,10 +36,10 @@ print_categories() {
XDG_PROFILE_CATEGORIES_DESCRIPTION+=("$( echo ${line} | cut -d';' -f 2)")
XDG_PROFILE_CATEGORIES_CREATOR+=("$( echo ${line} | cut -d';' -f 3)")
fi
done < ${XDG_BASE}/xdg_profiles/xdg_profiles.info
done < ${XDG_PROFILES_DIR}/xdg_profiles.info
fi
if [[ -f ${XDG_BASE_HOME}/xdg_profiles/xdg_profiles.info ]]; then
if [[ -f ${XDG_PROFILES_HOME}/xdg_profiles.info ]]; then
while read line; do
# read each line starting with "XDG_PROFILE_CATEGORY="
prefix="XDG_PROFILES_CATEGORY="
......@@ -49,7 +49,7 @@ print_categories() {
XDG_PROFILE_CATEGORIES_DESCRIPTION+=("$( echo ${line} | cut -d';' -f 2)")
XDG_PROFILE_CATEGORIES_CREATOR+=("$( echo ${line} | cut -d';' -f 3)")
fi
done < ${XDG_BASE_HOME}/xdg_profiles/xdg_profiles.info
done < ${XDG_PROFILES_HOME}/xdg_profiles.info
fi
# print profile categories
......
......@@ -12,7 +12,7 @@ print_settings() {
echo "2) Profile Root: ${prof_root}"
echo "3) Profile Id: ${prof_id}"
if [[ ! -z ${prof_id} ]]; then
echo " Profile Path: ${XDG_BASE_HOME}/xdg_profiles/${prof_id}"
echo " Profile Path: ${XDG_PROFILES_HOME}/${prof_id}"
fi
echo "4) Profile Name: ${prof_name}"
echo "5) Profile Description: ${prof_description}"
......@@ -59,7 +59,7 @@ get_profile_root() {
print_settings
IFS=$'\n'
XDG_PROFILE_LIST=($(${XDG_BASE}/xdg_profile_list.sh ))
XDG_PROFILE_LIST=($(${XDG_PROFILES_BIN}/xdg_profile_list.sh ))
unset IFS
create_menu "Available Profiles" "Please choose a profile the new profile shall be cloned from: " ${XDG_PROFILE_LIST[@]}
......@@ -82,7 +82,7 @@ get_profile_id() {
echo
echo "The following ids are already in use. Choose a DIFFERENT one."
${XDG_BASE}/xdg_profile_list.sh -a
${XDG_PROFILES_BIN}/xdg_profile_list.sh -a
echo
# loop until valid input is entered or cancel is pressed.
......@@ -102,13 +102,13 @@ get_profile_id() {
if [[ -z "$prof_id" ]]; then # check if profile identifier is blank
echo "You must enter a non-blank project identifier. Please try again."
elif [[ -d ${XDG_BASE}/xdg_profiles/${prof_id} ]] || [[ -f ${XDG_BASE}/xdg_profiles/${prof_id} ]]; then # check if profile exists
echo "The profile identifier is already in use in ${XDG_BASE}."
elif [[ -d ${XDG_PROFILES_DIR}/${prof_id} ]] || [[ -f ${XDG_PROFILES_DIR}/${prof_id} ]]; then # check if profile exists
echo "The profile identifier is already in use in ${XDG_PROFILES_DIR}."
echo "Please choose a different one."
elif [[ -d ${XDG_BASE_HOME}/xdg_profiles/${prof_id} ]] || [[ -f ${XDG_BASE_HOME}/xdg_profiles/${prof_id} ]]; then # check if profile exists in ${HOME} of user
echo "The profile identifier is already in use in ${XDG_BASE_HOME}."
echo "Delete ${XDG_BASE_HOME}/${prof_id} or choose a different one."
elif [[ -d ${XDG_PROFILES_HOME}/${prof_id} ]] || [[ -f ${XDG_PROFILES_HOME}/${prof_id} ]]; then # check if profile exists in ${HOME} of user
echo "The profile identifier is already in use in ${XDG_PROFILES_HOME}."
echo "Delete ${XDG_PROFILES_HOME}/${prof_id} or choose a different one."
elif [[ ! $prof_id =~ ^[A-Za-z0-9_]+$ ]]; then
echo "You must build the profile identifier out of following characters [A-Za-z_]. Please try again."
......@@ -198,7 +198,7 @@ get_profile_category() {
print_settings
IFS=$'\n'
XDG_PROFILE_CATEGORIES=($(${XDG_BASE}/xdg_profile_categories.sh ))
XDG_PROFILE_CATEGORIES=($(${XDG_PROFILES_BIN}/xdg_profile_categories.sh ))
unset IFS
create_menu "Available Profile Categories" "Please choose a category for the new profile: " ${XDG_PROFILE_CATEGORIES[@]}
......@@ -212,18 +212,18 @@ get_profile_category() {
clear
show_title "create and store a new XDG profile from the current setup"
if [[ -z "${XDG_BASE}" ]] ||
[[ -z "${XDG_BASE_HOME}" ]] ||
[[ -z "${XDG_PROFILE}" ]] ||
[[ -z "${XDG_CONFIG_HOME}" ]] ||
[[ -z "${XDG_DATA_HOME}" ]] ||
[[ -z "${XDG_CONFIG_DIR}" ]] ||
[[ -z "${XDG_DATA_DIR}" ]]; then
if [[ -z "${XDG_PROFILES_DIR}" ]] ||
[[ -z "${XDG_PROFILES_HOME}" ]] ||
[[ -z "${XDG_PROFILE}" ]] ||
[[ -z "${XDG_CONFIG_HOME}" ]] ||
[[ -z "${XDG_DATA_HOME}" ]] ||
[[ -z "${XDG_CONFIG_DIR}" ]] ||
[[ -z "${XDG_DATA_DIR}" ]]; then
echo
echo "We require the following variables to be set in your terminal."
echo "But some are not set:"
echo " XDG_BASE = ${XDG_BASE}"
echo " XDG_BASE_HOME = ${XDG_BASE_HOME}"
echo " XDG_PROFILES_DIR = ${XDG_PROFILES_DIR}"
echo " XDG_PROFILES_HOME = ${XDG_PROFILES_HOME}"
echo
echo " XDG_PROFILE = ${XDG_PROFILE}"
echo " XDG_CONFIG_HOME= ${XDG_CONFIG_HOME}"
......@@ -285,7 +285,7 @@ while true; do
echo
print_settings
create_menu "Are you happy with the settings?" "Choose 'Yes' to generate profile in ${XDG_BASE_HOME}/xdg_profiles/${prof_id}: " "Yes" "No"
create_menu "Are you happy with the settings?" "Choose 'Yes' to generate profile in ${XDG_PROFILES_HOME}/${prof_id}: " "Yes" "No"
prof_ready=${return}
if [[ ${prof_ready} == "Yes" ]]; then
......@@ -301,20 +301,20 @@ done
# ---- generate profile in ${XDG_BASE_HOME} ----
# ----------------------------------------------
mkdir -p ${XDG_BASE_HOME}/xdg_profiles
mkdir -p ${XDG_PROFILES_HOME}
# double check, if path is not in use and create it
prof_dir=${XDG_BASE_HOME}/xdg_profiles/${prof_id}
prof_dir=${XDG_PROFILES_HOME}/${prof_id}
if [[ -d ${prof_dir} ]] || [[ -f ${prof_dir} ]]; then
echo "ERROR: ${prof_dir} exists - EXIT."
exit 1
fi
mkdir -p ${prof_dir}
# copy active profile from ${XDG_BASE}, if not "default"
# copy active profile from ${XDG_PROFILES_DIR}, if not "default"
# this is config,data and Desktop directories
if [[ ! ${XDG_PROFILE} == "default" ]]; then
cp -a ${XDG_BASE}/xdg_profiles/${XDG_PROFILE}/* ${prof_dir}/
cp -a ${XDG_PROFILES_DIR}/${XDG_PROFILE}/* ${prof_dir}/
fi
# merge with ${XDG_CONFIG_HOME}
......
#!/bin/bash
# remove session information, as we do not want the same 'infoterm' windows to come up multiple times
rm -rf ${HOME}/.cache/sessions
......@@ -10,8 +10,15 @@ if grep -q "^$LOGNAME" /etc/passwd ; then
return
fi
# path to XDG desktop profiles
export XDG_PROFILES_DIR=${XDG_BASE}/xdg_profiles
# set XDG_BIN if not set
export XDG_PROFILES_BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# set XDG_PROFILES_DIR if not set
export XDG_PROFILES_DIR=${XDG_PROFILES_DIR:-${XDG_PROFILES_BIN}/xdg_profiles/}
# set XDG_PROFILES_HOME, if not set
export XDG_PROFILES_HOME=${XDG_PROFILES_HOME:-${HOME}/.local/xdg/xdg_profiles/}
# set default XDG variables
export XDG_CONFIG_HOME=${HOME}/.config/xdg_profiles/default
......@@ -22,6 +29,8 @@ export XDG_DATA_HOME=${HOME}/.local/xdg_profiles/default
export XDG_DATA_DIR=${XDG_PROFILES_DIR}/default/data
export XDG_DATA_DIRS=${XDG_DATA_DIR}:/usr/local/share:/usr/share
export XDG_CACHE_HOME=${XDG_DATA_HOME}/cache
# set profile XDG variables
# XDG_DATA_HOME must be ${HOME}/.local/xdg_profiles/${XDG_PROFILE}, as this is fixed in ${XDG_CONFIG_HOME}/user-dirs.dirs
echo -n "select XDG profile ${XDG_PROFILE} ... "
......@@ -32,6 +41,7 @@ if [ -d ${XDG_PROFILES_DIR}/${XDG_PROFILE} ]; then
export XDG_DATA_HOME=${HOME}/.local/xdg_profiles/${XDG_PROFILE}
export XDG_DATA_DIR=${XDG_PROFILES_DIR}/${XDG_PROFILE}/data
export XDG_DATA_DIRS=${XDG_DATA_DIR}:${XDG_DATA_DIRS}
export XDG_CACHE_HOME=${XDG_DATA_HOME}/cache
echo "found"
else
echo "is unkown - chosing default"
......@@ -45,35 +55,80 @@ if [ ! -d ${XDG_CONFIG_HOME} ]; then
# change default desktop directory from ${HOME}/Desktop to ${XDG_DATA_HOME}/Desktop
# to enable profile-specific desktop icons
cp ${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/user-dirs.dirs ${XDG_CONFIG_HOME}/
# add bookmarks file
mkdir -p ${XDG_CONFIG_HOME}/gtk-3.0/
fi
if [ ! -d ${XDG_DATA_HOME} ]; then
echo "XDG profile ${XDG_PROFILE} choosen the first time ... creating ${XDG_DATA_HOME}"
mkdir -p ${XDG_DATA_HOME}
fi
if [ -d ${XDG_PROFILES_DIR}/${XDG_PROFILE}/data/Desktop ]; then
if [ ! -d ${XDG_DATA_HOME}/Desktop ]; then
echo "XDG profile ${XDG_PROFILE} choosen the first time ... creating ${XDG_DATA_HOME}/Desktop"
mkdir -p ${XDG_DATA_HOME}/Desktop
fi
fi
# always renew desktop icons, if profile has its own Desktop folder
# always renew desktop icons, which linke to $XDG_PROFILES_DIR/...
# this might annoy users, who have removed the icons,
# but it ensures that icon updates are pushed to the users on every new login
if [ -d ${XDG_PROFILES_DIR}/${XDG_PROFILE}/data/Desktop ]; then
ln -s -f ${XDG_PROFILES_DIR}/${XDG_PROFILE}/data/Desktop/* ${XDG_DATA_HOME}/Desktop/
if [ ! -d ${XDG_DATA_HOME}/Desktop ]; then
echo "XDG profile ${XDG_PROFILE} choosen the first time ... creating ${XDG_DATA_HOME}/Desktop"
mkdir -p ${XDG_DATA_HOME}/Desktop
fi
for file in ${XDG_DATA_HOME}/Desktop/*; do
if [ -L ${file} ]; then
target=$(readlink ${file})
if [[ "${target}" == "${XDG_PROFILES_DIR}"* ]]; then
rm ${file}
fi
fi
done
# (link to all Desktop files, which are in XDG_CONFIG_DIRS)
IFS=:
for p in ${XDG_DATA_DIRS}; do
if [ -d ${p}/Desktop ]; then
ln -sf ${p}/Desktop/* ${XDG_DATA_HOME}/Desktop/
fi
done
# always renew devilspie2 scripts on login
if [ -d ${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/devilspie2 ]; then
# (remove any links to XDG_PROFILES_DIR first)
if [ ! -d ${XDG_CONFIG_HOME}/devilspie2 ]; then
echo "XDG profile ${XDG_PROFILE} choosen the first time ... creating ${XDG_CONFIG_HOME}/devilspie2"
mkdir -p ${XDG_CONFIG_HOME}/devilspie2/
cp -f ${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/devilspie2/*.lua ${XDG_CONFIG_HOME}/devilspie2/
fi
for file in ${XDG_CONFIG_HOME}/devilspie2/*; do
if [ -L ${file} ]; then
target=$(readlink ${file})
if [[ "${target}" == "${XDG_PROFILES_DIR}"* ]]; then
rm ${file}
fi
fi
done
# (link to all .lua scripts for devilspie2, which are in XDG_CONFIG_DIRS)
IFS=:
for p in ${XDG_CONFIG_DIRS}; do
if [ -d ${p}/devilspie2 ]; then
ln -sf ${p}/devilspie2/*.lua ${XDG_CONFIG_HOME}/devilspie2/
fi
done
# always renew gtk-bookmarks
# make sure default JSC places ($WORK and $ARCH) are present
# 1) copy ${HOME}/.gtk-bookmarks to tmp-file
# 2) remove
# # add bookmarks file
# if [ -e ${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/gtk-3.0/bookmarks ]; then
# cp ${XDG_PROFILES_DIR}/${XDG_PROFILE}/config/gtk-3.0/bookmarks ${XDG_CONFIG_HOME}/gtk-3.0/
# else
# touch ${XDG_CONFIG_HOME}/gtk-3.0/bookmarks
# fi
# ln -sf ${XDG_CONFIG_HOME}/gtk-3.0/bookmarks ${HOME}/.gtk-bookmarks
#
# remove saved sessions, as we do not want infoterm windows to appear multiple times
# (todo: only remove the call of infoterm scripts instead)
if [ ! -z "${XDG_DATA_HOME}" ]; then
rm -rf ${XDG_DATA_HOME}/cache/sessions
fi
# echo settings
echo "XDG_CONFIG_HOME=${XDG_CONFIG_HOME}"
echo "XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS}"
echo "XDG Settings:"
for x in ${!XDG_*}; do echo ${x} = ${!x}; done
echo
echo "XDG_DATA_HOME=${XDG_DATA_HOME}"
echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}"
......@@ -3,10 +3,10 @@
print_usage() {
echo "Usage: ${0} [OPTION]..."
echo "List information of XDG profiles."
echo "XDG_BASE/xdg_profiles and XDG_BASE_HOME/xdg_profiles is searched for profiles."
echo "XDG_PROFILES_DIR and XDG_PROFILES_HOME is searched for profiles."
echo "Currently they are set to: "
echo " XDG_BASE =${XDG_BASE}"
echo " XDG_BASE_HOME=${XDG_BASE_HOME}"
echo " XDG_PROFILES_DIR =${XDG_PROFILES_DIR}"
echo " XDG_PROFILES_HOME=${XDG_PROFILES_HOME}"
echo
echo "Mandatory arguments to long options are mandatory for short options too."
echo " -h, --help Print usage."
......@@ -34,7 +34,7 @@ print_profiles() {
local XDG_PROFILE_HIDDENS=()
# collect information of all xdg profiles
for id_path in ${XDG_BASE_HOME}/xdg_profiles/* ${XDG_BASE}/xdg_profiles/* ; do
for id_path in ${XDG_PROFILES_HOME}/* ${XDG_PROFILES_DIR}/* ; do
# is path a directory
if [[ ! -d ${id_path} ]]; then
......
[Desktop Entry]
Encoding=UTF-8
Version=
Type=Application
Name=infoterm-default
Comment=
Exec=bash -c 'IFS=: && for p in ${XDG_CONFIG_DIRS}; do if [ -e ${p}/infoterm-default/infoterm-default.sh ]; then ${p}/infoterm-default/infoterm-default.sh; break; fi; done'
StartupNotify=false
Terminal=false
Hidden=false
[Desktop Entry]
Encoding=UTF-8
Version=
Type=Application
Name=infoterm-htop-default
Comment=
#Exec=bash -c 'IFS=: && for p in ${XDG_CONFIG_DIRS}; do if [ -e ${p}/infoterm-default/infoterm-default.sh ]; then ${p}/infoterm-default/infoterm-default.sh; break; fi; done'
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-htop-default/infoterm-htop-default.sh'
StartupNotify=false
Terminal=false
Hidden=false
[Desktop Entry]
Encoding=UTF-8
Version=
Type=Application
Name=infoterm-jobtime-default
Comment=
#Exec=bash -c 'IFS=: && for p in ${XDG_CONFIG_DIRS}; do if [ -e ${p}/infoterm-default/infoterm-default.sh ]; then ${p}/infoterm-default/infoterm-default.sh; break; fi; done'
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-jobtime-default/infoterm-jobtime-default.sh'
StartupNotify=false
Terminal=false
Hidden=false
......@@ -2,9 +2,10 @@
Encoding=UTF-8
Version=
Type=Application
Name=infoterm-vis
Name=infoterm-motd-default
Comment=
Exec=bash -c 'IFS=: && for p in ${XDG_CONFIG_DIRS}; do if [ -e ${p}/infoterm-vis/infoterm-vis.sh ]; then ${p}/infoterm-vis/infoterm-vis.sh; break; fi; done'
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-motd-default/infoterm-motd-default.sh'
StartupNotify=false
Terminal=false
Hidden=false
......@@ -4,7 +4,7 @@ debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-default") then
if (get_window_name()=="infoterm-htop-default") then
-- Removes all window decorations
undecorate_window()
......
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-jobtime-default") then
-- Removes all window decorations
undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
set_skip_pager(true)
-- set the current window below all normal windows
set_window_below(true)
-- sets the window type, according to _NET_WM_WINDOW_TYPE
set_window_type("WINDOW_TYPE_SPLASH")
end
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-motd-default") then
-- Removes all window decorations
-- undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
-- set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
-- set_skip_pager(true)
-- set the current window below all normal windows