From 1229928c98987f85577e023a6f377a126656d351 Mon Sep 17 00:00:00 2001 From: q3aql Date: Sun, 18 May 2025 14:50:44 +0200 Subject: [PATCH] Add flatpak support for wofi_drun --- .config/sway/wofi/wofi_drun | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.config/sway/wofi/wofi_drun b/.config/sway/wofi/wofi_drun index 91f9bb8..aac9e9b 100755 --- a/.config/sway/wofi/wofi_drun +++ b/.config/sway/wofi/wofi_drun @@ -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