ANGRYsearch is a linux file search utility that attempts to emulate 'Everything Search Engine' that is available in Windows. ANGRYsearch displays result as you type the file name or directories.
ANGRYsearch is written in python 3 using PyQt5 for GUI. This tutorial covers installation and usages of this tool, a python based fast search utility in any linux based distros.
Install Required Packages
The installation is simple as there is no complex way of compiling from source etc. The steps include few dependencies to be installed beforehand.
Dependencies - python3-pyqt5, xdg-utils
PyQt5 is needed for python3 GUI and most of the distros have xdg-utils out of the box.
# sudo apt install python3-pyqt5 xdg-utils
python3-gobject - Desktop notifications for automatic update.
xdotool - This is needed if you are using Thunar or PCmanFM and making use of the config option
# sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0
# sudo apt-get install xdotool
Once dependencies have been installed, download the ANGRYsearch and unzip it. The unpack directory will contain a file by the name install.sh . This script will copy files to desired location with correct permissions.
# wget https://github.com/DoTheEvo/ANGRYsearch/archive/v1.0.0.tar.gz # tar xf v1.0.0.tar.gz # cd ANGRYsearch-1.0.0 # chmod u+x install.sh # sh install.sh
At this moment, you can run angry search by executing the following in the terminal or by clicking it from 'Accessories' under the start menu.
The configuration and database file can be found in
~/.cache/angrysearch/angry_database.db respectively. ANGRYsearch database can be set to two different modes in the config file, lite mode and full mode default being lite mode.
› lite mode shows only name and path of the file and directories.
› full mode shows size and date of the last modification
The drawback for full mode is that crawling through drives roughly takes double the time since every file and directory gets additional stats calls.
There are 3 search modes, the default being fast.
› Fast mode - This is enabled when you ticked the check-box next to the input field but cannot find sub strings.
› Slow mode - This mode is enabled when the check-box is unchecked. This mode is slightly slower but can find sub-strings.
› Regex mode - You can activated this mode by pressing the F8 key, indicated by orange color background. This is the slowest search among the three used for very precise searches using regular expressions, set to case insensitive. In this mode entire path is not searched but only the file and directory names are displayed.
Edit the configuration file and edit the parameter values according to your choice.
# vi ~/.config/angrysearch/angrysearch.conf
[General] angrysearch_lite=false conditional_mounts_for_autoupdate=/mnt/angrySearch darktheme=false directories_excluded=.thumbnails fast_search_but_no_substring=true file_manager=spacefm fm_path_doubleclick_selects=false icon_theme=faenza notifications=true number_of_results=500 regex_mode=true row_height=25 typing_delay=false [Last_Run] [email protected](\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0\x9c\0\0\0K\0\0\x3m\0\0\x2\x83\0\0\0\x9d\0\0\0g\0\0\x3l\0\0\x2\x82\0\0\0\0\0\0\0\0\x4\0) [email protected](\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x2\xd0\0\0\x2\x6\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0)
The above configuration file gets created when angry search runs for the first time. You can also delete this file. In the next run this file gets created again with default values.
angrysearch_lite: This is set to true by default.
conditional_mounts_for_autoupdate: By default empty. The mount points needed when the database is being updated. The automatic update through crontab will not run if the mount point is missing. In that case a system notification dialog will inform you that mount point is missing and prevents overwriting the search database when not all drives are present. The values of this fields are system mount points, space separated.
darktheme: By default set to false. If set to true the dark theme is used for the applications interface, as defined in the qdarkstylesheet.qss. The icons for dark theme contains in the file resource_file.py.
directories_excluded: By default empty. The directories to be ignored while searching. The values are directory names separated by spaces. The directory /proc is hard coded to be ignored.
fast_search_but_no_substring: By default set to true. This field holds the last values of the checkbox affecting the speed of search and substrings.
file_manager: By default empty. When left empty angrysearch will try to autodetect default file manager using xdg-utils. If file managers are set/detected ( 'dolphin', 'nemo', 'nautilus', 'doublecmd') the behavior will change slightly, sending to those file managers full path to the file, highlighting the target file when opened in the configured file manager.
fm_path_doubleclick_selects: By default set to false. Needs xdotool package that we have installed in the dependencies section. When set to true, Thunar, PCmanFM and SpaceFM file managers will be able to open containing directory with the selected file.
icon_theme: By default set to adwaita. This can also be set from program's interface in the update window. There are 6 icon types - folder, file, audio, image, video, text.
notifications: By default set to true. You will get a desktop notification to inform that crawling is done when automatic periodic updates is set to run in the background using crontab or if it was aborted because of missing mount points.
number_of_results: By default set to 500. This field limits the searches in the database. Lower number means search results come faster.
regex_mode: By default set to false. Enables regex search mode. You can toggle between true/false by pressing F8 key when running the application.
row_height: By default this value is set to 0 which means default system height. Otherwise, you can set the height of the rows in pixels.
typing_delay: By default this value is set to false. If enabled, it introduces 0.2 second delay between the action of typing and searching the database. This will prevent unnecessary database queries when user is typing fast since the angry search is waiting for typing to be finished. This actually improve performance on slower machines, but on modern ones it might negatively affect the feel of instant responsiveness.
Last_Run: The applications properties from the last time at the moment when it was closed - window size, position, state.
Now again run the angry search and click 'Update' button in the top right. You can set the icon theme, ignored directories through this interface as well.
Update Angrysearch database in the background
angrysearch_update_database.py is used to crawls through drives and updates the search domain. Execute this file automatically using crontab to periodically update the search database in every 30 minutes. Set the cron job for angry search database updation using the following command.
# crontab -e
*/30 * * * * /usr/share/angrysearch/angrysearch_update_database.py
If the system is off during scheduled time then crontab will not try to catch up on that job. If the notifications setting is set to true then you will be notified once the above cronjob runs successfully. If the value of the parameter
conditional_mounts_for_autoupdate is empty then you will be notified that mount point is missing. Desktop notifications from cronjob not always work, so on your distro you might be without them.
The default file search utility in Linux is integrated with file manager like dolphin which takes time when you search for a file or directories. AngrySearch on the contrary is fast search utility that you can use if you need to search file at regular interval. It takes around 2 minutes to index 1 million files with indexed database size of 300MB depending on hdd/ssd. The trade-off is angry search takes some space to store the index database in lieu of fast search.