Add documentation for building antidrift into single executable.

main
Felix Martin 2022-07-23 13:19:14 -04:00
parent 2e4856f0e5
commit f255fcffee
2 changed files with 25 additions and 3 deletions

View File

@ -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

View File

@ -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)