Skip to content

Commit f315725

Browse files
author
Andreas Poulsen
committed
Make activate shortcuts not need dbus-launch
1 parent 7de22c8 commit f315725

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

os2borgerpc/desktop/desktop_activate_shortcuts.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ rm --force /home/$SHADOW/.config/autostart/gio-fix-desktop-file-permissions.desk
1616
cat << EOF > "$GIO_SCRIPT"
1717
#! /usr/bin/env sh
1818
19-
# gio needs to run as the user + dbus-launch, we have this script to create it and kill it afterwards
20-
export \$(dbus-launch)
21-
DBUS_PROCESS=\$\$
19+
# gio needs to run as the user with correct dbus settings
20+
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u user)/bus"
2221
2322
for FILE in /home/$USER/Skrivebord/*.desktop; do
2423
gio set "\$FILE" metadata::trusted true
2524
done
2625
27-
kill \$DBUS_PROCESS
2826
EOF
2927

3028
# Script to activate programs on the desktop
@@ -42,7 +40,9 @@ su --login user --command $GIO_SCRIPT
4240
# Now set the permissions back to their restricted form
4341
for FILE in /home/$USER/Skrivebord/*.desktop; do
4442
chown root:$USER "\$FILE"
45-
# Can't make sense of this as it already has execute permissions, but it won't work without it
43+
# In order for gio changes to take effect, it is necessary to update the file time stamp
44+
# This can be done with many commands such as chmod or simply touch
45+
# However, in some cases the files might not have execute permission so we add it with chmod
4646
chmod ug+x "\$FILE"
4747
done
4848
EOF

0 commit comments

Comments
 (0)