Skip to content

Commit

Permalink
Updated documentation with apparmor issues and workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
giomatfois62 committed May 25, 2024
1 parent 5d69c64 commit 46473d4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions doc/rofi-thumbnails.5.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,38 @@ It is possible to use a custom command to generate thumbnails for generic entry
rofi ... -preview-cmd 'path/to/script_or_cmd "{input}" "{output}" "{size}"'
```
rofi will call the script or command substituting `{input}` with the input entry icon name (the string after `\0icon\x1fthumbnail://`), `{output}` with the output filename of the thumbnail and `{size}` with the requested thumbnail size. The script or command is responsible of producing a thumbnail image (if possible respecting the requested size) and saving it in the given `{output}` filename.

### Issues with AppArmor
In Linux distributions using AppArmor (such as Ubuntu and Debian), the default rules shipped can cause issues with thumbnails generation. If that is the case, AppArmor can be disabled by issuing the following commands
```
sudo systemctl stop apparmor
sudo systemctl disable apparmor
```
In alternative, the following apparmor profile con be placed in a file named /etc/apparmor.d/usr.bin.rofi
```
#vim:syntax=apparmor
# AppArmor policy for rofi
#include <tunables/global>
/usr/bin/rofi {
#include <abstractions/base>
# TCP/UDP network access for NFS
network inet stream,
network inet6 stream,
network inet dgram,
network inet6 dgram,
/usr/bin/rofi mr,
@{HOME}/ r,
@{HOME}/** rw,
owner @{HOME}/.cache/thumbnails/** rw,
}
```
then run
```
apparmor_parser -r /etc/apparmor.d/usr.bin.rofi
```
to reload the rule. This assumes that rofi binary is in /usr/bin, that is the case of a standard package installation.

0 comments on commit 46473d4

Please sign in to comment.