Automate your mattermost custom status with the help of visible Wi-Fi SSID. Development site is hosted on gitlab.
Here after is the command line help. ```text automattermostatus 0.1.7 Automate mattermost status with the help of wifi network
Use current visible wifi SSID to automate your mattermost status. This program is meant to either be running in
background or be call regularly with option --delay 0
. It will then update your mattermost custom status according to
the config file
USAGE: automattermostatus [FLAGS] [OPTIONS]
FLAGS:
-h, --help
Prints help information
-q, --quiet
Decrease the output's verbosity level.
Used once, it will set error log level. Used twice, will silent the log completely
-v, --verbose
Increase the output's verbosity level
Pass many times to increase verbosity level, up to 3.
-V, --version
Prints version information
OPTIONS:
-b, --begin
beginning of status update with the format hh:mm
Before this time the status won't be updated [env: BEGIN=]
--delay <delay>
delay between wifi SSID polling in seconds [env: DELAY=]
-e, --end <end>
end of status update with the format hh:mm
After this time the status won't be updated [env: END=]
--expires-at <expires-at>
Expiration time with the format hh:mm
This parameter is used to set the custom status expiration time Set to "0" to avoid setting expiration time
[env: EXPIRES_AT=]
-i, --interface-name <interface-name>
wifi interface name [env: INTERFACE_NAME=]
--keyring-service <keyring-service>
Service name used for mattermost private token lookup in OS keyring [env: KEYRING_SERVICE=]
--keyring-user <keyring-user>
User name used for mattermost private token lookup in OS keyring [env: KEYRING_USER=]
--mm-token <mm-token>
mattermost private Token
Usage of this option may leak your personal token. It is recommended to use `mm_token_cmd` or `keyring_user`
and `keyring_service`. [env: MM_TOKEN]
--mm-token-cmd <mm-token-cmd>
mattermost private Token command [env: MM_TOKEN_CMD=]
-u, --mm-url <mm-url>
mattermost URL [env: MM_URL=]
--state-dir <state-dir>
directory for state file
Will use content of XDG_CACHE_HOME if unset. [env: STATE_DIR=]
-s, --status <status>...
Status configuration triplets (:: separated)
Each triplet shall have the format: "wifi_substring::emoji_name::status_text". If `wifi_substring` is empty,
the ssociated status will be used for off time.
```
Automattermostatus get configuration from both a config file and a command line (the later override the former).
The config file is created if it does not exist. It is created or read in the following places depending on your OS:
- the XDG user directory specifications on Linux (usually ~/.config/automattermostatus/automattermostatus.toml
),
- the Known Folder system on Windows (usually {FOLDERID_RoamingAppData}\automattermostatus\config
),
- the Standard Directories on macOS (usually $HOME/Library/Application Support/automattermost
).
A sample config file is:
```toml
#
interface_name = 'wlp0s20f3'
::
# status = ["corporatewifi::corplogo::On premise work", "homenet::house::Working home", "::sleeping::Off time"]
mm_url = 'https://mattermost.example.com'
verbose = 'Info'
mm_token_cmd
orkeyring_user
and keyring_service
.keyring_user
and keyring_service
.keyringuser = myname keyringservice = mattermost_token
expires_at = "19:30"
begin = "8:00" end = "19:30"
EveryWeek
: the day is always offEvenWeek
: the day is off on even week (iso week number)OddWeek
: the day is off on odd week (iso week number)[offdays] Sat = 'EveryWeek' Sun = 'EveryWeek' Wed = 'EvenWeek' ```
Your private
token
is available under Account Parameters > Security > Personal Access Token
.
You should avoid to use mm_token
parameter as it may leak your token to
other people having access to your computer. It is recommended to use the
mm_token_cmd
option or better your local OS keyring with keyring_user
and
keyring_service
parameters.
For example, on linux you may use secret-tool
:
```sh
secret-tool store --label='token' name automattermostatus
mm_token_cmd
to retrieve your token:secret-tool lookup name automattermostatus
or the `keyring` command:
sh
keyring set mattermost_token username
toml
keyringuser = 'username' keyringservice = 'mattermost_token' ``` On Mac OS you may use Keychain to store the mattermost access token, and it will be looked up by automattermostatus with a configuration similar to the one given here before.
On Windows, I have no mean to test, but it looks like you may use any software based upon Microsoft Credential Locker to store your mattermost access token.
On linux automattermostatus depends upon NetworkManager
for getting the
visible SSIDs without root rights.
You can either compile yourself, download the latest binaries from the release page or install one of the available packages.
Use your favorite aur helper. For example:
yay -S automattermostatus
You can build the automattermostatus
binary with:
cargo build --release
The binaries are then found in the target/release
directory.
Licensed under Apache License, Version 2.0 (LICENSE-APACHE).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
You may open issues or feature requests on the gitlab issue page.
You may fork the project on gitlab, develop your patch or feature on a new branch and submit a new merge request after having push back to your forked repo.
Do not hesitate to open an issue beforehand to discuss the bug fix strategy or to ask about the feature you imagine.