1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[Doc] More small markdown fixes.

This commit is contained in:
Dave Davenport 2023-03-27 12:40:59 +02:00
parent b23fc0fff4
commit 586980aeaf
6 changed files with 112 additions and 115 deletions

View file

@ -2,35 +2,36 @@
## Development ## 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) ## [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.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.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) ## [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.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.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) ## [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.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.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) ## [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.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.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) ## [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.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.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) ## [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.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.xz](https://github.com/davatorium/rofi/releases/download/1.7.0/rofi-1.7.0.tar.xz)

View file

@ -25,7 +25,8 @@ In the current release, there is a
[fullscreen_preview](https://github.com/davatorium/rofi/blob/next/themes/fullscreen-preview.rasi) [fullscreen_preview](https://github.com/davatorium/rofi/blob/next/themes/fullscreen-preview.rasi)
as an example. 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. 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. 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. Now lets, at the end of the theme, add the extra element in a media block.
```css ```css
@media ( enabled: env(PREVIEW, false)) { @media ( enabled: env(PREVIEW, false)) {
``` ```
@ -173,7 +173,6 @@ Now if we run it:
REVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser REVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser
``` ```
It looks like this: It looks like this:
![Image preview](2.png) ![Image preview](2.png)

View file

@ -1,8 +1,7 @@
> This guide is taken from the 1.4.0 release preview posts. The information might > This guide is taken from the 1.4.0 release preview posts. The information
> be outdated, but in general should still be correct and a good starting point > might be outdated, but in general should still be correct and a good starting
> for writing a plugin. Links have been updated. > point for writing a plugin. Links have been updated. A recent plugin that can
> A recent plugin that can be used as example can be found > be used as example can be found [here](https://git.sr.ht/~qball/rofi-ntfy).
> [here](https://git.sr.ht/~qball/rofi-ntfy).
## Build system ## 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: First we are going to update the `configure.ac` file:
``` ```text
AC_INIT([rofi-plugin-template], [0.0.1], [https://my-neat-plugin.org//],[],[https://support.my-neat-plugin.org/]) AC_INIT([rofi-plugin-template], [0.0.1],
[https://my-neat-plugin.org//],[],[https://support.my-neat-plugin.org/])
AC_CONFIG_HEADER([config.h]) 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 each plugin has a unique name. (if they are all called myplugin, it would be
hard to install more then one plugin.) hard to install more then one plugin.)
``` ```text
ACLOCAL_AMFLAGS=-I m4 ACLOCAL_AMFLAGS=-I m4
plugindir=@rofi_PLUGIN_INSTALL_DIR@ 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`: So we do a search and replace from `myplugin` to `file_browser`:
``` ```text
ACLOCAL_AMFLAGS=-I m4 ACLOCAL_AMFLAGS=-I m4
plugindir=${libdir}/rofi/ plugindir=${libdir}/rofi/
@ -106,32 +106,36 @@ needed.
Now that we have this setup, it is easy to build: Now that we have this setup, it is easy to build:
* Generate the build system: - Generate the build system:
```bash ```bash
autoreconf -i autoreconf -i
``` ```
* Create a `build` directory. - Create a `build` directory.
```bash ```bash
mkdir build mkdir build
cd build cd build
``` ```
* Run `configure` - Run `configure`
```bash ```bash
../configure ../configure
``` ```
* build - build
```bash ```bash
make make
``` ```
* install - install
```bash ```bash
make install make install
``` ```
You can now test the plugin by calling: You can now test the plugin by calling:
```bash ```bash
@ -142,9 +146,8 @@ If we start changing the template, the name to use will change.
## Edit the C template ## Edit the C template
The first thing todo is personalize the template. Below I have modified it so
The first thing todo is personalize the template. Below I have modified it so it it is called file-browser:
is called file-browser:
```c ```c
/** /**
@ -290,9 +293,6 @@ If we now rebuild the plugin, we need to run the following command:
```bash ```bash
rofi -show file_browser -modi file_browser rofi -show file_browser -modi file_browser
``` ```
### The mode description ### The mode description
The mode is defined by the `Mode` structure, every mode in rofi has one of the 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 The ABI_VERSION is defined in **rofi** header file, so that **rofi** can detect
ABI the plugin was compiled against. what ABI the plugin was compiled against. Not every function needs to be
Not every function needs to be implemented, in the plugin we show the minimum implemented, in the plugin we show the minimum set.
set.
Lets modify each of the above functions to implement something useful. Lets modify each of the above functions to implement something useful.
@ -334,9 +332,9 @@ view.
We want to differentiate between 3 different rows: We want to differentiate between 3 different rows:
* Go one level up - Go one level up
* Directory - Directory
* Regular file - Regular file
So we add an enum: So we add an enum:
@ -350,11 +348,13 @@ enum FBFileType {
We need a structure that hold each entry. We need a structure that hold each entry.
* It should have a **name** we are going to show the user. This will hold an - 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). `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. - It should hold the **path** to the entry. This will be in the file-systems
* The type it holds. encoding.
- The type it holds.
```c ```c
typedef struct { typedef struct {
@ -366,9 +366,9 @@ typedef struct {
Then in the *private* data we hold all the relevant information. Then in the *private* data we hold all the relevant information.
* The current directory to show. - The current directory to show.
* Array of all the *FBFile* we want to show. - Array of all the *FBFile* we want to show.
* The length of the array. - The length of the array.
```c ```c
typedef struct 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 call `get_file_browser` that will load in the entries. We will discuss this one
later. later.
### Destroying ### Destroying
On shutdown we want to cleanup, so there is also a destroy function. 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 ## Filtering the entries
When filtering we want to filter on the file name, we luckily store this entry When filtering we want to filter on the file name, we luckily store this entry
in `FBFile::name`. in `FBFile::name`. To use **rofi**'s matching algorithm we can use the
To use **rofi**'s matching algorithm we can use the `helper_token_match` function. `helper_token_match` function.
```c ```c
static int file_browser_token_match ( const Mode *sw, GRegex **tokens, unsigned int index ) 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) ![rofi file browser](rofi-file-browser.png)
## Handling selected entries ## Handling selected entries
This is just an example and can probably be implemented nicer. 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` 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. 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: `rofi_expand_path` will expand `~` and `~me/` into it full absolute
> path. Note: `helper_execute_command` will spawn command.
> Note: `helper_execute_command` will spawn command.

View file

@ -12,43 +12,46 @@ The location setting determines the place of the window on the monitor.
The location setting supports the following values: The location setting supports the following values:
* north - north
* northeast - northeast
* northwest - northwest
* south - south
* southeast - southeast
* southwest - southwest
* east - east
* west - west
* center - center
This is depicted in the diagram below: This is depicted in the diagram below:
![location](anchors.svg) ![location](anchors.svg)
## anchor setting ## 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. 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 If you want the middle of the **rofi** window to be always located at the
*anchor* to `center`. center of the monitor set both *location* and *anchor* to `center`.
If the **rofi** window resizes, its center will stay at the center. If the **rofi** window resizes, its center will stay at the center. If you set
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 the *anchor* to `north` the top of the **rofi** window is at the center of the
down. 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 > Note that if you set the *anchor* to `south` and the *location* to `north`
> the monitor and might not be visible. > 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 ```css
window { 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) ![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 ```bash
rofi -show run -theme-str "window { location: center; anchor: north;}" rofi -show run -theme-str "window { location: center; anchor: north;}"

View file

@ -9,7 +9,8 @@ Remember the general widget structure:
![structure](structure.svg) ![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) ![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 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 This can sometimes be difficult when creating themes with a nice transparent
background. background.
The trick to make this work nicely is the following. 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 Now if you only set the background on widgets you want differently colored, it
nicely works out. nicely works out.
## Transparency on the window ## Transparency on the window
This determines how transparency on the window is handled. 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" ### No transparency or "real"
The background of the window is black and fully transparent, and everything is drawn on top of this. The background of the window is black and fully transparent, and everything is
This means that if you have a composite manager (ARGB window), you get a fully transparent drawn on top of this. This means that if you have a composite manager (ARGB
background, otherwise fully black. window), you get a fully transparent background, otherwise fully black.
This is the preferred option if you have a composite manager running. This is the preferred option if you have a composite manager running.

View file

@ -1,39 +1,37 @@
# Welcome to Rofi Documentation # Welcome to Rofi Documentation
This website holds the web-version of the manpages for rofi and several guides This website holds the web-version of the manpages for rofi and several guides
that have been published over the past years. that have been published over the past years.
The manpages are grouped on rofi version. The manpages are grouped on rofi version.
![rofi](images/rofi.png) ![rofi](images/rofi.png)
- [Downloads](downloads.md)
* [Downloads](downloads.md) - [Installation](INSTALL.md)
* [Installation](INSTALL.md) - [Themes](themes/themes.md)
* [Themes](themes/themes.md) - [User scripts (wiki)](https://github.com/davatorium/rofi/wiki/User-scripts)
* [User scripts (wiki)](https://github.com/davatorium/rofi/wiki/User-scripts)
## Development version ## Development version
* [Rofi manpage](current/rofi.1.markdown) - [Rofi manpage](current/rofi.1.markdown)
* [Themes](current/rofi-theme.5.markdown) - [Themes](current/rofi-theme.5.markdown)
* [Dmenu](current/rofi-dmenu.5.markdown) - [Dmenu](current/rofi-dmenu.5.markdown)
* [Script](current/rofi-script.5.markdown) - [Script](current/rofi-script.5.markdown)
* [Debugging](current/rofi-debugging.5.markdown) - [Debugging](current/rofi-debugging.5.markdown)
* [Keys](current/rofi-keys.5.markdown) - [Keys](current/rofi-keys.5.markdown)
## Stable ## Stable
* [Rofi manpage](1.7.5/rofi.1.markdown) - [Rofi manpage](1.7.5/rofi.1.markdown)
* [Themes](1.7.5/rofi-theme.5.markdown) - [Themes](1.7.5/rofi-theme.5.markdown)
* [Dmenu](1.7.5/rofi-dmenu.5.markdown) - [Dmenu](1.7.5/rofi-dmenu.5.markdown)
* [Script](1.7.5/rofi-script.5.markdown) - [Script](1.7.5/rofi-script.5.markdown)
* [Debugging](1.7.5/rofi-debugging.5.markdown) - [Debugging](1.7.5/rofi-debugging.5.markdown)
* [Keys](1.7.5/rofi-keys.5.markdown) - [Keys](1.7.5/rofi-keys.5.markdown)
## Guides ## Guides
* [Transparency](guides/Transparency/theme3-transparency) - [Transparency](guides/Transparency/theme3-transparency)
* [Positioning](guides/Positioning/theme3-positioning) - [Positioning](guides/Positioning/theme3-positioning)
* [Plugins](guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins.md) - [Plugins](guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins.md)
* [Dynamic Theme](guides/DynamicThemes/dynamic_themes.md) - [Dynamic Theme](guides/DynamicThemes/dynamic_themes.md)