summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2021-05-19 10:27:42 +0200
committerJonathan Bauer2021-05-19 10:27:42 +0200
commitab5e0f5313ff6e100c6f310d10c3cfb05062ef79 (patch)
treef51fbe5390141d54d4f6ee68ba86c250962004fb
parent[desktop-xfce4] xfce4 with bwlp modifications (diff)
downloadansible-bwlp-ab5e0f5313ff6e100c6f310d10c3cfb05062ef79.tar.gz
ansible-bwlp-ab5e0f5313ff6e100c6f310d10c3cfb05062ef79.tar.xz
ansible-bwlp-ab5e0f5313ff6e100c6f310d10c3cfb05062ef79.zip
[desktop-common] common desktop related files for DEs
-rw-r--r--desktop-common/files/etc/profile.d/10-autostart.sh83
-rw-r--r--desktop-common/files/etc/udev/rules.d/99-ignore-slx-partitions.rules3
-rw-r--r--desktop-common/files/root/.bashrc99
-rw-r--r--desktop-common/files/var/lib/locales/supported.d/de1
-rw-r--r--desktop-common/files/var/lib/locales/supported.d/en1
-rw-r--r--desktop-common/tasks/main.yml18
6 files changed, 205 insertions, 0 deletions
diff --git a/desktop-common/files/etc/profile.d/10-autostart.sh b/desktop-common/files/etc/profile.d/10-autostart.sh
new file mode 100644
index 0000000..3a4cae0
--- /dev/null
+++ b/desktop-common/files/etc/profile.d/10-autostart.sh
@@ -0,0 +1,83 @@
+#!/bin/ash
+
+TEMP_HOME_DIR="$HOME"
+PERSISTENT_HOME_DIR="$HOME/PERSISTENT"
+
+# Use /etc/skel/* files to create default config files for users that do not have any
+for file in .bashrc .profile .vimrc .gitconfig .local/share/applications/mimeapps.list; do
+ [ -e "$TEMP_HOME_DIR/$file" ] && continue
+ if [ "x$(dirname "$file")" != "x." ]; then
+ mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")"
+ fi
+ if [ -e "$PERSISTENT_HOME_DIR/$file" ]; then
+ ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file"
+ continue
+ fi
+ if [ -e "/etc/skel/$file" ]; then
+ if [ -d "$PERSISTENT_HOME_DIR" ]; then
+ cp "/etc/skel/$file" "$PERSISTENT_HOME_DIR/$file"
+ ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file"
+ else
+ cp "/etc/skel/$file" "$TEMP_HOME_DIR/$file"
+ fi
+ fi
+done
+
+
+if [ -d "$PERSISTENT_HOME_DIR" ]; then
+
+ # Persistent home was mounted, take care of some convenience directories
+ for file in .vim .config/htop .config/openslx .config/xfce4; do
+ [ -e "$TEMP_HOME_DIR/$file" ] && continue
+ if [ "x$(dirname "$file")" != "x." ]; then
+ mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")"
+ fi
+ if [ ! -d "$PERSISTENT_HOME_DIR/$file" ]; then
+ mkdir -p "$PERSISTENT_HOME_DIR/$file"
+ fi
+ ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file"
+ done
+
+ # configure XDG directories according to $TEMP_HOME_DIR/.openslx/shares
+ if [ -e "${TEMP_HOME_DIR}/.openslx/shares" ]; then
+ . "${TEMP_HOME_DIR}/.openslx/shares"
+
+ ## Documents
+ TARGET_DIR="$TEMP_HOME_DIR"
+ [ "$SHARE_DOCUMENTS" = "1" ] && TARGET_DIR="$PERSISTENT_HOME_DIR"
+ echo "XDG_DOCUMENTS_DIR=\"$TARGET_DIR/Documents\""
+ echo "XDG_TEMPLATES_DIR=\"$TARGET_DIR/Templates\""
+
+ ## Downloads
+ TARGET_DIR="$TEMP_HOME_DIR"
+ [ "$SHARE_DOWNLOADS" = "1" ] && TARGET_DIR="$PERSISTENT_HOME_DIR"
+ echo "XDG_DOWNLOAD_DIR=\"$TARGET_DIR/Downloads\""
+
+ ## Desktop
+ TARGET_DIR="$TEMP_HOME_DIR"
+ [ "$SHARE_DESKTOP" = "1" ] && TARGET_DIR="$PERSISTENT_HOME_DIR"
+ echo "XDG_DESKTOP_DIR=\"$TARGET_DIR/Desktop\""
+
+ # Music/Pictures/Videos
+ TARGET_DIR="$TEMP_HOME_DIR"
+ [ "$SHARE_MEDIA" = "1" ] && TARGET_DIR="$PERSISTENT_HOME_DIR"
+ echo "XDG_MUSIC_DIR=\"$TARGET_DIR/Music\""
+ echo "XDG_PICTURES_DIR=\"$TARGET_DIR/Pictures\""
+ echo "XDG_VIDEOS_DIR=\"$TARGET_DIR/Videos\""
+
+ # Publicshare, w/e that is
+ TARGET_DIR="$TEMP_HOME_DIR"
+ [ "$SHARE_OTHER" = "1" ] && TARGET_DIR="$PERSISTENT_HOME_DIR"
+ echo "XDG_PUBLICSHARE_DIR=\"$TARGET_DIR/Public\""
+ fi > "$TEMP_HOME_DIR/.config/user-dirs.dirs"
+
+ # Check if user has autostart script and run it (so they can create more symlinks etc.)
+ if [ -x "$PERSISTENT_HOME_DIR/AUTOSTART" ]; then
+ if cd "$TEMP_HOME_DIR"; then
+ "$PERSISTENT_HOME_DIR/AUTOSTART"
+ cd - >/dev/null 2>&1
+ fi
+ fi
+
+fi
+
diff --git a/desktop-common/files/etc/udev/rules.d/99-ignore-slx-partitions.rules b/desktop-common/files/etc/udev/rules.d/99-ignore-slx-partitions.rules
new file mode 100644
index 0000000..da45742
--- /dev/null
+++ b/desktop-common/files/etc/udev/rules.d/99-ignore-slx-partitions.rules
@@ -0,0 +1,3 @@
+SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="SLX_SYS|OpenSLX-ID44|OpenSLX-ID45", ENV{UDISKS_IGNORE}="1"
+SUBSYSTEM=="block", ENV{ID_PART_ENTRY_UUID}=="87f86132-ff94-4987-b250-444444444444|87f86132-ff94-4987-b250-454545454545", ENV{UDISKS_IGNORE}="1"
+SUBSYSTEM=="block", ENV{ID_PART_ENTRY_TYPE}=="0x44|0x45", ENV{UDISKS_IGNORE}="1"
diff --git a/desktop-common/files/root/.bashrc b/desktop-common/files/root/.bashrc
new file mode 100644
index 0000000..2b3e84c
--- /dev/null
+++ b/desktop-common/files/root/.bashrc
@@ -0,0 +1,99 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# don't put duplicate lines in the history. See bash(1) for more options
+# ... or force ignoredups and ignorespace
+HISTCONTROL=ignoredups:ignorespace
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
+HISTSIZE=1000
+HISTFILESIZE=2000
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# make less more friendly for non-text input files, see lesspipe(1)
+[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+ debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+ xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+force_color_prompt=yes
+
+if [ -n "$force_color_prompt" ]; then
+ if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+ # We have color support; assume it's compliant with Ecma-48
+ # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+ # a case would tend to support setf rather than setaf.)
+ color_prompt=yes
+ else
+ color_prompt=
+ fi
+fi
+
+if [ "$color_prompt" = yes ]; then
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+else
+ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+fi
+unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user@host:dir
+case "$TERM" in
+xterm*|rxvt*)
+ PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+ ;;
+*)
+ ;;
+esac
+
+# enable color support of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+ test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
+ alias ls='ls --color=auto'
+ #alias dir='dir --color=auto'
+ #alias vdir='vdir --color=auto'
+
+ alias grep='grep --color=auto'
+ alias fgrep='fgrep --color=auto'
+ alias egrep='egrep --color=auto'
+fi
+
+# some more ls aliases
+alias ll='ls -alF'
+alias la='ls -A'
+alias l='ls -CF'
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+
+if [ -f ~/.bash_aliases ]; then
+ . ~/.bash_aliases
+fi
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
+ . /etc/bash_completion
+fi
diff --git a/desktop-common/files/var/lib/locales/supported.d/de b/desktop-common/files/var/lib/locales/supported.d/de
new file mode 100644
index 0000000..029a93f
--- /dev/null
+++ b/desktop-common/files/var/lib/locales/supported.d/de
@@ -0,0 +1 @@
+de_DE.UTF-8 UTF-8
diff --git a/desktop-common/files/var/lib/locales/supported.d/en b/desktop-common/files/var/lib/locales/supported.d/en
new file mode 100644
index 0000000..230dd52
--- /dev/null
+++ b/desktop-common/files/var/lib/locales/supported.d/en
@@ -0,0 +1 @@
+en_GB.UTF-8 UTF-8
diff --git a/desktop-common/tasks/main.yml b/desktop-common/tasks/main.yml
new file mode 100644
index 0000000..f2b43fe
--- /dev/null
+++ b/desktop-common/tasks/main.yml
@@ -0,0 +1,18 @@
+- name: Prevent installation of unwanted packages
+ include_role:
+ name: dummy-package
+ vars:
+ dummy_packages:
+ - plymouth
+ - popularity-contest
+ - unattended-upgrades
+ - ubuntu-release-upgrader-gtk
+ - ubuntu-release-upgrader-core
+ - update-manager
+ - update-manager-core
+
+- name: Copy static files common to all desktop environments
+ copy:
+ src: files/
+ dest: /
+ become: yes