# Application launcher

An application launcher may be used to easily start applications in Wayfire.

## Tofi

For a fast and lightweight application launcher it's recommended to use `tofi` which starts in a few miliseconds if configured correctly. To install it:

```
# xbps-install -Sy tofi
```

Tofi can be configured by editing `.config/tofi/config`.

```
cp -r {config-files-repo}/tofi .config/
```

To launch tofi through a keybind it has to be bound in `.config/wayfire.ini`.

```
[command]
binding_launcher = <super> KEY_S
command_launcher = tofi-drun | xargs /bin/bash -c -- & exit
```

## Wofi

Although the `wofi` package is no longer maintained and is generally less optimised compared to `tofi` it does have some important features that `tofi` does not have. Such as, a better positioning protocol. 

To install the `wofi` package.

```
# xbps-install -Sy wofi
```

Wofi may be configured by editing `.config/wofi/config`.

```
$ cp -r {config-files-repo}/wofi .config/
```

Wofi may be launched with a keybind, thereby edit `.config/wayfire.ini`.

```
[command]
binding_launcher = <super> KEY_S
command_launcher = wofi --show drun
```

## Wlogout

Wlogout may be used as a specific launcher for power management options. Such as, reboot, suspend and to power off the system.

To install the `wlogout` package.

```
# xbps-install -Sy wlogout
```

Wlogout can be configured by editing `.config/wlogout/layout`.

```
$ cp -r {config-files-repo}/wlogout .config/
# cp {config-files-repo}/extra/wlogout-icons/* /usr/share/wlogout/icons/
```

Wlogout can be launched with a keybind, thereby edit `.config/wayfire.ini`.

```
[command]
binding_wlogout = <super> KEY_P
command_wlogout = wlogout
```

Wlogout needs permission to shutdown the system. This permission can be given by creating `/etc/polkit-1/rules.d/00-power-management.rules` and inserting.

```
polkit.addRule(function(action, subject) 
{
	if (action.id == "org.freedesktop.policykit.exec" && action.lookup("program") == "/bin/shutdown" && subject.isInGroup("wheel"))
		return polkit.Result.YES;
});

polkit.addRule(function(action, subject)
{
	if (action.id == "org.freedesktop.policykit.exec" && action.lookup("program") == "/bin/zzz" && subject.isInGroup("wheel"))
		return polkit.Result.YES;
});
```

or

```
# cp {config-files-repo}/polkit/00-power-management.rules /etc/polkit-1/rules.d/
```
