summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2021-05-19 10:26:57 +0200
committerJonathan Bauer2021-05-19 10:26:57 +0200
commit785c5e4b7c9312428862d8bb396537faa3e61b91 (patch)
treec1951e8c4e72cd7cd4d12bbf7d90a490db52a13c
parent[tools-base] install basic tools (diff)
downloadansible-bwlp-785c5e4b7c9312428862d8bb396537faa3e61b91.tar.gz
ansible-bwlp-785c5e4b7c9312428862d8bb396537faa3e61b91.tar.xz
ansible-bwlp-785c5e4b7c9312428862d8bb396537faa3e61b91.zip
[desktop-xfce4] xfce4 with bwlp modifications
-rw-r--r--desktop-xfce4/files/18.04/etc/profile.d/20-default-xfce4-panel.sh16
-rw-r--r--desktop-xfce4/files/18.04/etc/xdg/xfce4/kiosk/kioskrc2
-rw-r--r--desktop-xfce4/files/18.04/etc/xdg/xfce4/panel/default.xml92
-rw-r--r--desktop-xfce4/files/20.04/etc/profile.d/20-default-xfce4-panel.sh16
-rw-r--r--desktop-xfce4/files/20.04/etc/xdg/xfce4/kiosk/kioskrc2
-rw-r--r--desktop-xfce4/files/20.04/etc/xdg/xfce4/panel/default.xml120
-rw-r--r--desktop-xfce4/tasks/main.yml104
7 files changed, 352 insertions, 0 deletions
diff --git a/desktop-xfce4/files/18.04/etc/profile.d/20-default-xfce4-panel.sh b/desktop-xfce4/files/18.04/etc/profile.d/20-default-xfce4-panel.sh
new file mode 100644
index 0000000..6454c84
--- /dev/null
+++ b/desktop-xfce4/files/18.04/etc/profile.d/20-default-xfce4-panel.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+default_panel_file="/etc/xdg/xfce4/panel/default.xml"
+if [ ! -e "$default_panel_file" ]; then
+ exit 1
+fi
+
+[ -z "$HOME" ] && HOME=$( getent passwd "$(id -u $PAM_USER)" | awk -F: '{print $6}' )
+
+TARGET_HOME_DIR="$HOME"
+[ -d "$HOME/PERSISTENT" ] && TARGET_HOME_DIR="$HOME/PERSISTENT"
+
+if [ ! -e "${TARGET_HOME_DIR}/.config/xfce4/panel/default.xml" ]; then
+ mkdir -p "${TARGET_HOME_DIR}/.config/xfce4/panel"
+ cp -f -- "$default_panel_file" "${TARGET_HOME_DIR}/.config/xfce4/panel/"
+fi
diff --git a/desktop-xfce4/files/18.04/etc/xdg/xfce4/kiosk/kioskrc b/desktop-xfce4/files/18.04/etc/xdg/xfce4/kiosk/kioskrc
new file mode 100644
index 0000000..b2bd204
--- /dev/null
+++ b/desktop-xfce4/files/18.04/etc/xdg/xfce4/kiosk/kioskrc
@@ -0,0 +1,2 @@
+[xfce4-session]
+SaveSession=NONE
diff --git a/desktop-xfce4/files/18.04/etc/xdg/xfce4/panel/default.xml b/desktop-xfce4/files/18.04/etc/xdg/xfce4/panel/default.xml
new file mode 100644
index 0000000..2e58896
--- /dev/null
+++ b/desktop-xfce4/files/18.04/etc/xdg/xfce4/panel/default.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<channel name="xfce4-panel" version="1.0">
+ <property name="configver" type="int" value="2"/>
+ <property name="panels" type="array">
+ <value type="int" value="1"/>
+ <value type="int" value="2"/>
+ <property name="panel-1" type="empty">
+ <property name="position" type="string" value="p=6;x=0;y=0"/>
+ <property name="length" type="uint" value="100"/>
+ <property name="position-locked" type="bool" value="true"/>
+ <property name="size" type="uint" value="30"/>
+ <property name="plugin-ids" type="array">
+ <value type="int" value="1"/>
+ <value type="int" value="3"/>
+ <value type="int" value="15"/>
+ <value type="int" value="4"/>
+ <value type="int" value="17"/>
+ <value type="int" value="5"/>
+ <value type="int" value="6"/>
+ <value type="int" value="2"/>
+ </property>
+ </property>
+ <property name="panel-2" type="empty">
+ <property name="position" type="string" value="p=10;x=0;y=0"/>
+ <property name="position-locked" type="bool" value="true"/>
+ <property name="plugin-ids" type="array">
+ <value type="int" value="7"/>
+ <value type="int" value="8"/>
+ <value type="int" value="9"/>
+ <value type="int" value="10"/>
+ <value type="int" value="11"/>
+ <value type="int" value="12"/>
+ <value type="int" value="13"/>
+ <value type="int" value="14"/>
+ </property>
+ </property>
+ </property>
+ <property name="plugins" type="empty">
+ <property name="plugin-1" type="string" value="applicationsmenu"/>
+ <property name="plugin-2" type="string" value="actions">
+ <property name="items" type="array">
+ <value type="string" value="+lock-screen"/>
+ <value type="string" value="-switch-user"/>
+ <value type="string" value="-separator"/>
+ <value type="string" value="-suspend"/>
+ <value type="string" value="-hibernate"/>
+ <value type="string" value="-separator"/>
+ <value type="string" value="-shutdown"/>
+ <value type="string" value="-restart"/>
+ <value type="string" value="+separator"/>
+ <value type="string" value="+logout"/>
+ <value type="string" value="-logout-dialog"/>
+ </property>
+ </property>
+ <property name="plugin-3" type="string" value="tasklist"/>
+ <property name="plugin-15" type="string" value="separator">
+ <property name="expand" type="bool" value="true"/>
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-4" type="string" value="pager"/>
+ <property name="plugin-5" type="string" value="clock"/>
+ <property name="plugin-6" type="string" value="systray"/>
+ <property name="plugin-7" type="string" value="showdesktop"/>
+ <property name="plugin-8" type="string" value="separator"/>
+ <property name="plugin-9" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-terminal-emulator.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-10" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-file-manager.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-11" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-web-browser.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-12" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="xfce4-appfinder.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-13" type="string" value="separator"/>
+ <property name="plugin-14" type="string" value="directorymenu"/>
+ <property name="plugin-17" type="string" value="pulseaudio">
+ <property name="enable-keyboard-shortcuts" type="bool" value="true"/>
+ </property>
+ </property>
+</channel>
diff --git a/desktop-xfce4/files/20.04/etc/profile.d/20-default-xfce4-panel.sh b/desktop-xfce4/files/20.04/etc/profile.d/20-default-xfce4-panel.sh
new file mode 100644
index 0000000..6454c84
--- /dev/null
+++ b/desktop-xfce4/files/20.04/etc/profile.d/20-default-xfce4-panel.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+default_panel_file="/etc/xdg/xfce4/panel/default.xml"
+if [ ! -e "$default_panel_file" ]; then
+ exit 1
+fi
+
+[ -z "$HOME" ] && HOME=$( getent passwd "$(id -u $PAM_USER)" | awk -F: '{print $6}' )
+
+TARGET_HOME_DIR="$HOME"
+[ -d "$HOME/PERSISTENT" ] && TARGET_HOME_DIR="$HOME/PERSISTENT"
+
+if [ ! -e "${TARGET_HOME_DIR}/.config/xfce4/panel/default.xml" ]; then
+ mkdir -p "${TARGET_HOME_DIR}/.config/xfce4/panel"
+ cp -f -- "$default_panel_file" "${TARGET_HOME_DIR}/.config/xfce4/panel/"
+fi
diff --git a/desktop-xfce4/files/20.04/etc/xdg/xfce4/kiosk/kioskrc b/desktop-xfce4/files/20.04/etc/xdg/xfce4/kiosk/kioskrc
new file mode 100644
index 0000000..b2bd204
--- /dev/null
+++ b/desktop-xfce4/files/20.04/etc/xdg/xfce4/kiosk/kioskrc
@@ -0,0 +1,2 @@
+[xfce4-session]
+SaveSession=NONE
diff --git a/desktop-xfce4/files/20.04/etc/xdg/xfce4/panel/default.xml b/desktop-xfce4/files/20.04/etc/xdg/xfce4/panel/default.xml
new file mode 100644
index 0000000..16bd715
--- /dev/null
+++ b/desktop-xfce4/files/20.04/etc/xdg/xfce4/panel/default.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<channel name="xfce4-panel" version="1.0">
+ <property name="configver" type="int" value="2"/>
+ <property name="panels" type="array">
+ <value type="int" value="1"/>
+ <value type="int" value="2"/>
+ <property name="panel-1" type="empty">
+ <property name="position" type="string" value="p=6;x=0;y=0"/>
+ <property name="length" type="uint" value="100"/>
+ <property name="position-locked" type="bool" value="true"/>
+ <property name="icon-size" type="uint" value="16"/>
+ <property name="size" type="uint" value="26"/>
+ <property name="plugin-ids" type="array">
+ <value type="int" value="1"/>
+ <value type="int" value="2"/>
+ <value type="int" value="3"/>
+ <value type="int" value="4"/>
+ <value type="int" value="5"/>
+ <value type="int" value="6"/>
+ <value type="int" value="7"/>
+ <value type="int" value="8"/>
+ <value type="int" value="9"/>
+ <value type="int" value="11"/>
+ <value type="int" value="12"/>
+ <value type="int" value="13"/>
+ <value type="int" value="14"/>
+ </property>
+ </property>
+ <property name="panel-2" type="empty">
+ <property name="autohide-behavior" type="uint" value="1"/>
+ <property name="position" type="string" value="p=10;x=0;y=0"/>
+ <property name="position-locked" type="bool" value="true"/>
+ <property name="size" type="uint" value="48"/>
+ <property name="plugin-ids" type="array">
+ <value type="int" value="15"/>
+ <value type="int" value="16"/>
+ <value type="int" value="17"/>
+ <value type="int" value="18"/>
+ <value type="int" value="19"/>
+ <value type="int" value="20"/>
+ <value type="int" value="21"/>
+ <value type="int" value="22"/>
+ </property>
+ </property>
+ </property>
+ <property name="plugins" type="empty">
+ <property name="plugin-1" type="string" value="applicationsmenu"/>
+ <property name="plugin-2" type="string" value="tasklist">
+ <property name="grouping" type="uint" value="1"/>
+ </property>
+ <property name="plugin-3" type="string" value="separator">
+ <property name="expand" type="bool" value="true"/>
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-4" type="string" value="pager"/>
+ <property name="plugin-5" type="string" value="separator">
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-6" type="string" value="systray">
+ <property name="show-frame" type="bool" value="false"/>
+ <property name="square-icons" type="bool" value="true"/>
+ </property>
+ <property name="plugin-7" type="string" value="statusnotifier">
+ <property name="square-icons" type="bool" value="true"/>
+ <property name="symbolic-icons" type="bool" value="true"/>
+ </property>
+ <property name="plugin-8" type="string" value="pulseaudio">
+ <property name="enable-keyboard-shortcuts" type="bool" value="true"/>
+ <property name="show-notifications" type="bool" value="true"/>
+ </property>
+ <property name="plugin-9" type="string" value="power-manager-plugin"/>
+ <property name="plugin-11" type="string" value="separator">
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-12" type="string" value="clock"/>
+ <property name="plugin-13" type="string" value="separator">
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-14" type="string" value="actions">
+ <property name="items" type="array">
+ <value type="string" value="+lock-screen"/>
+ <value type="string" value="-switch-user"/>
+ <value type="string" value="-separator"/>
+ <value type="string" value="-suspend"/>
+ <value type="string" value="-hibernate"/>
+ <value type="string" value="-separator"/>
+ <value type="string" value="-shutdown"/>
+ <value type="string" value="-restart"/>
+ <value type="string" value="+separator"/>
+ <value type="string" value="+logout"/>
+ <value type="string" value="-logout-dialog"/>
+ </property>
+ </property>
+ <property name="plugin-15" type="string" value="showdesktop"/>
+ <property name="plugin-16" type="string" value="separator"/>
+ <property name="plugin-17" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-terminal-emulator.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-18" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-file-manager.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-19" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="exo-web-browser.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-20" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="xfce4-appfinder.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-21" type="string" value="separator"/>
+ <property name="plugin-22" type="string" value="directorymenu"/>
+ </property>
+</channel>
diff --git a/desktop-xfce4/tasks/main.yml b/desktop-xfce4/tasks/main.yml
new file mode 100644
index 0000000..ac78a13
--- /dev/null
+++ b/desktop-xfce4/tasks/main.yml
@@ -0,0 +1,104 @@
+---
+- name: Install XFCE4 desktop environment
+ apt:
+ name: "{{ xfce_packages }}"
+ state: present
+ install_recommends: no
+ vars:
+ xfce_packages:
+ - evince
+ - mousepad
+ - ristretto
+ - xfce4
+ - xfce4-terminal
+ - xfce4-goodies
+ - xfce4-power-manager
+ - xubuntu-icon-theme
+ - greybird-gtk-theme
+ - pavucontrol
+ - pulseaudio
+ - udisks2
+ - gvfs
+ - gvfs-backends
+ - gvfs-fuse
+ # for xml module
+ - python3-lxml
+
+# TODO: do this the proper way, when it is known how :)
+- name: HACK overwrite default wallpaper
+ find:
+ paths: /usr/share/backgrounds/xfce
+ patterns: "*"
+ register: xfce_backgrounds
+
+- name: HACK overwrite default wallpaper
+ file:
+ path: "{{ item.path }}"
+ state: absent
+ with_items: "{{ xfce_backgrounds.files }}"
+
+- name: HACK overwrite default wallpaper
+ file:
+ src: /usr/share/backgrounds/bwlp-1920x1080.png
+ dest: "{{ item.path }}"
+ state: link
+ force: yes
+ with_items: "{{ xfce_backgrounds.files }}"
+
+- name: Cleanup applications menu
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - /usr/share/applications/exo-mail-reader.desktop
+ - /usr/share/applications/assistant-qt5.desktop
+ - /usr/share/applications/designer-qt5.desktop
+ - /usr/share/applications/linguist-qt5.desktop
+ - /usr/share/applications/globaltime.desktop
+ - /usr/share/applications/xfcalendar.desktop
+
+- name: Copy distro's specific static files
+ copy:
+ src: "files/{{ ansible_distribution_version }}/"
+ dest: /
+ become: yes
+
+# disable logout menu items
+- name: Configure xfce4 logout menu | probe shutdown node
+ xml:
+ path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
+ xpath: /channel/property[@name='shutdown']
+ count: yes
+ register: shutdown_nodes
+
+- name: Configure xfce4 logout menu | check shutdown node
+ debug:
+ var: shutdown_nodes.count
+
+- name: Configure xfce4 logout menu | add shutdown node if missing
+ xml:
+ path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
+ xpath: /channel
+ add_children:
+ - property:
+ name: "shutdown"
+ type: "empty"
+ pretty_print: yes
+ when: shutdown_nodes.count == 0
+
+- name: Configure xfce4 logout menu | disable suspend and hibernate
+ xml:
+ path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
+ xpath: /channel/property[@name='shutdown']
+ add_children:
+ - property:
+ name: "ShowSuspend"
+ type: "bool"
+ value: "false"
+ - property:
+ name: "ShowHibernate"
+ type: "bool"
+ value: "false"
+ pretty_print: yes
+ when: shutdown_nodes.count == 0
+