More work on README

This commit is contained in:
fdev31 2023-04-30 00:31:40 +02:00
parent beab4d432e
commit 0d2dec94fa

119
README.md
View file

@ -88,8 +88,6 @@ Create a configuration file in `~/.config/hypr/pyprland.json` enabling a list of
} }
``` ```
# Configuring plugins
# Plugin: `magnify` # Plugin: `magnify`
### Command ### Command
@ -99,11 +97,11 @@ Create a configuration file in `~/.config/hypr/pyprland.json` enabling a list of
### Configuration ### Configuration
#### `factor` #### `factor` (optional, defaults to 2)
Scaling factor to be used when no value is provided. Scaling factor to be used when no value is provided.
## PLugin: `toggle_dpms` ## Plugin: `toggle_dpms`
### Command ### Command
@ -124,7 +122,8 @@ Syntax:
"placement": { "placement": {
"<partial model description>": { "<partial model description>": {
"placement type": "<monitor name/output>" "placement type": "<monitor name/output>"
} },
"unknown": "<command to run for unknown monitors>"
} }
} }
``` ```
@ -132,8 +131,11 @@ Syntax:
Example: Example:
```json ```json
"monitors": { "monitors": {
"Medion": { "unknown": "notify-send 'Unknown monitor'",
"placement": "HDMI-1" "placement": {
"Sony": {
"topOf": "HDMI-1"
}
} }
} }
``` ```
@ -154,7 +156,7 @@ Supported placements are:
- rightOf - rightOf
- bottomOf - bottomOf
#### `unknown` #### `unknown` (optional)
If set, runs the associated command for screens which aren't matching any of the provided placements (pattern isn't found in monitor description). If set, runs the associated command for screens which aren't matching any of the provided placements (pattern isn't found in monitor description).
@ -165,6 +167,13 @@ If set, runs the associated command for screens which aren't matching any of the
Make non-visible workspaces follow the focused monitor. Make non-visible workspaces follow the focused monitor.
Also provides commands to switch between workspaces wile preserving the current monitor assignments: Also provides commands to switch between workspaces wile preserving the current monitor assignments:
Syntax:
```json
"workspaces_follow_focus": {
"max_workspaces": <number of workspaces>
}
```
### Command ### Command
- `change_workspace` `<direction>`: changes the workspace of the focused monitor - `change_workspace` `<direction>`: changes the workspace of the focused monitor
@ -182,13 +191,38 @@ You can set the `max_workspaces` property, defaults to `10`.
# Plugin: `scratchpads` # Plugin: `scratchpads`
Check [hpr-scratcher](https://github.com/hyprland-community/hpr-scratcher), it's fully compatible, just put the configuration under "scratchpads". Defines commands that should run in dropdowns. Successor of [hpr-scratcher](https://github.com/hyprland-community/hpr-scratcher), it's fully compatible, just put the configuration under "scratchpads".
Syntax:
```json
"scratchpads": {
"scratchpad name": {
"command": "command to run"
}
}
```
As an example, defining two scratchpads: As an example, defining two scratchpads:
- _term_ which would be a kitty terminal on upper part of the screen - _term_ which would be a kitty terminal on upper part of the screen
- _volume_ which would be a pavucontrol window on the right part of the screen - _volume_ which would be a pavucontrol window on the right part of the screen
Example:
```json
"scratchpads": {
"term": {
"command": "kitty --class kitty-dropterm",
"animation": "fromTop",
"margin": 50,
"unfocus": "hide"
},
"volume": {
"command": "pavucontrol",
"animation": "fromRight"
}
}
```
In your `hyprland.conf` add something like this: In your `hyprland.conf` add something like this:
```ini ```ini
@ -206,23 +240,6 @@ windowrule = workspace special silent,$dropterm
windowrule = size 75% 60%,$dropterm windowrule = size 75% 60%,$dropterm
``` ```
Then in the configuration file, add something like this:
```json
"scratchpads": {
"term": {
"command": "kitty --class kitty-dropterm",
"animation": "fromTop",
"margin": 50,
"unfocus": "hide"
},
"volume": {
"command": "pavucontrol",
"animation": "fromRight"
}
}
```
And you'll be able to toggle pavucontrol with MOD + V. And you'll be able to toggle pavucontrol with MOD + V.
### Commands ### Commands
@ -233,57 +250,34 @@ And you'll be able to toggle pavucontrol with MOD + V.
Note: with no argument it runs the daemon (doesn't fork in the background) Note: with no argument it runs the daemon (doesn't fork in the background)
### Scratchpad Options
Syntax:
```json
"scratchpads": {
"<scratchpad name>": {
"command": "command to execute"
}
}
```
Example:
```json
"scratchpads": {
"term": {
"command": "kitty --class kitty-dropterm",
"animation": "fromTop",
"margin": 50,
"unfocus": "hide"
},
"volume": {
"command": "pavucontrol",
"animation": "fromRight"
}
```
#### command ### Configuration
#### `command`
This is the command you wish to run in the scratchpad. This is the command you wish to run in the scratchpad.
For a nice startup you need to be able to identify this window in `hyprland.conf`, using `--class` is often a good idea. For a nice startup you need to be able to identify this window in `hyprland.conf`, using `--class` is often a good idea.
#### animation #### `animation` (optional)
Type of animation to use Type of animation to use
- `null` / `""` / not defined - `null` / `""` / not defined (no animation)
- "fromTop" - "fromTop" (stays close to top screen border)
- "fromBottom" - "fromBottom" (stays close to bottom screen border)
- "fromLeft" - "fromLeft" (stays close to left screen border)
- "fromRight" - "fromRight" (stays close to right screen border)
#### offset (optional) #### `offset` (optional)
number of pixels for the animation. number of pixels for the animation.
#### unfocus (optional) #### `unfocus` (optional)
allow to hide the window when the focus is lost when set to "hide" allow to hide the window when the focus is lost when set to "hide"
#### margin (optional) #### `margin` (optional)
number of pixels separating the scratchpad from the screen border number of pixels separating the scratchpad from the screen border
@ -295,6 +289,8 @@ Plugins can be loaded with full python module path, eg: `"mymodule.pyprlandplugi
Check the `interface.py` file to know the base methods, also have a look at the other plugins for working examples. Check the `interface.py` file to know the base methods, also have a look at the other plugins for working examples.
To get more details when an error is occurring, `export DEBUG=1` in your shell before running.
## Creating a command ## Creating a command
Just add a method called `run_<name of your command>`, eg with "togglezoom" command: Just add a method called `run_<name of your command>`, eg with "togglezoom" command:
@ -315,4 +311,3 @@ async def run_togglezoom(self, args):
Similar as a command, implement some `event_<the event you are interested in>` method. Similar as a command, implement some `event_<the event you are interested in>` method.