hifi: WiFi connection script generator

[ bsd3, cli, library, program ] [ Propose Tags ]

A CLI tool generating scripts for connecting to WiFi, circumventing big WiFi management tools.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.1, 0.1.4.0, 0.1.4.1
Dependencies base (>=4.7 && <5), cmdargs (>=0.10.20 && <0.11), directory (>=1.3 && <2), filepath (>=1.4 && <2), hifi, mustache (>=2.3 && <3), parsec (>=3.1 && <4), process (>=1.6 && <2), text (>=1.2.3 && <2), unix (>=2.7 && <3) [details]
License BSD-3-Clause
Copyright 2018 Rickard Andersson
Author Rickard Andersson
Maintainer gonz@severnatazvezda.com
Category CLI
Home page https://gitlab.com/gonz/hifi
Source repo head: git clone https://gitlab.com/gonz/hifi
Uploaded by gonz at 2018-05-29T07:11:20Z
Distributions
Executables hifi
Downloads 4213 total (24 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-05-29 [all 1 reports]

Readme for hifi-0.1.4.0

[back to package description]

hifi

A tool for generating wifi connection scripts. Uses wpa_supplicant to connect.

Prerequisites

You will need to have wpa_supplicant, wpa_passphrase and dhcpcd installed, as that is what is used in the connection scripts generated by hifi.

Installation

To install, simply do either:

stack install hifi

or

git clone https://gitlab.com/gonz/hifi ./hifi && cd hifi && stack install

Usage

hifi <filename> <interface> <ssid> <passphrase>

The filename parameter determines what your data and script files will be called. They are stored in your XDG data directory, which by default (in most distros) will mean your files will end up in $HOME/.local/share/hifi/....

The SSID and passphrase parameters should be obvious enough. They are simply the connection information you would use to connect to your network.

When a script has been generated once it will not have to be generated again. Instead, you should simply run the generated script.

Typical usage looks as follows, for a first run:

$ hifi wifi-home wlp7s0 MyWLANsSSID MyPassphrase
Created /home/yourusername/.local/share/hifi/data/wifi-home and /home/yourusername/.local/share/hifi/scripts/wifi-home
$ wifi-home

Your $PATH variable and connect scripts

If you want to be able to run the scripts without issuing their full path you will need to add your scripts folder to your path. You can do this in several ways, but the most common one is to add the following to your bash_profile, zsh_profile, zsh_env file or the like:

PATH=".local/share/hifi/scripts:$PATH" where $PATH can either refer to the rest of your $PATH environment variable or simply a literal containing all your specified directories.

Folders, templates

hifi will generate a script for connecting and a data portion that will be used in the script.

The scripts are located in $HOME/.local/share/hifi/scripts and the data portion in the data directory of that same hifi root folder.

hifi uses templates that are located in the templates directory, so you can change the template being used to generate both the data files and the scripts.

The templates are copied on cabal install and stack install, so any changes made will carry on to the installed version.

The templateDir function will return the directory where the files end up being stored. This varies, so that is why it uses getDataFileName and the data-files entry in the cabal-file.