From 800c98d51664edc34cf2158b031825b1cd68e47a Mon Sep 17 00:00:00 2001 From: pgrondek Date: Wed, 7 Jul 2021 00:15:22 +0200 Subject: [PATCH] Add option to restart dwm without loging out --- roles/dwm/files/usr/local/bin/start-dwm | 5 +++++ roles/dwm/files/usr/share/xsessions/dwm.desktop | 2 +- roles/dwm/tasks/dwm.yml | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 roles/dwm/files/usr/local/bin/start-dwm diff --git a/roles/dwm/files/usr/local/bin/start-dwm b/roles/dwm/files/usr/local/bin/start-dwm new file mode 100755 index 0000000..9cd3435 --- /dev/null +++ b/roles/dwm/files/usr/local/bin/start-dwm @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +while : ; do + dwm && break || continue +done diff --git a/roles/dwm/files/usr/share/xsessions/dwm.desktop b/roles/dwm/files/usr/share/xsessions/dwm.desktop index b0c3354..99cb53a 100644 --- a/roles/dwm/files/usr/share/xsessions/dwm.desktop +++ b/roles/dwm/files/usr/share/xsessions/dwm.desktop @@ -2,6 +2,6 @@ Encoding=UTF-8 Name=Dwm Comment=Dynamic window manager -Exec=dwm +Exec=/usr/local/bin/start-dwm Icon=dwm Type=XSession diff --git a/roles/dwm/tasks/dwm.yml b/roles/dwm/tasks/dwm.yml index 34a061c..9737590 100644 --- a/roles/dwm/tasks/dwm.yml +++ b/roles/dwm/tasks/dwm.yml @@ -41,6 +41,13 @@ src: usr/share/icons/dwm.png dest: /usr/share/icons/dwm.png +- name: copy run script + become: yes + copy: + src: usr/local/bin/start-dwm + dest: /usr/local/bin/start-dwm + mode: '0755' + - name: install dwm become: yes register: make