diff --git a/qubes-rpc/caja/qvm_caja_bookmark.py b/qubes-rpc/caja/qvm_caja_bookmark.py new file mode 100644 index 00000000..e540d3cf --- /dev/null +++ b/qubes-rpc/caja/qvm_caja_bookmark.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 -- +import fcntl +import os +import pwd +from urllib import parse +def main(): + homedir = pwd.getpwuid(os.getuid()).pw_dir + bookmark_dir = homedir + '/.config/gtk-3.0/' + created_path = 'qubes-incoming-bookmark-created' + bookmark_path = 'bookmarks' + + d = os.open(bookmark_dir, os.O_RDONLY|os.O_DIRECTORY|os.O_CLOEXEC) + fcntl.lockf(d, fcntl.LOCK_EX) + try: + os.stat(bookmark_path, dir_fd=d) + return + except FileNotFoundError: + with open(bookmark_dir + bookmark_path, "w", ) as f: + f.write("file://" + parse.quote(homedir)) + with open(bookmark_dir + created_path, "w") as f: + pass +if __name__ == '__main__': + main() diff --git a/rpm_spec/core-agent.spec.in b/rpm_spec/core-agent.spec.in index 143dc02f..fdec633f 100644 --- a/rpm_spec/core-agent.spec.in +++ b/rpm_spec/core-agent.spec.in @@ -1091,6 +1091,7 @@ rm -f %{name}-%{version} %if 0%{?rhel} != 7 %files caja +/usr/share/caja-python/extensions/qvm_caja_bookmark.py* /usr/share/caja-python/extensions/qvm_copy_caja.py* /usr/share/caja-python/extensions/qvm_move_caja.py* /usr/share/caja-python/extensions/qvm_dvm_caja.py*