Add flatpak support for wofi_drun

This commit is contained in:
q3aql 2025-05-18 14:50:44 +02:00
parent 48ece24a4d
commit 1229928c98

View File

@ -12,6 +12,8 @@ load_theme_path="${HOME}/.wofi"
load_desktop_files="${HOME}/.wofi/desktop"
desktop_files="/usr/share/applications"
desktop_files_home="${HOME}/.local/share/applications"
desktop_flatpak="/var/lib/flatpak/exports/share/applications"
desktop_flatpak_home="${HOME}/.local/share/flatpak/exports/share/applications"
function generate_spaces() {
num_spaces=${1}
@ -29,6 +31,12 @@ function list_desktop_files() {
if [ -d "${desktop_files_home}" ] ; then
ls -1 "${desktop_files_home}/" | grep ".desktop"
fi
if [ -d "${desktop_flatpak}" ] ; then
ls -1 "${desktop_flatpak}/" | grep ".desktop"
fi
if [ -d "${desktop_flatpak_home}" ] ; then
ls -1 "${desktop_flatpak_home}/" | grep ".desktop"
fi
}
function list_desktop_icons() {
@ -72,6 +80,18 @@ function create_list_files() {
echo "${desktop_files_home}/${current_file}" > "${load_desktop_files}/${name_show}"
fi
fi
if [ -f "${desktop_flatpak}/${current_file}" ] ; then
name_show=$(cat "${desktop_flatpak}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
if [ ! -z "${name_show}" ] ; then
echo "${desktop_flatpak}/${current_file}" > "${load_desktop_files}/${name_show}"
fi
fi
if [ -f "${desktop_flatpak_home}/${current_file}" ] ; then
name_show=$(cat "${desktop_flatpak_home}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
if [ ! -z "${name_show}" ] ; then
echo "${desktop_flatpak_home}/${current_file}" > "${load_desktop_files}/${name_show}"
fi
fi
done
echo "1" > ${HOME}/.dmenu/read_list
fi