Ok, just a quick one for fun:
If you'd prefer not to fiddle with permissions, just run the script below in the background. Checking a text file once per five seconds adds zero to your system's burden, so no worries about that.
home = os.environ["HOME"]
f = os.path.join(home, ".config/gtk-3.0/bookmarks")
text1 = open(f).read()
text2 = open(f).read()
if text2 != text1:
How to use
- Copy the script below into an empty file, save it as
Test-run it with the command:
Try to add bookmarks, they will immediately (within 5 seconds) be reverted.
- If all works fine, ad it to Startup Applications.
Once per 5 seconds, the script checks if the bookmarks file is still in exactly the same state as when you started the script. It will revert if not.
Toggle editing bookmarks
To toggle the ability to edit your bookmarks, copy the small script below, save it as
toggle_bookmarks.sh in one and the same directory as
fix_bookmarks.py, and add the first one to a shortcut, or to any other way to run the toggle script.
if ! pgrep -f "$f"
notify-send -i 'bookmark-new-symbolic' 'Bookmarks' 'Editing disabled'
pkill -f "$f"
notify-send -i 'bookmark-new-symbolic' 'Bookmarks' 'Editing enabled'