Skip to content

Commit

Permalink
docs(readme): add proper installation and usage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed Dec 7, 2024
1 parent 4d1654f commit c1ca141
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 8 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@ CARGO ?= cargo
CARGO_TARGET_DIR ?= target
CARGO_RELEASE_DIR ?= $(CARGO_TARGET_DIR)/release

LICENSE_DIR ?= /usr/share/licenses/$(PKGNAME)
build:
cargo build --release --lib

clean:
cargo clean

install:
PLUGINS_DIR_CONFIG = $(shell pkg-config --variable pluginsdir rofi)
PLUGINS_DIR ?= $(if $(PLUGINS_DIR_CONFIG),$(PLUGINS_DIR_CONFIG),lib/rofi)
PLUGIN_INSTALL_PATH := "$(PLUGINS_DIR)/$(PLUGIN_NAME)"

install:
cargo build --release --lib
LICENSE_DIR ?= /usr/share/licenses/$(PKGNAME)

# Install plugin
install -DT "$(CARGO_RELEASE_DIR)/$(LIB_NAME)" "$(DESTDIR)$(PLUGIN_INSTALL_PATH)"

# Copy license file
install -Dt $(DESTDIR)$(LICENSE_DIR) LICENSE

cargo clean

uninstall:
PLUGINS_DIR_CONFIG = $(shell pkg-config --variable pluginsdir rofi)
PLUGINS_DIR ?= $(if $(PLUGINS_DIR_CONFIG),$(PLUGINS_DIR_CONFIG),lib/rofi)
PLUGIN_INSTALL_PATH := "$(PLUGINS_DIR)/$(PLUGIN_NAME)"
LICENSE_DIR ?= /usr/share/licenses/$(PKGNAME)

rm ${PLUGIN_INSTALL_PATH}
rm -rf ${LICENSE_DIR}
106 changes: 105 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,111 @@
</h4>

## Installation
> **Note:** This project is under active development and doesn't have a proper way to build/install it at the moment.

<details>
<summary><h4>Nix Flakes</h4></summary>
To install this plugin on a flake-based NixOS system, a bare-minimum configuration would look as follows:
<pre lang="nix">
# flake.nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
rofi-jetbrains = {
url = "github:zakuciael/rofi-jetbrains";
# inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations."default" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
# Pass system and inputs to the configuration.nix file
inherit system inputs;
};
modules = [
./configuration.nix
];
};
};
}
</pre>
<pre lang="nix">
# configuration.nix
{ inputs, system, ... }: {
imports = [
# Hardware config generated by the NixOS Installer
./hardware-configuration.nix
];
environment.systemPackages = [inputs.rofi-jetbrains.packages.${system}.default];
system.stateVersion = "24.11";
}
</pre>
</details>

<details>
<summary><h4>Manual installation</h4></summary>
<h3>Prerequirements</h3>
<ul>
<li>GNU C Library (glib)</li>
<li>GTK3</li>
<li>GNU make utility (make)</li>
<li>pkg-config</li>
</ul>

<h3>Building</h3>
To build the plugin run `make` or `make build` command in the project root.
<h3>Installation</h3>
To install the plugin system-wide run `make install` command after building the project.
</details>

## Quickstart

### Usage

To run the plugin, execute the following command in your terminal or shortcut launcher:

```bash
rofi -modi jetbrains -show jetbrains
```

### Configuration

You can customize the behavior of the plugin by using the following configuration options in your `.rasi` file:

#### Installation directory

You can change the directory where all of your JetBrains IDEs are installed by using the `jetbrains-install-dir`
configuration option.
**For example:**

```rasi
jetbrains-install-dir: "~/.local/share/JetBrains/Toolbox/apps/";
```

#### Aliases

If you want to add custom IDE aliases a part from the [built-in ones](src/ide/mod.rs#L53) you can use the
`jetbrains-custom-aliases` configuration option to do so.
The syntax for an alias is composed of `<alias string>:<ide_product_code>`, where the `ide_product_code` can be found
in the `product-info.json` file in the IDE installation directory or
in [this file](src/ide/mod.rs#L30).
**For example:**

```rasi
jetbrains-custom-aliases: ["web:WS", "cpp:CL"];
```

#### Icons

This plugin uses the built-in icon fetcher provided by rofi so to disable them or change the icon theme use the
respected rofi configuration options.
**For example:**

```rasi
show-icons: true;
icon-theme: "WhiteSur-dark";
```

## License

Distributed under the MIT license. See [LICENSE](LICENSE) file for more information.
1 change: 0 additions & 1 deletion result

This file was deleted.

0 comments on commit c1ca141

Please sign in to comment.