diff --git a/README.md b/README.md index 6481798..d4e19a5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,28 @@ Utilize your computer purposefully. +## Make executable and install + +``` +pip install pyinstaller --user +pyinstaller --onefile antidrift.py +sudo cp dist/antidrift /usr/bin +``` + +## Dependencies + +- dbus-python +- glib + +## Create sudoers configuration + +Create a file `antidrift` in `/etc/sudoers.d`. This allows antidrift to run +itself with sudo ultimately making it unkillable from the regular user. + +``` +user hostname = (root) NOPASSWD: /usr/bin/antidrift +``` + ## Autostart with systemd - Create `~/.config/systemd/user/antidrift.service` @@ -13,7 +35,7 @@ Utilize your computer purposefully. Description=AntiDrift [Service] -ExecStart=/home/felixm/dot/bin/antidrift +ExecStart=antidrift [Install] WantedBy=default.target @@ -28,7 +50,7 @@ Add the following content to the file. ``` [Desktop Entry] Name=AntiDrift -Exec=/home/felixm/dot/bin/antidrift +Exec=antidrift Terminal=false Type=Application StartupNotify=false diff --git a/antidrift.py b/antidrift.py index 44a2478..809e780 100644 --- a/antidrift.py +++ b/antidrift.py @@ -61,7 +61,7 @@ def main() -> None: if newpid == 0: main_daemon(config) else: - cmd = ["sudo", "/home/felixm/dot/bin/antidrift"] + cmd = ["sudo", "antidrift"] subprocess.Popen(cmd) elif len(sys.argv) == 2 and sys.argv[1] == '--daemon_user': main_daemon(config)