QazCetelic/home-watcher

Find out which programs are creating those random files in your home directory

Rust

60

19 commits

updated Jul 25, 2026

See the code

README

home-watcher

home-watcher is a Linux utility that monitors your home directory for file creation activities outside of the XDG Base Directory Specification and logs these interactions into an SQLite database. It's useful for finding out which applications keep creating random files with such incredibly descriptive names such as -6000., .swo, and .serverauth.11972 🤔.

Usage

Home Watcher will need to run as root to access the Linux Audit system, but does not need any arguments.

sudo home-watcher

Options

OptionDescriptionDefault
-d, --excluded-dirsSpecify additional directories to exclude from monitoring (relative to your home directory).None
-e, --excluded-executablesSpecify executables to exclude from monitoringNone
-l, --log-filePath to the SQLite database file for logging.XDG_DATA_HOME/home-watcher.db
-i, --intervalInterval (in milliseconds) to check audit logs.1500
-u, --userThe user to watch the home directory of.Executing user
-h, --helpDisplay the help message with usage details.
-V, --versionDisplay the current version of home-watcher.

Note: Common user directories like Documents, Downloads, Pictures, Videos, Desktop, and Music are excluded by default.

Installation

NixOS

{ config, pkgs, ... }:

{
  imports =
    [
      (import (builtins.fetchGit {
        url = "https://github.com/QazCetelic/home-watcher.git";
        rev = "e897e69c9d869d6a6a736b0f08823d683e6de106";
      } + "/nix/home-watcher.nix"))
    ];

  services.home-watcher = {
    enable = true;
    user = "your_user";
  };
}

Other Linux

  1. Build from source
    Clone the repository and compile the Rust project:

    git clone https://github.com/QazCetelic/home-watcher.git
    cd home-watcher
    cargo build --release
    

    The compiled binary will be available in the target/release directory.

  2. Install the binary
    Move the binary to a directory in your PATH, such as /usr/local/bin:

    sudo mv target/release/home-watcher /usr/local/bin/
    
  3. (Optional) Install the systemd service to automatically start it on startup
    Make sure to change <USER> in home-watcher.service

    sudo cp ./home-watcher.service /etc/systemd/system/home-watcher.service
    sudo systemctl enable home-watcher.service --now
    

Database

The database contains an files table with the following data:

NameColumnDescription
Filefile 🔑The location of the modified file or directory
Executableexecutable 🔑The path of the program responsible for modifying the file
Time addedadded_atWhen the file - executable entry was first added
Time changedchanged_atWhen the file - executable entry was last changed
Total countcountThe total amount of times the executable was detected modifying the file

Contributing

If you find bugs, have suggestions, or want to contribute features, feel free to open an issue or submit a pull request.

linux
rust
xdg-compliance

Contributors

QazCetelic

18 commits

erjanmx

1 commits

QazCetelic/home-watcher

Find out which programs are creating those random files in your home directory

Rust

60

19 commits

updated Jul 25, 2026

See the code

README

home-watcher

home-watcher is a Linux utility that monitors your home directory for file creation activities outside of the XDG Base Directory Specification and logs these interactions into an SQLite database. It's useful for finding out which applications keep creating random files with such incredibly descriptive names such as -6000., .swo, and .serverauth.11972 🤔.

Usage

Home Watcher will need to run as root to access the Linux Audit system, but does not need any arguments.

sudo home-watcher

Options

OptionDescriptionDefault
-d, --excluded-dirsSpecify additional directories to exclude from monitoring (relative to your home directory).None
-e, --excluded-executablesSpecify executables to exclude from monitoringNone
-l, --log-filePath to the SQLite database file for logging.XDG_DATA_HOME/home-watcher.db
-i, --intervalInterval (in milliseconds) to check audit logs.1500
-u, --userThe user to watch the home directory of.Executing user
-h, --helpDisplay the help message with usage details.
-V, --versionDisplay the current version of home-watcher.

Note: Common user directories like Documents, Downloads, Pictures, Videos, Desktop, and Music are excluded by default.

Installation

NixOS

{ config, pkgs, ... }:

{
  imports =
    [
      (import (builtins.fetchGit {
        url = "https://github.com/QazCetelic/home-watcher.git";
        rev = "e897e69c9d869d6a6a736b0f08823d683e6de106";
      } + "/nix/home-watcher.nix"))
    ];

  services.home-watcher = {
    enable = true;
    user = "your_user";
  };
}

Other Linux

  1. Build from source
    Clone the repository and compile the Rust project:

    git clone https://github.com/QazCetelic/home-watcher.git
    cd home-watcher
    cargo build --release
    

    The compiled binary will be available in the target/release directory.

  2. Install the binary
    Move the binary to a directory in your PATH, such as /usr/local/bin:

    sudo mv target/release/home-watcher /usr/local/bin/
    
  3. (Optional) Install the systemd service to automatically start it on startup
    Make sure to change <USER> in home-watcher.service

    sudo cp ./home-watcher.service /etc/systemd/system/home-watcher.service
    sudo systemctl enable home-watcher.service --now
    

Database

The database contains an files table with the following data:

NameColumnDescription
Filefile 🔑The location of the modified file or directory
Executableexecutable 🔑The path of the program responsible for modifying the file
Time addedadded_atWhen the file - executable entry was first added
Time changedchanged_atWhen the file - executable entry was last changed
Total countcountThe total amount of times the executable was detected modifying the file

Contributing

If you find bugs, have suggestions, or want to contribute features, feel free to open an issue or submit a pull request.

linux
rust
xdg-compliance

Contributors

QazCetelic

18 commits

erjanmx

1 commits

Languages

Rust

87.7%

Nix

12.3%