summaryrefslogtreecommitdiff
path: root/firestart
blob: 1daf05ce771eb551292b373362dea72a42221aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

CMD=firefox
UNIT=$CMD@$DISPLAY

if systemctl --user is-active "$UNIT" >/dev/null
then
    # Asks existing firefox to open a new window.  Technically is racy,
    # since the unit could become active after our check.
    exec "$CMD" "$@"
else
    systemctl --user reset-failed "$UNIT" 2>/dev/null
    systemctl --user start "$UNIT"
fi