Add documentation for building antidrift into single executable.
parent
2e4856f0e5
commit
f255fcffee
26
README.md
26
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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue