i3-blocks-go/README.md

139 lines
2.3 KiB
Markdown
Raw Normal View History

2022-08-29 10:57:28 +02:00
# I3 Blocks
Blocks compatible with [i3blocks](https://github.com/vivien/i3blocks).
## Requirements
2022-08-30 13:33:58 +02:00
* `go` for compilation
2022-08-30 16:29:53 +02:00
* `sudo` and `wg-quick` for `wireguard` block
2022-08-29 10:57:28 +02:00
* `tmux` for `app` and `date` blocks
* `df` for `du` block
* `xdg-open` for `du` block
2022-08-29 19:57:44 +02:00
* `playerctl` for `spotify` block
2022-08-29 10:57:28 +02:00
## Installation
### From binaries
2022-08-29 20:13:00 +02:00
Get binaries from [releases](https://gitnet.fr/deblan/i3-blocks-go/releases).
2022-08-29 10:57:28 +02:00
### From sources
```
git clone https://gitnet.fr/deblan/i3-blocks-go.git
cd i3-blocks-go
make
```
## Usage
2022-08-30 16:29:53 +02:00
Each binary has a help, eg `./app -h`.
### App
2022-08-29 10:57:28 +02:00
Add the shortcut `<name>` and run `<command>` when clicked.
```
2022-08-30 16:29:53 +02:00
command=/path/to/app -block=<block_name> -name=<name> -cmd=<command> -bg-color=<background_color> -fg-color<foreground_color>
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### Date
2022-08-29 10:57:28 +02:00
Show the time using given format and run `gnome-calendar` when clicked.
```
2022-08-30 16:29:53 +02:00
command=/path/to/date -format="%H:%M:%S %d/%m/%Y"
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### Disk usage
2022-08-29 10:57:28 +02:00
Show mount point usage and warns with limits and colors.
```
2022-08-30 16:29:53 +02:00
command=/path/to/du -block=<block_name> -name=<name> -mount-point=<mount_point> -limit-warning=<limit_warning> -limit-danger=<limit_danger>
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### IP
2022-08-29 10:57:28 +02:00
Show the IP of the given iface.
```
2022-08-30 16:29:53 +02:00
command=/path/to/ip -iface=<iface> -version=<ip4|ip6> -name=<name>
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### IP (wan)
2022-08-29 10:57:28 +02:00
Show the public IP.
```
2022-08-30 16:29:53 +02:00
command=/path/to/ip_wan
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### Prusa telemetry
2022-08-29 10:57:28 +02:00
Show the telemetry using Prusa Printer API.
```
2022-08-30 16:29:53 +02:00
command=/path/to/prusa_telemetry -api=http://1.2.3.4/api/telemetry
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### Process
2022-08-30 13:33:58 +02:00
Show a message when the given process is running (use `preg -f`).
```
2022-08-30 16:29:53 +02:00
command=/path/to/ps -process=<process> -message=<message>
2022-08-30 13:33:58 +02:00
```
2022-08-30 16:29:53 +02:00
### Feed indicator
2022-08-29 10:57:28 +02:00
Show indicator of RSS.
```
2022-08-30 16:29:53 +02:00
command=/path/to/rss -block=<block_name> -feed=<feed_url> -website=<feed_reader_url> -empty-color=<color> -non-empty-color=<color>
2022-08-29 10:57:28 +02:00
```
2022-08-30 16:29:53 +02:00
### Spotify status
2022-08-29 19:57:44 +02:00
Show current song played (spotify).
```
2022-08-30 16:29:53 +02:00
command=/path/to/spotify
2022-08-29 19:57:44 +02:00
```
2022-08-30 16:29:53 +02:00
### Volume
2022-08-29 13:44:34 +02:00
Show volume.
```
2022-08-30 16:29:53 +02:00
command=/path/to/volume -channel=<channel>
2022-08-29 13:44:34 +02:00
```
2022-08-30 16:29:53 +02:00
### Wireguard toggler
2022-08-29 10:57:28 +02:00
Toggler for wireguard.
```
2022-08-30 16:29:53 +02:00
command=/path/to/wireguard -iface=<iface> -name=<name>
2022-08-29 10:57:28 +02:00
```
2022-08-29 16:06:13 +02:00
2022-08-30 16:29:53 +02:00
### Task bar
Add blocks that represent opened apps and create a task bar.
2022-08-29 16:06:13 +02:00
```
2022-08-30 16:29:53 +02:00
[workspace_apps_0]
command=/path/to/workspace_apps 0 $BLOCK_BUTTON
format=json
markup=pango
interval=1
[workspace_apps_1]
command=/path/to/workspace_apps 1 $BLOCK_BUTTON
format=json
markup=pango
interval=1
...
2022-08-29 16:06:13 +02:00
```