diff --git a/roles/dwm/files/usr/local/bin/dwm-gnome b/roles/dwm/files/usr/local/bin/dwm-gnome new file mode 100755 index 0000000..2ea4992 --- /dev/null +++ b/roles/dwm/files/usr/local/bin/dwm-gnome @@ -0,0 +1,18 @@ +#!/bin/sh + +egister with gnome-session so that it does not kill the whole session thinking it is dead. +test -n "$DESKTOP_AUTOSTART_ID" && { + dbus-send --print-reply --session --dest=org.gnome.SessionManager "/org/gnome/SessionManager" org.gnome.SessionManager.RegisterClient "string:dwm-gnome" "string:$DESKTOP_AUTOSTART_ID" +} + +# Support for merging .Xresources +test -e $HOME/.Xresources && { + xrdb -merge $HOME/.Xresources +} + +dwm + +# Logout process. +test -n "$DESKTOP_AUTOSTART_ID" && { + dbus-send --print-reply --session --dest=org.gnome.SessionManager "/org/gnome/SessionManager" org.gnome.SessionManager.Logout "uint32:1" +} diff --git a/roles/dwm/files/usr/share/gnome-session/sessions/dwm-gnome.session b/roles/dwm/files/usr/share/gnome-session/sessions/dwm-gnome.session new file mode 100644 index 0000000..e72eb8e --- /dev/null +++ b/roles/dwm/files/usr/share/gnome-session/sessions/dwm-gnome.session @@ -0,0 +1,5 @@ +# -*- mode: conf -*- + +[GNOME Session] +Name=dwm-gnome +RequiredComponents=org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings;dwm-gnome diff --git a/roles/dwm/files/usr/share/xsessions/dwm-gnome.desktop b/roles/dwm/files/usr/share/xsessions/dwm-gnome.desktop new file mode 100644 index 0000000..0bbc81c --- /dev/null +++ b/roles/dwm/files/usr/share/xsessions/dwm-gnome.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=dwm + GNOME +Comment=Dymanic Window Manager with GNOME integration +Exec=gnome-session-dwm +Type=Aplications +DesktopNames=GNOME +X-Ubuntu-Gettext-Domain=gnome-session-3.0 diff --git a/roles/dwm/tasks/dwm.yml b/roles/dwm/tasks/dwm.yml index 4c1cd63..83155fc 100644 --- a/roles/dwm/tasks/dwm.yml +++ b/roles/dwm/tasks/dwm.yml @@ -36,6 +36,18 @@ src: usr/share/xsessions/dwm.desktop dest: /usr/share/xsessions/dwm.desktop +- name: copy xsession for gnome + become: yes + copy: + src: usr/share/xsessions/dwm-gnome.desktop + dest: /usr/share/xsessions/dwm-gnome.desktop + +- name: copy gnome session + become: yes + copy: + src: usr/share/gnome-session/sessions/dwm-gnome.session + dest: /usr/share/gnome-session/sessions/dwm-gnome.session + - name: copy icon become: yes copy: @@ -49,6 +61,13 @@ dest: /usr/local/bin/start-dwm mode: '0755' +- name: copy run script + become: yes + copy: + src: usr/local/bin/dwm-gnome + dest: /usr/local/bin/dwm-gnome + mode: '0755' + - name: install dwm become: yes register: make