Last active
March 22, 2017 14:57
-
-
Save toke/db33ca88a69c85f0ce0371089a150181 to your computer and use it in GitHub Desktop.
Example on how to context switch with systemd - assuming toggling of a target unit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Laptop at work or in work context | |
Conflicts=at-home.target | |
After=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=bugwarrior-pull | |
[Service] | |
Environment="DISPLAY=:0" | |
ExecStart=/home/toke/.virtualenvs/default/bin/bugwarrior-pull | |
Type=oneshot | |
[Install] | |
WantedBy=at-work.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Run bugwarrior-pull hourly and on boot | |
After=at-work.target | |
PartOf=at-work.target | |
[Timer] | |
OnBootSec=15min | |
OnUnitActiveSec=60m | |
[Install] | |
WantedBy=timers.target | |
WantedBy=at-work.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment