Skip to content

Commit

Permalink
😜 Gitmoji plugin (#144)
Browse files Browse the repository at this point in the history
### Gitmoji

_List gitmojis and copy them._

Note: You need to have
[wl-clipboard](https://github.com/bugaevc/wl-clipboard) installed on
your system.

**Related config keys**

```yml
# ~/.config/centerpiece/config.yml
plugin:
  gitmoji:
    enable: false
```

This resolves #21.
  • Loading branch information
friedow authored Jun 2, 2024
1 parent 008c3de commit 739e5ba
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ To avoid delays in the plugin launch time this plugin comes with a systemd servi
This index file is located at `~/.cache/centerpiece/git-repositories-index.json` and necessary for the plugin to work.

It exports the following environment variables:

- `$GIT_DIRECTORY`: The path to the git directory.
- `$GIT_DIRECTORY_NAME`: The name of the git directory.
- `$GIT_DIRECTORY_NAME`: The name of the git directory.

If `zoxide` integration is enabled, the plugin will sort your projects based on their respective `zoxide` scores.

Expand All @@ -137,6 +138,21 @@ plugin:
- ["alacritty", "--working-directory", "$GIT_DIRECTORY" "--class" "$GIT_DIRECTORY_NAME"]
```

### Gitmoji

_List gitmojis and copy them._

Note: You need to have [wl-clipboard](https://github.com/bugaevc/wl-clipboard) installed on your system.

**Related config keys**

```yml
# ~/.config/centerpiece/config.yml
plugin:
gitmoji:
enable: false
```

### System Commands

_Lock, sleep, restart or shutdown your system._
Expand Down Expand Up @@ -235,6 +251,8 @@ You can specify alternative configuration locations through:
commands:
- ["alacritty", "--command", "nvim", "$GIT_DIRECTORY"]
- ["alacritty", "--working-directory", "$GIT_DIRECTORY"]
gitmoji:
enable: false
resource_monitor_battery:
enable: true
resource_monitor_cpu:
Expand Down Expand Up @@ -287,6 +305,9 @@ You can specify alternative configuration locations through:
["alacritty" "--working-directory" "$GIT_DIRECTORY"]
];
};
gitmoji: {
enable = false;
};
resource_monitor_battery = {
enable = true;
};
Expand Down
6 changes: 6 additions & 0 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ impl Application for Centerpiece {
>());
}

if self.settings.plugin.gitmoji.enable {
subscriptions.push(crate::plugin::utils::spawn::<
crate::plugin::gitmoji::GitmojiPlugin,
>());
}

if self.settings.plugin.resource_monitor_battery.enable {
subscriptions.push(crate::plugin::utils::spawn::<
crate::plugin::resource_monitor::battery::BatteryPlugin,
Expand Down
Loading

0 comments on commit 739e5ba

Please sign in to comment.