Made default config more spatious and added comments, made README reference the default config

This commit is contained in:
Kirottu
2023-04-14 11:19:23 +03:00
parent 08114309a3
commit 41104dcdb1
2 changed files with 29 additions and 45 deletions

View File

@@ -47,26 +47,7 @@ cargo build --release # Build all the packages
cargo install --path anyrun/ # Install the anyrun binary cargo install --path anyrun/ # Install the anyrun binary
mkdir -p ~/.config/anyrun/plugins # Create the config directory and the plugins subdirectory mkdir -p ~/.config/anyrun/plugins # Create the config directory and the plugins subdirectory
cp target/release/*.so ~/.config/anyrun/plugins # Copy all of the built plugins to the correct directory cp target/release/*.so ~/.config/anyrun/plugins # Copy all of the built plugins to the correct directory
``` cp examples/config.ron ~/.config/anyrun/config.ron # Copy the default config file
After that you need to create the configuration file and place it in `~/.config/anyrun/config.ron`. A config file with all of the included plugins is as follows:
```ron
Config(
width: Absolute(800),
position: Top,
vertical_offset: Absolute(0), // How much the runner is shifted vertically
hide_icons: false,
ignore_exclusive_zones: false, // ignore exclusive zones, f.e. Waybar
layer: Overlay, // GTK Layer: Bottom, Top, Background, Overlay
hide_plugin_info: false,
plugins: [
"libapplications.so",
"libsymbols.so",
"libshell.so",
"libtranslate.so",
],
)
``` ```
## Plugins ## Plugins
@@ -99,24 +80,7 @@ The default configuration directory is `$HOME/.config/anyrun` the structure of t
``` ```
The config file has the following structure, and as seen in the name uses the `ron` language: The [default config file](examples/config.ron) contains the default values, and annotates all configuration options with comments on what they are and how to use them.
```ron
Config(
width: Absolute(800), // The width of the window
position: Top,
vertical_offset: Absolute(0), // How much the runner is shifted vertically
hide_icons: false,
ignore_exclusive_zones: false, // ignore exclusive zones, f.e. Waybar
layer: Overlay, // GTK Layer: Bottom, Top, Background, Overlay
hide_plugin_info: false,
plugins: [
"libapplications.so", // Relative paths are looked up in the <config dir>/plugins/ directory
"/home/kirottu/Projects/anyrun/target/debug/libsymbols.so", // Absolute paths are well, asbolute and loaded as is. Useful for development.
],
)
```
## Styling ## Styling

View File

@@ -1,11 +1,31 @@
Config( Config(
width: Absolute(800), // `width` and `vertical_offset` use an enum for the value it can be either:
position: Top, // Absolute(n): The absolute value in pixels
vertical_offset: Absolute(0), // How much the runner is shifted vertically // Fraction(n): A fraction of the width or height of the full screen (depends on exclusive zones and the settings related to them) window respectively
hide_icons: false,
ignore_exclusive_zones: false, // ignore exclusive zones, f.e. Waybar // How wide the input box and results are.
layer: Overlay, // GTK Layer: Bottom, Top, Background, Overlay width: Absolute(800),
hide_plugin_info: false,
// Where Anyrun is located on the screen: Top, Center
position: Top,
// How much the runner is shifted vertically
vertical_offset: Absolute(0),
// Hide match and plugin info icons
hide_icons: false,
// ignore exclusive zones, f.e. Waybar
ignore_exclusive_zones: false,
// Layer shell layer: Background, Bottom, Top, Overlay
layer: Overlay,
// Hide the plugin info panel
hide_plugin_info: false,
// List of plugins to be loaded by default, can be specified with a relative path to be loaded from the
// `<anyrun config dir>/plugins` directory or with an absolute path to just load the file the path points to.
plugins: [ plugins: [
"libapplications.so", "libapplications.so",
"libsymbols.so", "libsymbols.so",