You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-utils-1/install/patches/x11-misc/slim-1.3.1-slimd.patch

62 lines
1.8 KiB

diff --git a/Makefile b/Makefile
index 2d36f45..61c69fb 100644
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,7 @@ slim: $(OBJECTS)
install: slim install-theme
install -D -m 755 slim $(DESTDIR)$(PREFIX)/bin/slim
+ install -D -m 755 slimd $(DESTDIR)$(PREFIX)/bin/slimd
install -D -m 644 slim.1 $(DESTDIR)$(MANDIR)/man1/slim.1
test -e $(DESTDIR)$(CFGDIR)/slim.conf || \
install -D -m 644 slim.conf $(DESTDIR)$(CFGDIR)/slim.conf
diff --git a/slimd b/slimd
new file mode 100644
index 0000000..d283a68
--- /dev/null
+++ b/slimd
@@ -0,0 +1,43 @@
+#!/bin/bash
+#------------------------------------------------------------------------------
+# slimd
+# Copyright ©2009 Mir Calculate Ltd.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#------------------------------------------------------------------------------
+
+stopslim() {
+ # force kill X
+ killall X &>/dev/null
+ # and kill slim, because slim may be hanged
+ killall -9 slim &>/dev/null
+ # removing slim lock file
+ rm -f /var/run/slim.lock
+ exit
+}
+
+workloop() {
+ trap stopslim TERM
+ # waiting TERM signal for killing X and slim
+ while true
+ do
+ sleep 10
+ done
+}
+
+rm -f /var/run/slim.lock
+killall -9 slim &>/dev/null
+/usr/bin/slim
+workloop &
+