Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Nix related
result
323 changes: 308 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Inspired from [rofi-wifi-menu](https://github.com/zbaylin/rofi-wifi-menu).
- [Config](#config)
- [Languages](#language-localization)
- [Download-Usage](#download-usage)
- [Instalationn](#installing-uninstalling-and-updating-ronema)
- [Installation](#installing-uninstalling-and-updating-ronema)
- [Themes](#themes)
- [Examples-Usage](#examples-usage)
- [ToDo](#todo)
- [To-Do](#to-do)

### Requirements

Expand All @@ -24,24 +24,24 @@ Inspired from [rofi-wifi-menu](https://github.com/zbaylin/rofi-wifi-menu).
- [dunst](https://github.com/dunst-project/dunst)
- [fnott](https://codeberg.org/dnkl/fnott)
- **nm-connection-editor** (_Optional_) (_For editing connections_)
- [**qrencode**](https://fukuchi.org/works/qrencode) (_Optional_) (_For sharing wifi with qrcode_)
- [**qrencode**](https://fukuchi.org/works/qrencode) (_Optional_) (_For sharing Wi-Fi with qr code_)

### Features

- Connect to an existing network.
- Disconnect from the network.
- Turn on/off wifi.
- Support for Multiple wifi devices.
- Option to change between wifi devices when available.
- Turn on/off Wi-Fi.
- Support for Multiple Wi-Fi devices.
- Option to change between Wi-Fi devices when available.
- Manual Connection to a Access Point or a hidden one.
- Turn on/off ethernet.
- See when ethernet is unavailable.
- Turn on/off Ethernet.
- See when Ethernet is unavailable.
- Restart the network.
- Status
- See devices Connection name and local IP.
- See Current wifi password and share it with a qrcode.
- See Current Wi-Fi password and share it with a qr code.
- Connect to pre-configured VPNs.
- Change the defualt signal strength bars with anything you want.
- Change the default signal strength bars with anything you want.
- Support for language localization based on configuration file.

### Screenshots
Expand All @@ -57,7 +57,7 @@ Inspired from [rofi-wifi-menu](https://github.com/zbaylin/rofi-wifi-menu).

```
# Location
# +---------- +
# +-----------+
# | 1 | 2 | 3 |
# | 8 | 0 | 4 |
# | 7 | 6 | 5 |
Expand Down Expand Up @@ -106,9 +106,256 @@ THEME="ronema.rasi"
```
</details>

<details>
<summary>Configuring with Nix</summary>

All of the above configuration fields are accessible directly in the Home-Manager module, like so:
```nix
{ lib, ... }:

{
programs.ronema = {
enable = true;

theme = {}; # Define a theme the same way you do it for Rofi. See https://nix-community.github.io/home-manager/options.xhtml#opt-programs.rofi.theme

languages = ./languages; # A directory containing the languages you want to add. This directory should contain at least the language used in `programs.ronema.settings.language`

icons = ./icons; # A direction containing the icons for ronema. The directory must be similar in names and formats to `src/icons`

settings = {
ascii_out = false;
selection_prefix = "-";
y_axis = 0;
};
};
}
```

#### Module Options


##### [`options.programs.ronema.enable`](#L19)

Rofi NetworkManager applet

**Type:** `boolean`

**Default:** `false`

**Example:** `true`

##### [`options.programs.ronema.package`](#L21)

The ronema package to use.

**Type:** `types.package`

**Default:** `package`

##### [`options.programs.ronema.theme`](#L27)

Define the theme using rofi rasi. See https://nix-community.github.io/home-manager/options.xhtml#opt-programs.rofi.theme

**Type:** `rofiHelpers.themeType`

**Default:** `null`

##### [`options.programs.ronema.languages`](#L33)


The path to a directory containing languages file for ronema.

The directory should contain at least the language defined in `programs.ronema.settings.language`

See: https://github.com/P3rf/rofi-network-manager/blob/master/src/languages/lang_file.example to learn how to make language files for ronema.


**Type:** `types.path`

**Default:** `"${package}/languages"`

##### [`options.programs.ronema.icons`](#L45)


The path to a directory containing icons for ronema.

The directory must contain the following icons in the same names and formats:
- `alert.svg`
- `change.svg`
- `restart.svg`
- `scanning.svg`
- `vpn.svg`
- `wait.svg`
- `wifi-off.svg`
- `wifi-on.svg`
- `wired-off.svg`
- `wired-on.svg`


**Type:** `types.path`

**Default:** `"${package}/icons"`

##### [`options.programs.ronema.settings.location`](#L66)


Location:
+-----------+
| 1 | 2 | 3 |
| 8 | 0 | 4 |
| 7 | 6 | 5 |
+-----------+
The grid represents the screen with the numbers indicating the location of the window.
If you want the window to be in the upper right corner, set location to 3.


**Type:** `locationType`

**Default:** `0`

##### [`options.programs.ronema.settings.qrcode_location`](#L81)


This sets the anchor point for the window displaying the QR code.


**Type:** `locationType`

**Default:** `cfg.settings.location`

##### [`options.programs.ronema.settings.x_axis`](#L89)

This sets the distance of the window from the edge of the
screen on the X axis.

**Type:** `types.int`

**Default:** `0`

##### [`options.programs.ronema.settings.y_axis`](#L96)

This sets the distance of the window from the edge of the
screen on the Y axis.

**Type:** `types.int`

**Default:** `0`

##### [`options.programs.ronema.settings.notifications`](#L103)

Use notifications or not.

**Type:** `types.bool`

**Default:** `false`

##### [`options.programs.ronema.settings.notifications_icons`](#L109)

Use notifications icons or not.

**Type:** `types.bool`

**Default:** `false`

##### [`options.programs.ronema.settings.qrcode_dir`](#L115)

Location of QRCode WiFi image.

**Type:** `types.nonEmptyStr`

**Default:** `"/tmp/"`

##### [`options.programs.ronema.settings.width_fix_main`](#L121)


WIDTH_FIX_MAIN/WIDTH_FIX_STATUS
These values can be adjusted if the text doesn't fit or
if there is too much space at the end when you launch the script.
It will depend on the font type and size.


**Type:** `types.int`

**Default:** `1`

##### [`options.programs.ronema.settings.width_fix_status`](#L132)


WIDTH_FIX_MAIN/WIDTH_FIX_STATUS
These values can be adjusted if the text doesn't fit or
if there is too much space at the end when you launch the script.
It will depend on the font type and size.


**Type:** `types.int`

**Default:** `10`

##### [`options.programs.ronema.settings.ascii_out`](#L143)


Set it to true, if the script outputs the signal strength with asterisks
and you want bars.


**Type:** `types.bool`

**Default:** `false`

##### [`options.programs.ronema.settings.change_bars`](#L152)


Set it to true if you want to use custom icons
for the signal strength instead of the default ones.


**Type:** `types.bool`

**Default:** `false`

##### [`options.programs.ronema.settings.theme`](#L167)


The theme name for ronema.

This option is automatically set when you defined your own theme with `programs.rofi.applets.ronema`.
If you change it, your defined theme will not be applied.


**Type:** `types.nonEmptyStr`

**Default:**

```nix
if cfg.theme != null
then generatedThemeName
else "ronema.rasi"
```

##### [`options.programs.ronema.settings.selection_prefix`](#L181)

The selection prefix.

**Type:** `types.nonEmptyStr`

**Default:** `"~"`

##### [`options.programs.ronema.settings.language`](#L187)

The language file to use.

**Type:** `types.nonEmptyStr`

**Default:** `"english"`

---
*Generated with [nix-options-doc](https://github.com/Thunderbottom/nix-options-doc)*
</details>

### Language Localization

To localize Rofi-NetWork-manager to your preferred language:
To localize ronema to your preferred language:

1. **Create a New Language File**: Duplicate `lang_file.example` and rename it to match your language (e.g., `french.lang`).

Expand All @@ -128,6 +375,8 @@ cd rofi-network-manager

### Installing, Uninstalling, and Updating ronema

#### With setup.sh

To install ronema, run the following command:

```bash
Expand All @@ -153,6 +402,50 @@ The `--override_conf` flag is optional. If provided, it will override the existi

Configuration files will be located at `~/.config/ronema`.

#### With Nix

You can install ronema by directly referencing the flake in your configuration:

```nix
inputs = {
# ---Snip---
ronema = {
url = "gitlab:P3rf/rofi-network-manager";
# Optional, by default this flake follows nixpkgs-unstable.
inputs.nixpkgs.follows = "nixpkgs";
};
# ---Snip---
}
```

This flake provides an overlay for Nixpkgs, a package and a Home-Manager module.
They are respectively found in the flake as `inputs.ronema.overlays.default`, `inputs.ronema.packages.${system}.default` (Where `${system}` is either `x86_64-linux` or `aarch64-linux`) and `inputs.ronema.homeManagerModules.default`.

Here is a simple example on how to install both the overlay and the module in
your Home-Manager configuration:

```nix
outputs = inputs@{ ronema, ...}: {
# replace 'joes-desktop' with your hostname here.
nixosConfigurations.joes-desktop = home-manager.lib.homeManagerConfiguration {
system = "x86_64-linux";
modules = [
ronema.homeManagerModules.default
# Add your own modules here

# Example to add the overlay to Nixpkgs:
{
nixpkgs = {
overlays = [
ronema.overlays.default
];
};
}
];
};
};
```

### Themes

Rofi themes for ronema are located in the `src/themes` directory, or if installed, in `~/.config/ronema/themes`. Available themes at the moment are:
Expand Down Expand Up @@ -211,11 +504,11 @@ label-disconnected ="󰌺"
```
</details>

### ToDo
### To-Do

- [x] Fix notifications
- [x] Add notifications icons
- [x] Support for multiple wifi devices
- [x] Support for multiple Wi-Fi devices
- [ ] Add Hotspot support
- [x] Share wifi password with qrcode inside rofi
- [x] Share Wi-Fi password with qr code inside Rofi
- [x] Find a way to manage duplicate Access Points
Loading