mirror of
https://github.com/lbonn/rofi
synced 2024-11-22 11:53:11 +00:00
[Doc] More small markdown fixes.
This commit is contained in:
parent
b23fc0fff4
commit
586980aeaf
6 changed files with 112 additions and 115 deletions
|
@ -2,35 +2,36 @@
|
|||
|
||||
## Development
|
||||
|
||||
For development no tarball is released. Please follow the [Installation](../INSTALL/) instructions for obtaining and compiling development version.
|
||||
For development no tarball is released. Please follow the
|
||||
[Installation](../INSTALL/) instructions for obtaining and compiling
|
||||
development version.
|
||||
|
||||
## [1.7.5](https://github.com/davatorium/rofi/releases/tag/1.7.5)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.5/rofi-1.7.5.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.5/rofi-1.7.5.tar.xz)
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.5/rofi-1.7.5.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.5/rofi-1.7.5.tar.xz)
|
||||
|
||||
## [1.7.4](https://github.com/davatorium/rofi/releases/tag/1.7.4)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.4/rofi-1.7.4.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.4/rofi-1.7.4.tar.xz)
|
||||
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.4/rofi-1.7.4.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.4/rofi-1.7.4.tar.xz)
|
||||
|
||||
## [1.7.3](https://github.com/davatorium/rofi/releases/tag/1.7.3)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.3/rofi-1.7.3.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.3/rofi-1.7.3.tar.xz)
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.3/rofi-1.7.3.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.3/rofi-1.7.3.tar.xz)
|
||||
|
||||
## [1.7.2](https://github.com/davatorium/rofi/releases/tag/1.7.2)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.2/rofi-1.7.2.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.2/rofi-1.7.2.tar.xz)
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.2/rofi-1.7.2.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.2/rofi-1.7.2.tar.xz)
|
||||
|
||||
## [1.7.1](https://github.com/davatorium/rofi/releases/tag/1.7.1)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.1/rofi-1.7.1.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.1/rofi-1.7.1.tar.xz)
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.1/rofi-1.7.1.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.1/rofi-1.7.1.tar.xz)
|
||||
|
||||
## [1.7.0](https://github.com/davatorium/rofi/releases/tag/1.7.0)
|
||||
|
||||
* [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.0/rofi-1.7.0.tar.gz)
|
||||
* [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.0/rofi-1.7.0.tar.xz)
|
||||
- [tar.gz](https://github.com/davatorium/rofi/releases/download/1.7.0/rofi-1.7.0.tar.gz)
|
||||
- [tar.xz](https://github.com/davatorium/rofi/releases/download/1.7.0/rofi-1.7.0.tar.xz)
|
||||
|
|
|
@ -25,7 +25,8 @@ In the current release, there is a
|
|||
[fullscreen_preview](https://github.com/davatorium/rofi/blob/next/themes/fullscreen-preview.rasi)
|
||||
as an example.
|
||||
|
||||
In this theme we are going to modify the filebrowser view with a preview widget that we can enable.
|
||||
In this theme we are going to modify the filebrowser view with a preview widget
|
||||
that we can enable.
|
||||
|
||||
Lets start with the basic theme.
|
||||
|
||||
|
@ -134,7 +135,6 @@ rofi -theme fullscreen-preview.rasi -show filebrowser
|
|||
We already prepared the place where we are going to add a 2nd widget.
|
||||
Now lets, at the end of the theme, add the extra element in a media block.
|
||||
|
||||
|
||||
```css
|
||||
@media ( enabled: env(PREVIEW, false)) {
|
||||
```
|
||||
|
@ -173,7 +173,6 @@ Now if we run it:
|
|||
REVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser
|
||||
```
|
||||
|
||||
|
||||
It looks like this:
|
||||
|
||||
![Image preview](2.png)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
> This guide is taken from the 1.4.0 release preview posts. The information might
|
||||
> be outdated, but in general should still be correct and a good starting point
|
||||
> for writing a plugin. Links have been updated.
|
||||
> A recent plugin that can be used as example can be found
|
||||
> [here](https://git.sr.ht/~qball/rofi-ntfy).
|
||||
> This guide is taken from the 1.4.0 release preview posts. The information
|
||||
> might be outdated, but in general should still be correct and a good starting
|
||||
> point for writing a plugin. Links have been updated. A recent plugin that can
|
||||
> be used as example can be found [here](https://git.sr.ht/~qball/rofi-ntfy).
|
||||
|
||||
## Build system
|
||||
|
||||
|
@ -20,8 +19,9 @@ This includes the 2 files for the build system and the C template.
|
|||
|
||||
First we are going to update the `configure.ac` file:
|
||||
|
||||
```
|
||||
AC_INIT([rofi-plugin-template], [0.0.1], [https://my-neat-plugin.org//],[],[https://support.my-neat-plugin.org/])
|
||||
```text
|
||||
AC_INIT([rofi-plugin-template], [0.0.1],
|
||||
[https://my-neat-plugin.org//],[],[https://support.my-neat-plugin.org/])
|
||||
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
|
||||
|
@ -69,7 +69,7 @@ We need to make a similar change in the `Makefile.am` file, this is important so
|
|||
each plugin has a unique name. (if they are all called myplugin, it would be
|
||||
hard to install more then one plugin.)
|
||||
|
||||
```
|
||||
```text
|
||||
ACLOCAL_AMFLAGS=-I m4
|
||||
plugindir=@rofi_PLUGIN_INSTALL_DIR@
|
||||
|
||||
|
@ -85,7 +85,7 @@ myplugin_la_LDFLAGS= -module -avoid-version
|
|||
|
||||
So we do a search and replace from `myplugin` to `file_browser`:
|
||||
|
||||
```
|
||||
```text
|
||||
ACLOCAL_AMFLAGS=-I m4
|
||||
plugindir=${libdir}/rofi/
|
||||
|
||||
|
@ -106,32 +106,36 @@ needed.
|
|||
|
||||
Now that we have this setup, it is easy to build:
|
||||
|
||||
* Generate the build system:
|
||||
- Generate the build system:
|
||||
|
||||
```bash
|
||||
autoreconf -i
|
||||
```
|
||||
|
||||
* Create a `build` directory.
|
||||
- Create a `build` directory.
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
* Run `configure`
|
||||
- Run `configure`
|
||||
|
||||
```bash
|
||||
../configure
|
||||
```
|
||||
|
||||
* build
|
||||
- build
|
||||
|
||||
```bash
|
||||
make
|
||||
```
|
||||
* install
|
||||
- install
|
||||
|
||||
```bash
|
||||
make install
|
||||
```
|
||||
|
||||
|
||||
You can now test the plugin by calling:
|
||||
|
||||
```bash
|
||||
|
@ -142,9 +146,8 @@ If we start changing the template, the name to use will change.
|
|||
|
||||
## Edit the C template
|
||||
|
||||
|
||||
The first thing todo is personalize the template. Below I have modified it so it
|
||||
is called file-browser:
|
||||
The first thing todo is personalize the template. Below I have modified it so
|
||||
it is called file-browser:
|
||||
|
||||
```c
|
||||
/**
|
||||
|
@ -290,9 +293,6 @@ If we now rebuild the plugin, we need to run the following command:
|
|||
```bash
|
||||
rofi -show file_browser -modi file_browser
|
||||
```
|
||||
|
||||
|
||||
|
||||
### The mode description
|
||||
|
||||
The mode is defined by the `Mode` structure, every mode in rofi has one of the
|
||||
|
@ -318,11 +318,9 @@ Mode mode =
|
|||
};
|
||||
```
|
||||
|
||||
The ABI_VERSION is defined in **rofi** header file, so that **rofi** can detect what
|
||||
ABI the plugin was compiled against.
|
||||
Not every function needs to be implemented, in the plugin we show the minimum
|
||||
set.
|
||||
|
||||
The ABI_VERSION is defined in **rofi** header file, so that **rofi** can detect
|
||||
what ABI the plugin was compiled against. Not every function needs to be
|
||||
implemented, in the plugin we show the minimum set.
|
||||
|
||||
Lets modify each of the above functions to implement something useful.
|
||||
|
||||
|
@ -334,9 +332,9 @@ view.
|
|||
|
||||
We want to differentiate between 3 different rows:
|
||||
|
||||
* Go one level up
|
||||
* Directory
|
||||
* Regular file
|
||||
- Go one level up
|
||||
- Directory
|
||||
- Regular file
|
||||
|
||||
So we add an enum:
|
||||
|
||||
|
@ -350,11 +348,13 @@ enum FBFileType {
|
|||
|
||||
We need a structure that hold each entry.
|
||||
|
||||
* It should have a **name** we are going to show the user. This will hold an
|
||||
`utf-8` string. (rofi will only display utf-8).
|
||||
* It should hold the **path** to the entry. This will be in the file-systems
|
||||
encoding.
|
||||
* The type it holds.
|
||||
- It should have a **name** we are going to show the user. This will hold an
|
||||
`utf-8` string. (rofi will only display utf-8).
|
||||
|
||||
- It should hold the **path** to the entry. This will be in the file-systems
|
||||
encoding.
|
||||
|
||||
- The type it holds.
|
||||
|
||||
```c
|
||||
typedef struct {
|
||||
|
@ -366,9 +366,9 @@ typedef struct {
|
|||
|
||||
Then in the *private* data we hold all the relevant information.
|
||||
|
||||
* The current directory to show.
|
||||
* Array of all the *FBFile* we want to show.
|
||||
* The length of the array.
|
||||
- The current directory to show.
|
||||
- Array of all the *FBFile* we want to show.
|
||||
- The length of the array.
|
||||
|
||||
```c
|
||||
typedef struct
|
||||
|
@ -406,7 +406,6 @@ set this on the mode. Set the current directory to the users home directory and
|
|||
call `get_file_browser` that will load in the entries. We will discuss this one
|
||||
later.
|
||||
|
||||
|
||||
### Destroying
|
||||
|
||||
On shutdown we want to cleanup, so there is also a destroy function.
|
||||
|
@ -569,8 +568,8 @@ static unsigned int file_browser_mode_get_num_entries ( const Mode *sw )
|
|||
## Filtering the entries
|
||||
|
||||
When filtering we want to filter on the file name, we luckily store this entry
|
||||
in `FBFile::name`.
|
||||
To use **rofi**'s matching algorithm we can use the `helper_token_match` function.
|
||||
in `FBFile::name`. To use **rofi**'s matching algorithm we can use the
|
||||
`helper_token_match` function.
|
||||
|
||||
```c
|
||||
static int file_browser_token_match ( const Mode *sw, GRegex **tokens, unsigned int index )
|
||||
|
@ -595,7 +594,6 @@ rofi -show file_browser -modi file_browser
|
|||
|
||||
![rofi file browser](rofi-file-browser.png)
|
||||
|
||||
|
||||
## Handling selected entries
|
||||
|
||||
This is just an example and can probably be implemented nicer.
|
||||
|
@ -688,8 +686,5 @@ We do not support `delete`, just reload.
|
|||
The `RESET_DIALOG` will clear the input bar and reload the view, `RELOAD_DIALOG`
|
||||
will reload the view and re-filter based on the current text.
|
||||
|
||||
> Note: `rofi_expand_path` will expand `~` and `~me/` into it full absolute path.
|
||||
|
||||
> Note: `helper_execute_command` will spawn command.
|
||||
|
||||
|
||||
> Note: `rofi_expand_path` will expand `~` and `~me/` into it full absolute
|
||||
> path. Note: `helper_execute_command` will spawn command.
|
||||
|
|
|
@ -12,43 +12,46 @@ The location setting determines the place of the window on the monitor.
|
|||
|
||||
The location setting supports the following values:
|
||||
|
||||
* north
|
||||
* northeast
|
||||
* northwest
|
||||
* south
|
||||
* southeast
|
||||
* southwest
|
||||
* east
|
||||
* west
|
||||
* center
|
||||
- north
|
||||
- northeast
|
||||
- northwest
|
||||
- south
|
||||
- southeast
|
||||
- southwest
|
||||
- east
|
||||
- west
|
||||
- center
|
||||
|
||||
This is depicted in the diagram below:
|
||||
|
||||
![location](anchors.svg)
|
||||
|
||||
|
||||
## anchor setting
|
||||
|
||||
The anchor sets what point of the **rofi** window is placed at the specified *location*.
|
||||
The anchor sets what point of the **rofi** window is placed at the specified
|
||||
*location*.
|
||||
|
||||
The *anchor* settings supports the same values as the *location* setting.
|
||||
|
||||
If you want the middle of the **rofi** window to be always located at the center of the monitor set both *location* and
|
||||
*anchor* to `center`.
|
||||
If you want the middle of the **rofi** window to be always located at the
|
||||
center of the monitor set both *location* and *anchor* to `center`.
|
||||
|
||||
If the **rofi** window resizes, its center will stay at the center.
|
||||
If you set the *anchor* to `north` the top of the **rofi** window is at the center of the monitor, and the window will grow
|
||||
down.
|
||||
If the **rofi** window resizes, its center will stay at the center. If you set
|
||||
the *anchor* to `north` the top of the **rofi** window is at the center of the
|
||||
monitor, and the window will grow down.
|
||||
|
||||
If you set the *anchor* and *location* to `south`, **rofi** is located at the bottom center and the window grows up.
|
||||
If you set the *anchor* and *location* to `south`, **rofi** is located at the
|
||||
bottom center and the window grows up.
|
||||
|
||||
> Note that if you set the *anchor* to `south` and the *location* to `north` the **rofi** window will be placed above
|
||||
> the monitor and might not be visible.
|
||||
> Note that if you set the *anchor* to `south` and the *location* to `north`
|
||||
> the **rofi** window will be placed above the monitor and might not be
|
||||
> visible.
|
||||
|
||||
> In another blog post we will explain how the dynamic sizing behaviour of
|
||||
> **rofi** can be tweaked or disabled.
|
||||
|
||||
> In another blog post we will explain how the dynamic sizing behaviour of **rofi** can be tweaked or disabled.
|
||||
|
||||
So the following theme setting will place the top of the **rofi** window in the center of the monitor:
|
||||
So the following theme setting will place the top of the **rofi** window in the
|
||||
center of the monitor:
|
||||
|
||||
```css
|
||||
window {
|
||||
|
@ -57,11 +60,13 @@ window {
|
|||
}
|
||||
```
|
||||
|
||||
As depicted here, RED is the location (center of screen), GREEN is the anchor on **rofi** window (north):
|
||||
As depicted here, RED is the location (center of screen), GREEN is the anchor
|
||||
on **rofi** window (north):
|
||||
|
||||
![positions](example-pos.png)
|
||||
|
||||
> Quick hint, if you want to quickly test out changes to the theme, without editing the file, run **rofi** like:
|
||||
> Quick hint, if you want to quickly test out changes to the theme, without
|
||||
> editing the file, run **rofi** like:
|
||||
|
||||
```bash
|
||||
rofi -show run -theme-str "window { location: center; anchor: north;}"
|
||||
|
|
|
@ -9,7 +9,8 @@ Remember the general widget structure:
|
|||
|
||||
![structure](structure.svg)
|
||||
|
||||
This means if you set every widget to be 30% transparent on a white background: it will look like:
|
||||
This means if you set every widget to be 30% transparent on a white background:
|
||||
it will look like:
|
||||
|
||||
![images](rofi-transp.png)
|
||||
|
||||
|
@ -22,7 +23,6 @@ the end it will be less transparent.
|
|||
rofi -theme-str '@theme "/dev/null" window { background-color: white; }* { padding:5; background-color: rgba(20,20,20,0.5);}' -show run
|
||||
```
|
||||
|
||||
|
||||
This can sometimes be difficult when creating themes with a nice transparent
|
||||
background.
|
||||
The trick to make this work nicely is the following.
|
||||
|
@ -46,7 +46,6 @@ window {
|
|||
Now if you only set the background on widgets you want differently colored, it
|
||||
nicely works out.
|
||||
|
||||
|
||||
## Transparency on the window
|
||||
|
||||
This determines how transparency on the window is handled.
|
||||
|
@ -55,9 +54,9 @@ The option takes a string. There are basically 4 options:
|
|||
|
||||
### No transparency or "real"
|
||||
|
||||
The background of the window is black and fully transparent, and everything is drawn on top of this.
|
||||
This means that if you have a composite manager (ARGB window), you get a fully transparent
|
||||
background, otherwise fully black.
|
||||
The background of the window is black and fully transparent, and everything is
|
||||
drawn on top of this. This means that if you have a composite manager (ARGB
|
||||
window), you get a fully transparent background, otherwise fully black.
|
||||
|
||||
This is the preferred option if you have a composite manager running.
|
||||
|
||||
|
|
|
@ -1,39 +1,37 @@
|
|||
# Welcome to Rofi Documentation
|
||||
|
||||
|
||||
This website holds the web-version of the manpages for rofi and several guides
|
||||
that have been published over the past years.
|
||||
The manpages are grouped on rofi version.
|
||||
|
||||
![rofi](images/rofi.png)
|
||||
|
||||
|
||||
* [Downloads](downloads.md)
|
||||
* [Installation](INSTALL.md)
|
||||
* [Themes](themes/themes.md)
|
||||
* [User scripts (wiki)](https://github.com/davatorium/rofi/wiki/User-scripts)
|
||||
- [Downloads](downloads.md)
|
||||
- [Installation](INSTALL.md)
|
||||
- [Themes](themes/themes.md)
|
||||
- [User scripts (wiki)](https://github.com/davatorium/rofi/wiki/User-scripts)
|
||||
|
||||
## Development version
|
||||
|
||||
* [Rofi manpage](current/rofi.1.markdown)
|
||||
* [Themes](current/rofi-theme.5.markdown)
|
||||
* [Dmenu](current/rofi-dmenu.5.markdown)
|
||||
* [Script](current/rofi-script.5.markdown)
|
||||
* [Debugging](current/rofi-debugging.5.markdown)
|
||||
* [Keys](current/rofi-keys.5.markdown)
|
||||
- [Rofi manpage](current/rofi.1.markdown)
|
||||
- [Themes](current/rofi-theme.5.markdown)
|
||||
- [Dmenu](current/rofi-dmenu.5.markdown)
|
||||
- [Script](current/rofi-script.5.markdown)
|
||||
- [Debugging](current/rofi-debugging.5.markdown)
|
||||
- [Keys](current/rofi-keys.5.markdown)
|
||||
|
||||
## Stable
|
||||
|
||||
* [Rofi manpage](1.7.5/rofi.1.markdown)
|
||||
* [Themes](1.7.5/rofi-theme.5.markdown)
|
||||
* [Dmenu](1.7.5/rofi-dmenu.5.markdown)
|
||||
* [Script](1.7.5/rofi-script.5.markdown)
|
||||
* [Debugging](1.7.5/rofi-debugging.5.markdown)
|
||||
* [Keys](1.7.5/rofi-keys.5.markdown)
|
||||
- [Rofi manpage](1.7.5/rofi.1.markdown)
|
||||
- [Themes](1.7.5/rofi-theme.5.markdown)
|
||||
- [Dmenu](1.7.5/rofi-dmenu.5.markdown)
|
||||
- [Script](1.7.5/rofi-script.5.markdown)
|
||||
- [Debugging](1.7.5/rofi-debugging.5.markdown)
|
||||
- [Keys](1.7.5/rofi-keys.5.markdown)
|
||||
|
||||
## Guides
|
||||
|
||||
* [Transparency](guides/Transparency/theme3-transparency)
|
||||
* [Positioning](guides/Positioning/theme3-positioning)
|
||||
* [Plugins](guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins.md)
|
||||
* [Dynamic Theme](guides/DynamicThemes/dynamic_themes.md)
|
||||
- [Transparency](guides/Transparency/theme3-transparency)
|
||||
- [Positioning](guides/Positioning/theme3-positioning)
|
||||
- [Plugins](guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins.md)
|
||||
- [Dynamic Theme](guides/DynamicThemes/dynamic_themes.md)
|
||||
|
|
Loading…
Reference in a new issue