To remove specific documents from the Evince homepage, you must delete or rename the corresponding entry in the recent files list stored in the recent.xbel configuration file. This file is located within your user profile directory under .config/evince/. Modifying this XML file allows precise control over which PDFs appear on the startup screen without affecting the actual document files.
Understanding the Recent Files Database
Evince, the default document viewer for GNOME, maintains a history of recently opened files to provide quick access via its homepage interface. This history is not stored in a simple text list but rather in an XBEL (XML Bookmark Exchange Language) format. The primary file responsible for this data is namedrecent.xbel. When you open a PDF, Evince updates this file with the file path, title, and timestamp. Consequently, when you wish to hide a specific document from the homepage, you are essentially editing this metadata record. It is crucial to understand that deleting the entry here does not delete the actual PDF file from your hard drive; it only removes the shortcut from the viewer's interface.
For users managing privacy concerns or cluttered interfaces, knowing how to manipulate this database is essential. If you have accidentally added sensitive documents to the recent list, removing them ensures they do not appear for other users who might access the same machine. This method provides a granular level of control that the graphical interface sometimes lacks, especially when dealing with many similar files or temporary documents. You can also refer to our guide on Copying Transparent Text over Image in PDF using 'copyimage' in Evince for other advanced management tasks within the same application ecosystem.
Locating the Configuration File
The first step in this process is accessing the correct directory where Evince stores its user-specific settings. On Linux systems, configuration files are typically hidden within the home directory. To find the recent files database, you need to navigate to the.config/evince/ folder. This folder resides inside your home directory, often denoted by the tilde symbol (~) in terminal commands.
You can locate this file using the file manager or the command line. In the file manager, ensure that "Show Hidden Files" is enabled, usually by pressing Ctrl+H, as directories starting with a dot are hidden by default. Once visible, navigate to Home/.config/evince/. Here, you will find the recent.xbel file. If you prefer using the terminal, you can check if the file exists by running ls ~/.config/evince/recent.xbel. If the file is present, the system will return the path; if not, Evince may create it upon opening a new document. Be cautious not to confuse this with global configuration files, as changes here only affect your current user account.
Editing the Recent.XBEL File
Once you have located therecent.xbel file, you should back it up before making any changes. This is a critical safety step in case the XML structure becomes corrupted, which could prevent Evince from launching correctly. Copy the file to a safe location, such as your desktop, using a command like cp ~/.config/evince/recent.xbel ~/Desktop/recent_backup.xbel.
Open the original recent.xbel file in a plain text editor. Do not use word processors like LibreOffice Writer, as they may alter the formatting and break the XML syntax. A terminal-based editor like nano or vim, or a code editor like VS Code, is recommended. Inside the file, you will see a series of tags. Each tag represents one entry in the Evince homepage. Look for the section within each bookmark, which contains the and attributes. The attribute holds the full path to the PDF file. Identify the entry corresponding to the document you wish to remove. Delete the entire block associated with that file. Ensure you remove all lines belonging to that specific bookmark, including the closing tag. Save the file after making your edits.
Resetting the Homepage Completely
If you want to clear the entire recent files list rather than just individual entries, you do not need to edit the XML manually. The simplest way to reset the homepage is to delete therecent.xbel file entirely. Evince will automatically generate a fresh, empty version of this file the next time it starts and opens a document. To do this, you can run the command rm ~/.config/evince/recent.xbel in the terminal. Alternatively, you can delete it via the graphical file manager. After deletion, restart Evince. The homepage will now appear empty, showing no recent documents. This method is useful if you want to start with a clean slate or if the XML file has become corrupted with multiple invalid entries. Note that this action is irreversible unless you restore from a backup, so ensure you have saved any important context if needed.
Verifying Changes and Troubleshooting
After editing or deleting the configuration file, you must restart Evince for the changes to take effect. Close the application completely and reopen it. Check the homepage to verify that the specified document is no longer listed. If the document still appears, it may be because Evince caches the file list. In such cases, try restarting your computer or logging out and back into your session. Another common issue arises if the XML file is edited incorrectly, leading to parsing errors. If Evince fails to launch or displays an error about the recent files, restore the backup file you created earlier by copying it back to the.config/evince/ directory. For further assistance with document handling, you might find our article on Raspberry Pi 3: Disconnecting Raspotify/Librespot from Spotify Connect Immediately helpful for understanding how to manage background processes and configurations effectively.
Frequently Asked Questions
Does removing a document from Evince delete the actual PDF file?
No, removing an entry from the recent files list only deletes the shortcut from the Evince homepage. The original PDF file remains intact in its original location on your hard drive. You can still access the file through your file manager or by opening it directly from within Evince using the "Open" dialog.How can I stop Evince from adding files to the recent list permanently?
While there is no direct setting to disable recent files in older versions, newer versions of Evince may offer preferences to control this behavior. Check the Edit menu under Preferences for options related to "Recent Documents." If such an option is unavailable, you can periodically delete therecent.xbel file to keep the list empty.
What happens if I corrupt the recent.xbel file?
If the XML structure is broken, Evince may fail to start or display an error message regarding the recent files database. In this scenario, you should restore the file from the backup you created before editing. If no backup exists, deleting the corrupted file will force Evince to create a new, valid one upon restart.Can I search for a specific document in the recent files list using the terminal?
Yes, you can use grep to search for a filename within therecent.xbel file. Run a command like grep -n "filename.pdf" ~/.config/evince/recent.xbel to find the line numbers associated with that document. This helps you quickly identify which blocks to remove without scrolling through the entire file manually.
Is the recent.xbel file synchronized across different Linux distributions?
No, therecent.xbel file is local to your user profile on the specific machine where it was created. It is not synchronized across different distributions or devices unless you manually copy it or use a cloud storage service configured to sync the .config directory. Each installation maintains its own separate history.