1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-10-27 05:23:18 -04:00

[Doc] Update rofi theme manpage with some examples and fixes.

This commit is contained in:
Dave Davenport 2021-07-02 18:01:46 +02:00
parent 0c304524fb
commit f5aa88acfd
2 changed files with 124 additions and 28 deletions

View file

@ -1257,9 +1257,9 @@ The current layout of \fBrofi\fP is structured as follows:
| | mainbox {BOX:vertical} | | | | mainbox {BOX:vertical} | |
| | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | |
| | | inputbar {BOX:horizontal} | | | | | | inputbar {BOX:horizontal} | | |
| | | |\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-| | | | | | | |\-\-\-\-\-\-\-\-\-| |\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-| |\-\-\-| |\-\-\-| |\-\-\-| | | |
| | | | prompt | | entry | |ci | | | | | | | | prompt | |:| | entry |#fr| | / | |#ns| |ci | | | |
| | | |\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-| | | | | | | |\-\-\-\-\-\-\-\-\-| |\_| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-| |\-\-\-| |\-\-\-| |\-\-\-| | | |
| | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | |
| | | | | | | |
| | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | |
@ -1292,6 +1292,8 @@ The current layout of \fBrofi\fP is structured as follows:
.PP .PP
ci is the case\-indicator ci is the case\-indicator
fr is the num\-filtered\-rows
ns is the num\-rows
.RE .RE
.SS Error message structure .SS Error message structure
@ -1363,23 +1365,70 @@ Any widget name starting with \fB\fCtextbox\fR is a textbox widget, others are b
.PP .PP
There are several special widgets that can be used by prefixing the name of the widget: There are several special widgets that can be used by prefixing the name of the widget:
.SS textbox
.PP
This is a read\-only textbox widget. The displayed string can be set with \fB\fCcontent\fR\&.
.PP
Example:
.PP
.RS .RS
.IP \(bu 2
\fB\fCtextbox\fR: .nf
This is a textbox widget. The displayed string can be set with \fB\fCstr\fR\&. textbox\-custom {
.IP \(bu 2 expand: false;
\fB\fCicon\fR: content: "My Message";
}
.fi
.RE
.SS Icon
.PP
This is an icon widget. The displayed icon can be set with \fB\fCfilename\fR and size with \fB\fCsize\fR\&. This is an icon widget. The displayed icon can be set with \fB\fCfilename\fR and size with \fB\fCsize\fR\&.
If the property \fB\fCaction\fR is set, it acts as a button. If the property \fB\fCaction\fR is set, it acts as a button.
\fB\fCaction\fR can be set to a keybinding name and completes that action. (see rofi \-show keys for a list). \fB\fCaction\fR can be set to a keybinding name and completes that action. (see rofi \-show keys for a list).
.IP \(bu 2
\fB\fCbutton\fR: .PP
Example:
.PP
.RS
.nf
icon\-paste {
expand: false;
filename: "gtk\-paste";
size: 24;
vertical\-align: 0.5;
action: "kb\-primary\-paste";
}
.fi
.RE
.SS button
.PP
This is a textbox widget that can have a 'clickable' action. This is a textbox widget that can have a 'clickable' action.
The \fB\fCaction\fR can be set to: The \fB\fCaction\fR can be set to:
\fB\fCkeybinding\fR: accepts a keybinging name and completes that action. (see rofi \-show keys for a list). \fB\fCkeybinding\fR: accepts a keybinging name and completes that action. (see rofi \-show keys for a list).
.PP
.RS
.nf
button\-paste {
expand: false;
content: "My Clickable Message";
vertical\-align: 0.5;
action: "kb\-primary\-paste";
}
.fi
.RE .RE
.SS Children
.PP .PP
To specify children, set the \fB\fCchildren\fR To specify children, set the \fB\fCchildren\fR
property (this always happens on the \fB\fCbox\fR child, see example below): property (this always happens on the \fB\fCbox\fR child, see example below):
@ -1388,7 +1437,9 @@ property (this always happens on the \fB\fCbox\fR child, see example below):
.RS .RS
.nf .nf
inputbar {
children: [prompt,entry,overlay,case\-indicator]; children: [prompt,entry,overlay,case\-indicator];
}
.fi .fi
.RE .RE
@ -1576,7 +1627,7 @@ To test minor changes, part of the theme can be passed on the command line, for
.RS .RS
.nf .nf
rofi \-theme\-str '#window { fullscreen:true;}' \-show run rofi \-theme\-str 'window { fullscreen:true;}' \-show run
.fi .fi
.RE .RE

View file

@ -771,9 +771,9 @@ The current layout of **rofi** is structured as follows:
| | mainbox {BOX:vertical} | | | | mainbox {BOX:vertical} | |
| | |---------------------------------------------------------------------------| | | | | |---------------------------------------------------------------------------| | |
| | | inputbar {BOX:horizontal} | | | | | | inputbar {BOX:horizontal} | | |
| | | |---------| |-----------------------------------------------------| |---| | | | | | | |---------| |-| |---------------------------------|---| |---| |---| |---| | | |
| | | | prompt | | entry | |ci | | | | | | | | prompt | |:| | entry |#fr| | / | |#ns| |ci | | | |
| | | |---------| |-----------------------------------------------------| |---| | | | | | | |---------| |_| |---------------------------------|---| |---| |---| |---| | | |
| | |---------------------------------------------------------------------------| | | | | |---------------------------------------------------------------------------| | |
| | | | | | | |
| | |---------------------------------------------------------------------------| | | | | |---------------------------------------------------------------------------| | |
@ -799,6 +799,8 @@ The current layout of **rofi** is structured as follows:
``` ```
> ci is the case-indicator > ci is the case-indicator
> fr is the num-filtered-rows
> ns is the num-rows
### Error message structure ### Error message structure
@ -844,22 +846,65 @@ Any widget name starting with `textbox` is a textbox widget, others are box widg
There are several special widgets that can be used by prefixing the name of the widget: There are several special widgets that can be used by prefixing the name of the widget:
* `textbox`: #### textbox
This is a textbox widget. The displayed string can be set with `str`.
* `icon`: This is a read-only textbox widget. The displayed string can be set with `content`.
Example:
```css
textbox-custom {
expand: false;
content: "My Message";
}
```
#### Icon
This is an icon widget. The displayed icon can be set with `filename` and size with `size`. This is an icon widget. The displayed icon can be set with `filename` and size with `size`.
If the property `action` is set, it acts as a button. If the property `action` is set, it acts as a button.
`action` can be set to a keybinding name and completes that action. (see rofi -show keys for a list). `action` can be set to a keybinding name and completes that action. (see rofi -show keys for a list).
* `button`:
Example:
```css
icon-paste {
expand: false;
filename: "gtk-paste";
size: 24;
vertical-align: 0.5;
action: "kb-primary-paste";
}
```
#### button
This is a textbox widget that can have a 'clickable' action. This is a textbox widget that can have a 'clickable' action.
The `action` can be set to: The `action` can be set to:
`keybinding`: accepts a keybinging name and completes that action. (see rofi -show keys for a list). `keybinding`: accepts a keybinging name and completes that action. (see rofi -show keys for a list).
```css
button-paste {
expand: false;
content: "My Clickable Message";
vertical-align: 0.5;
action: "kb-primary-paste";
}
```
#### Children
To specify children, set the `children` To specify children, set the `children`
property (this always happens on the `box` child, see example below): property (this always happens on the `box` child, see example below):
``` ```css
inputbar {
children: [prompt,entry,overlay,case-indicator]; children: [prompt,entry,overlay,case-indicator];
}
``` ```
The theme needs to be updated to match the hierarchy specified. The theme needs to be updated to match the hierarchy specified.
@ -997,7 +1042,7 @@ G_MESSAGES_DEBUG=Theme rofi -show run
To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen: To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:
``` ```
rofi -theme-str '#window { fullscreen:true;}' -show run rofi -theme-str 'window { fullscreen:true;}' -show run
``` ```
To print the current theme, run: To print the current theme, run: