09-torsocks-apps 1.1 KB
Newer Older
1 2 3 4 5 6
#!/bin/sh

set -e

echo "Wrapping some applications with torsocks"

7
APPS="gobby-0.5 net.sourceforge.liferea openpgp-applet seahorse"
8 9
DBUS_SERVICES="org.gnome.seahorse.Application org.fedoraproject.Config.Printing"
WRAPPED_DBUS_SERVICES="net.sourceforge.liferea"
10 11

for app in $APPS; do
12
   sed -i'' --regexp-extended 's,^Exec=(.*),Exec=torsocks \1,' \
13 14
       "/usr/share/applications/${app}.desktop"
done
15 16

for dbus_service in $DBUS_SERVICES; do
17
   sed -i'' --regexp-extended 's,^Exec=(.*),Exec=/usr/bin/torsocks \1,' \
18 19
       "/usr/share/dbus-1/services/${dbus_service}.service"
done
20

21 22 23 24 25 26
# Wrapped by both torsocks and a binary in /usr/local
for dbus_service in $WRAPPED_DBUS_SERVICES; do
   sed -i'' --regexp-extended 's,^Exec=/usr/(.*),Exec=/usr/bin/torsocks /usr/local/\1,' \
       "/usr/share/dbus-1/services/${dbus_service}.service"
done

27
# Redirect to existing wrapper
28 29
sed -i'' --regexp-extended 's,^Exec=pidgin$,Exec=/usr/local/bin/pidgin,' \
    "/usr/share/applications/pidgin.desktop"
30 31
sed -i'' --regexp-extended 's,^Exec=/usr/bin/totem$,Exec=/usr/local/bin/totem,' \
    "/usr/share/dbus-1/services/org.gnome.Totem.service"