# adapted from https://github.com/wez/wezterm/blob/main/assets/flatpak/org.wezfurlong.wezterm.json#L34

abinfo "Installing desktop files ..."
install -Dvm644 "$SRCDIR"/assets/icon/terminal.png "$PKGDIR"/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
install -Dvm644 "$SRCDIR"/assets/wezterm.desktop "$PKGDIR"/usr/share/applications/org.wezfurlong.wezterm.desktop
install -Dvm644 "$SRCDIR"/assets/wezterm.appdata.xml "$PKGDIR"/usr/share/metainfo/org.wezfurlong.wezterm.appdata.xml
install -Dvm644 "$SRCDIR"/assets/wezterm-nautilus.py "$PKGDIR"/usr/share/nautilus-python/extensions/wezterm-nautilus.py
install -Dvm755 "$SRCDIR"/assets/open-wezterm-here "$PKGDIR"/usr/bin/open-wezterm-here

abinfo "Installing shell completions and integrations ..."
install -Dvm644 "$SRCDIR"/assets/shell-integration/* -t "$PKGDIR"/etc/profile.d/
install -Dvm644 "$SRCDIR"/assets/shell-completion/bash "$PKGDIR"/usr/share/bash-completion/completions/wezterm
install -Dvm644 "$SRCDIR"/assets/shell-completion/fish "$PKGDIR"/usr/share/fish/vendor_completions.d/wezterm.fish
install -Dvm644 "$SRCDIR"/assets/shell-completion/zsh "$PKGDIR"/usr/share/zsh/site-functions/_wezterm

abinfo "Installing WezTerm terminfo ..."
install -dvm755 "$PKGDIR"/usr/share/terminfo/
tic -x -o "$PKGDIR"/usr/share/terminfo/ "$SRCDIR"/termwiz/data/wezterm.terminfo
