about summary refs log tree commit diff stats
path: root/bin/bother
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bother')
-rwxr-xr-xbin/bother16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/bother b/bin/bother
index 701b1a4..1d97791 100755
--- a/bin/bother
+++ b/bin/bother
@@ -1,7 +1,21 @@
 #!/bin/sh
 # puts up a critical notification if $HOME/today exists, containing the contents of that file.
+if [ -z "$XFILE" ]; then
+if [ -f $HOME/.xsession ]; then
+	XFILE=xsession
+elif [ -f $HOME/.xinitrc ]; then
+	XFILE=xinitrc
+fi
+fi
+if grep -q "dwm" $XFILE; then
+	WM=dwm
+elif grep -q 'exec' $XFILE; then
+	WM=$(grep 'exec' $XFILE|cut -f 2 -d ' ' -)
+else
+	WM=$(last -1 $XFILE)
+fi
 if [ -f "$HOME"/today ]; then
-	until pgrep -x dwm>/dev/null
+	until pgrep $WM>/dev/null
 	do
 		true
 	done