make rofi only enable rofi-emoji if installed

This commit is contained in:
LordMZTE 2023-11-04 12:00:28 +01:00
parent e076be3c78
commit 421736a147
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -1,13 +1,24 @@
<!
local modi = {
"window",
"drun",
"combi",
}
-- Only enable nheko mode if rofi-nheko is installed.
local have_rofi_nheko = opt.fileExists(
if opt.fileExists(
os.getenv "HOME"
.. "/.local/lib/rofi/librofi_nheko.so"
)
) then
table.insert(modi, "nheko")
end
-- Only enable rofi-emoji if installed.
if opt.fileExists "/usr/lib/rofi/emoji.so" then
table.insert(modi, "emoji")
end
!>
configuration {
/* requires rofi-emoji */
modi: "window,drun,combi,emoji<! if have_rofi_nheko then !>,nheko<! end !>";
modi: "<% table.concat(modi, ",") %>";
font: "<% opt.font %> 12";
show-icons: true;
icon-theme: "<% opt.icon_theme %>";