Skip to content

Commit cb6aaf2

Browse files
fix enable ydotool
1 parent f88b531 commit cb6aaf2

2 files changed

Lines changed: 43 additions & 6 deletions

File tree

pkgbuild/biglinux-browser-selector.install

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
#}
55

66
## arg 1: the new package version
7-
#post_install() {
8-
# do something here
9-
#}
7+
post_install() {
8+
for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
9+
if [ "$(systemctl is-active --user ydotool)" != "active" ];then
10+
sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl --user enable --now ydotool
11+
fi
12+
done
13+
}
1014

1115
## arg 2: the old package version
1216
#pre_upgrade() {
1317
# do something here
1418
#}
1519

1620
## arg 2: the old package version
17-
#post_upgrade() {
18-
#post_install
19-
#}
21+
post_upgrade() {
22+
post_install
23+
}
2024

2125
## arg 1: the old package version
2226
#pre_remove() {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## arg 1: the new package version
2+
#pre_install() {
3+
# do something here
4+
#}
5+
6+
## arg 1: the new package version
7+
post_install() {
8+
for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
9+
if [ "$(systemctl is-active --user ydotool)" != "active" ];then
10+
sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl --user enable --now ydotool
11+
fi
12+
}
13+
14+
## arg 2: the old package version
15+
#pre_upgrade() {
16+
# do something here
17+
#}
18+
19+
## arg 2: the old package version
20+
post_upgrade() {
21+
post_install
22+
}
23+
24+
## arg 1: the old package version
25+
#pre_remove() {
26+
# do something here
27+
#}
28+
29+
## arg 1: the old package version
30+
#post_remove() {
31+
# do something here
32+
#}
33+

0 commit comments

Comments
 (0)