summaryrefslogtreecommitdiff
path: root/debian/postrm
diff options
context:
space:
mode:
authorglasseyes <dglassey@gmail.com>2019-01-28 09:52:26 -0600
committerglasseyes <dglassey@gmail.com>2019-01-28 09:52:26 -0600
commit7eaff0c746eaa797b1c0e1eb8b56cb638955e8c5 (patch)
treefa06e783be835e4125663a1ad64f67d2128cf979 /debian/postrm
parent8460cee35a04a341405bd82d5f5f527b28f0d828 (diff)
d/postinst/rm more robust to ibus not running
and running in gnome-shell
Diffstat (limited to 'debian/postrm')
-rw-r--r--debian/postrm13
1 files changed, 11 insertions, 2 deletions
diff --git a/debian/postrm b/debian/postrm
index b0b37c4..dab0bec 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -6,10 +6,19 @@ case "$1" in
remove)
# Restart IBus if it is running
- ibuspid=`ps -C ibus-daemon -o pid=`
+ ! ibuspid=`ps -C ibus-daemon -o pid=|head -n 1`
if [ "x$ibuspid" != "x" ]; then
- ibus restart
+ # check for gnome-shell as it works differently
+ ! gspid=`ps -C gnome-shell -o pid=|head -n 1`
+ if [ "x$gspid" != "x" ]; then
+ # gnome-shell has multiple ibus-daemon processes and needs exit instead of restart
+ ibususer=`ps -C ibus-daemon -o user=|grep -v gdm|uniq`
+ sudo -H -u "$ibususer" ibus exit
+ else
+ ibususer=`ps -C ibus-daemon -o user=`
+ sudo -H -u "$ibususer" ibus restart
+ fi
fi
;;