Skip to content

Simple hook for taskwarrior which switches context according to WIFI SSID.

License

Notifications You must be signed in to change notification settings

Zebradil/tw-wifi-contexter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tw-wifi-contexter

Simple hook for taskwarrior which switches context according to WIFI SSID. Currently only MacOS is supported.

The hook executes on each invocation of task command. If it can get WIFI SSID, that SSID is listed in config, and according context is not set, then the hook sets this context. If SSID is unknown or appropriate context already active, the hook does nothing.

Usage

All you need is to copy hook in hooks directory and create config. Config is ini-file with one section [DEFAULT]. Keys are contexts, values are lists of SSIDs. For example:

[DEFAULT]
work=office, office_guest
home=MY_WIFI_SPOT
# Copy `on-launch.switch-context.py` to hooks directory (it's `~/.task/hooks` by default).
cp src/on-launch.switch-context.py ~/.task/hooks/

# Create ini config in hooks directory
cp ssid_context_map.ini.example ~/.task/hooks/ssid_context_map.ini

# Set mappings: context-to-SSIDs
vim ~/.task/hooks/ssid_context_map.ini

TODO

  • support for Windows and Linux
  • tests
  • on/off hook switcher in taskwarrior config
  • action for unknown SSID

About

Simple hook for taskwarrior which switches context according to WIFI SSID.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published