/rofi-connman

A script that generates a rofi menu that uses connmanctl to connect to wired, wireless, VPN networks and display status info.

Primary LanguageShellGNU General Public License v3.0GPL-3.0

rofi-connman

connmanctl rofi dmenu empty sexpect

About

rofi-connman is a graphical frontend for connman, lightweight network connection manager. It's an excellent choice for those who want to have a flexible menu-driven network configuration tool without hassle and unnecessary dependencies other network managers require.

rofi-connman was designed with speed in mind to be able to display over 10000 NordVPN profiles with no significant delay.

Features

rofi-connman is in early development, so only basic functionality is supported so far:

  1. Connecting to secure Wi-Fi networks
  2. Connecting to unprotected Wi-Fi networks
  3. Connecting to hidden Wi-Fi networks
  4. Connecting to pre-defined VPN networks
  5. Switching service priority
  6. Custom commands for main menu, prompt and PIN prompt (so rofi can easily be replaced with dmenu)
  7. Wi-Fi network info (name, signal strength, state, security level, autoconnect status, favorites)
  8. Bar status mode (for bars like polybar)
  9. Aims for full POSIX compliance

Installation

  1. Install dependencies: rofi, connmanctl (provided by connman) and empty (provided by empty)
  2. git clone --depth=1 git@github.com:sourcemage/rofi-connman.git
  3. cd rofi-connman
  4. ./rofi-connman
  5. (Optional) For easy access, add the script somewhere in your $PATH.

Arch-based distributions

  1. rofi-connman is available in AUR.

Configuration

rofi-connman supports 3 env variables:

  1. ROFI_COMMAND: main menu command, to assign more lightweight alternatives like dmenu
  2. ROFI_PROMPT_COMMAND: general prompt command, for additional info input, like SSID
  3. PIN_PROMPT_COMMAND: password prompt command, for password input; with some extra scripting even pinentry-dmenu can be used

If sexpect is installed, it'll be used instead of empty.

Additionally, use of mawk is encouraged if you have thousands of VPN profiles. Once installed, rofi-connman will automatically prefer it over other awk interpreters.

Polybar configuration

NOTE: In order to properly display the network icon, you will need to use an iconic font in your bar, e.g. Siji

[module/connman]
type = custom/script
exec = rofi-connman --status
interval = 2

click-left = rofi-connman > /dev/null &
click-right = rofi-connman --toggle &

sxhkd hotkey

alt + c
	rofi-connman