Closed Flrian closed 1 year ago
I think this is a matter of checking the flatpack desktop entry directory. I don't use flatpack myself, so will need some help. Can you please check: 1) the value of $XDG_DATA_DIRS variable on your system. 2) the contents of /var/lib/flatpak/exports/share/applications directory?
On Fri, 25 Aug 2023, 12:35 Flrian, @.***> wrote:
If its not too complicated, would it be possible to include apps installed via flatpak in the startmenu widget?
— Reply to this email directly, view it on GitHub https://github.com/LBCrion/sfwbar/issues/109, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHPFFBH77NKYTLR2M47COTXXBWWZANCNFSM6AAAAAA36H3IK4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
❯ printenv XDG_DATA_DIRS
/home/florian/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
Let me know if you need anything else!
Hi @Flrian, I updated the startmenu.widget to respect the XDG_DATA_DIRS variable. Can you try the latest git version to see if it correctly handles the flatpak applications for you now?
It does not. I assume its because they are symlinks and get linked there from the application specific folder (e.g. ~/.local/share/flatpak/app/com.github.wwmm.easyeffects/current/active/export/share/applications/com.github.wwmm.easyeffects.desktop
)?
Also it would probably be a good idea to add XDG_DATA_HOME
and ~/.local/share/
if that is not set, I have a bunch of .desktop files there that don't get shown either atm.
Symlinks shouldn't prevent this from working. Can you please check if sfwbar is picking up the updated widget from git? You can by running sfwbar -d -g startmenu.widget
and then check if the widget file it loads contains XDG_DATA_DIRS. It should be easy enough to get XDG_DATA_HOME working as well once we get this one sorted.
Should be using the updated one.
That's odd. Can you try running the python script on it's own to see if there are any issues in it?
❯ python test.txt
MenuClear('Menugen_Applications')
MenuClear('Menugen_System')
MenuClear('Menugen_Graphics')
MenuClear('Menugen_Accessories')
MenuClear('Menugen_Office')
MenuClear('Menugen_Internet')
MenuClear('Menugen_Other')
Menu('Menugen_Accessories') { Item('Files%org.gnome.Nautilus',Exec 'nautilus') }
Menu('Menugen_Accessories') { Item('VSCode%vscode',Exec '/usr/bin/vscode') }
Menu('Menugen_Applications') { SubMenu('Accessories%applications-accessories','Menugen_Accessories') }
Menu('Menugen_Applications') { SubMenu('Graphics%applications-graphics','Menugen_Graphics') }
Menu('Menugen_Applications') { SubMenu('Internet%applications-internet','Menugen_Internet') }
Menu('Menugen_Applications') { SubMenu('Office%applications-office','Menugen_Office') }
Menu('Menugen_Applications') { SubMenu('Other%applications-other','Menugen_Other') }
Menu('Menugen_Applications') { SubMenu('System%applications-system','Menugen_System') }
Menu('Menugen_Graphics') { Item('FontForge%org.fontforge.FontForge',Exec 'fontforge') }
Menu('Menugen_Graphics') { Item('MuPDF%new-mupdf-icon',Exec 'mupdf') }
Menu('Menugen_Internet') { Item('Steam%steam',Exec 'steam') }
Menu('Menugen_Office') { Item('Zathura%org.pwmt.zathura',Exec 'zathura') }
Menu('Menugen_Other') { Item('Browse C: Drive%folder-wine',Exec 'xdg-open') }
Menu('Menugen_Other') { Item('Configure Wine%wine-winecfg',Exec 'winecfg') }
Menu('Menugen_Other') { Item('Notepad%wine-notepad',Exec 'notepad') }
Menu('Menugen_Other') { Item('Uninstall Wine Software%wine-uninstaller',Exec 'wine') }
Menu('Menugen_System') { Item('Avahi Zeroconf Browser%network-wired',Exec '/usr/bin/avahi-discover') }
Menu('Menugen_System') { Item('Foot Client%foot',Exec 'footclient') }
Menu('Menugen_System') { Item('Foot Server%foot',Exec 'foot') }
Menu('Menugen_System') { Item('Foot%foot',Exec 'foot') }
Menu('Menugen_System') { Item('Htop%htop',Exec 'htop') }
Menu('Menugen_System') { Item('Manage Printing%cups',Exec '/usr/bin/xdg-open') }
Menu('Menugen_System') { Item('nvtop%nvtop',Exec 'nvtop') }
Just in case its something to do with the flatpak desktop files themselves, here is for example the Discord one:
[Desktop Entry]
Name=Discord
StartupWMClass=discord
Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
GenericName=Internet Messenger
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=discord com.discordapp.Discord
Icon=com.discordapp.Discord
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin
X-Flatpak-Tags=proprietary;
X-Flatpak=com.discordapp.Discord
Ok, I see the issue. flatpack uses '=' in the Exec parameters and this has been messing with tag parsing. It should now be fixed in git. Would you mind giving it another try?
I do see them now! But clicking on a flatpak entry doesn't open the application.
sfwbar -d
with startmenu.widget
12:09:12.75 image: com.discordapp.Discord @ 14 x 16
12:09:12.75 image: com.discordapp.Discord @ 14 x 16
12:09:13.20 expr: ""/usr/bin/flatpak"" = "/usr/bin/flatpak" (vstate: 0)
12:09:13.20 action: Exec '(null)', '/usr/bin/flatpak', widget=(nil), win=14 from '(null)', '"/usr/bin/flatpak"'
12:09:13.20 module: checking action `exec`
12:09:13.20 module: calling action `exec`
vs custom menu with the exec line from the desktop file as entry
12:16:13.59 expr: ""/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=discord com.discordapp.Discord"" = "/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=discord com.discordapp.Discord" (vstate: 0)
12:16:13.59 action: Exec '(null)', '/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=discord com.discordapp.Discord', widget=0x5635905a1a00, win=14 from '(null)', '"/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=discord com.discordapp.Discord"'
12:16:13.59 module: checking action `exec`
12:16:13.59 module: calling action `exec`
12:16:14.32 app_id: 'discord', title ''
This should now be fixed with proper Exec command line parsing. I also added handling of XDG_CONFIG_HOME to tidy things up. Hopefully the current git should work.
It does work great, thank you so much for taking the time and implementing this!
If its not too complicated, would it be possible to include apps installed via flatpak in the startmenu widget?