cbc8039392db6222bd372f500e752175096521a8
[indicator-keyboard-led.git] / debian / postinst
1 #!/bin/sh -e
2 pkill indicator-keyboard-led.py || true
3
4 # modify autostart .desktop file to include debconf results
5 . /usr/share/debconf/confmodule
6 args=
7 db_get indicator-keyboard-led/short
8 if [ "$RET" = "true" ]; then
9     args="$args --short"
10 fi
11 db_get indicator-keyboard-led/order
12 if [ -n "$RET" ]; then
13     args="$args --order $RET"
14 fi
15 db_get indicator-keyboard-led/xdotool
16 if [ -n "$RET" ]; then
17     args="$args --xdotool $RET"
18 fi
19 sed -i 's|^Exec=.*$|Exec=/usr/bin/indicator-keyboard-led.py'" $args"'|' /etc/xdg/autostart/indicator-keyboard-led.desktop
20
21 sudo ln -s /etc/xdg/autostart/indicator-keyboard-led.desktop /usr/share/applications/indicator-keyboard-led.desktop