Merge branch 'master' of https://github.com/Kirottu/anyrun
This commit is contained in:
10
README.md
10
README.md
@@ -24,6 +24,7 @@ A wayland native krunner-like runner, made with customizability in mind.
|
||||
|
||||
Anyrun mainly depends various GTK libraries, and rust of course for building the project. Rust you can get with [rustup](https://rustup.rs). The rest are statically linked in the binary.
|
||||
Here are the libraries you need to have to build & run it:
|
||||
|
||||
- `gtk-layer-shell (libgtk-layer-shell)`
|
||||
- `gtk3 (libgtk-3 libgdk-3)`
|
||||
- `pango (libpango-1.0)`
|
||||
@@ -49,10 +50,13 @@ cp target/release/*.so ~/.config/anyrun/plugins # Copy all of the built plugins
|
||||
```
|
||||
|
||||
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: 800,
|
||||
position: Top,
|
||||
hide_icons: false,
|
||||
hide_plugin_info: false,
|
||||
plugins: [
|
||||
"libapplications.so",
|
||||
"libsymbols.so",
|
||||
@@ -62,7 +66,6 @@ Config(
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
## Plugins
|
||||
|
||||
Anyrun requires plugins to function, as they provide the results for input. The list of plugins in this repository is as follows:
|
||||
@@ -94,10 +97,13 @@ 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:
|
||||
|
||||
```ron
|
||||
Config(
|
||||
width: 800, // The width of the window
|
||||
position: Top,
|
||||
hide_icons: false,
|
||||
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.
|
||||
@@ -141,6 +147,7 @@ The custom arguments for anyrun are as follows:
|
||||
The plugin API is intentionally very simple to use. This is all you need for a plugin:
|
||||
|
||||
`Cargo.toml`:
|
||||
|
||||
```toml
|
||||
#[package] omitted
|
||||
[lib]
|
||||
@@ -153,6 +160,7 @@ abi_stable = "0.11.1"
|
||||
```
|
||||
|
||||
`lib.rs`:
|
||||
|
||||
```rs
|
||||
use abi_stable::std_types::{RString, RVec, ROption};
|
||||
use anyrun_plugin::{plugin, PluginInfo, Match, HandleResult};
|
||||
|
@@ -19,6 +19,7 @@ struct Config {
|
||||
plugins: Vec<PathBuf>,
|
||||
position: Position,
|
||||
hide_icons: bool,
|
||||
hide_plugin_info: bool,
|
||||
}
|
||||
|
||||
/// A "view" of plugin's info and matches
|
||||
@@ -250,6 +251,7 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<Option<RuntimeData>
|
||||
.spacing(10)
|
||||
.name(style_names::PLUGIN)
|
||||
.build();
|
||||
if !config.hide_plugin_info {
|
||||
plugin_box.add(&create_info_box(&plugin.info()(), config.hide_icons));
|
||||
plugin_box.add(
|
||||
>k::Separator::builder()
|
||||
@@ -257,6 +259,7 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<Option<RuntimeData>
|
||||
.name(style_names::PLUGIN)
|
||||
.build(),
|
||||
);
|
||||
}
|
||||
let list = gtk::ListBox::builder()
|
||||
.name(style_names::PLUGIN)
|
||||
.hexpand(true)
|
||||
|
13
plugins/applications/README.md
Normal file
13
plugins/applications/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Applications
|
||||
|
||||
## Desktop Actions
|
||||
|
||||
To enable desktop actions support, set `desktop_actions` in the applications plugin config
|
||||
file to `true` like so:
|
||||
|
||||
`<anyrun config directory>/applications.ron`:
|
||||
```ron
|
||||
Config(
|
||||
desktop_actions: true,
|
||||
)
|
||||
```
|
@@ -31,11 +31,15 @@ impl DesktopEntry {
|
||||
let mut line = None;
|
||||
let mut new_sections = Vec::new();
|
||||
|
||||
for section in sections.iter() {
|
||||
for (i, section) in sections.iter().enumerate() {
|
||||
if let Some(line) = line {
|
||||
let mut section = section.to_vec();
|
||||
section.insert(0, line);
|
||||
|
||||
// Only pop the last redundant entry if it isn't the last item
|
||||
if i < sections.len() - 1 {
|
||||
section.pop();
|
||||
}
|
||||
new_sections.push(section);
|
||||
}
|
||||
line = Some(section.last().unwrap_or(&""));
|
||||
|
@@ -1,4 +1,6 @@
|
||||
# User defined symbols
|
||||
# Symbols
|
||||
|
||||
## User defined symbols
|
||||
|
||||
User defined symbols are defined in the `symbols.ron` file inside the anyrun configuration directory. The structure of the file is as follows:
|
||||
```ron
|
||||
|
Reference in New Issue
Block a user