! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Add support for setting environment variables in Alt+F2. Such as LC_ALL=C Thunar
Status:
RESOLVED: MOVED
Product:
Xfce4-appfinder
Component:
General

Comments

Description lockywolf 2018-08-19 09:36:57 CEST
Hello, everyone.

Often I need to run a GUI application specifying some env variables, because some apps require them to work correctly.
My particular example being:

LC_ALL=zh_CN.utf8 wine /home/lockywolf/.wine/drive_c/Program\ Files/Tencent/WeChat/WeChat.exe

However, xfce4-apprunner doesn't support such commands.

If someone could help with it, would be great.
Comment 1 Andre Miranda editbugs 2018-08-22 04:53:55 CEST
If you don't mind me asking, why not a desktop file in ~/.local/share/applications, e.g. "WeChat (Chinese)"? It's more friendly, you may find it easier in expanded mode.
Comment 2 lockywolf 2018-08-22 05:11:29 CEST
Well, xfce4-appfinder doesn't support such desktop files either.

The work-aroud is to use 

env VAR=t wine WeChat.exe

But still...
Comment 3 Andre Miranda editbugs 2018-08-22 05:24:10 CEST
Created attachment 7898 
appfinder local desktop files

Are you sure? See the attached picture.
Comment 4 lockywolf 2018-08-22 05:33:53 CEST
There are no environment variables set in this desktop file.
Comment 5 Andre Miranda editbugs 2018-08-22 05:40:58 CEST
I meant to reply your comment "xfce4-appfinder doesn't support such desktop files either.".
As for environment variables, it seems the desktop entry specification doesn't support them, you would need to workaround with "env" as you mentioned.

I'll think about how to implement this, but don't hold your breath.
Comment 6 lockywolf 2018-08-22 06:12:39 CEST
Oh, I am sorry!

By 'such', I meant .desktop files having a command string like 'VAR=1 command %F'.
I should have been more specific.

Thank you for having a look at it.
Comment 7 Andre Miranda editbugs 2018-11-24 22:22:43 CET
Created attachment 8126 
allow_envv_launcher.patch

I finally took the time to tackle this, but I'm not confident this patch is ready to be committed, perhaps it leaks or is vulnerable to misuse.
Comment 8 lockywolf 2018-12-04 04:18:40 CET
I'll try to test it as soon as possible.
Comment 9 lockywolf 2018-12-05 09:45:19 CET
Hmm... doesn't seem to be working for me.

I mean, I applied your patch, recompiled xfce4-apprunner, and started it with `./src/xfce4-apprunner -c'

Still, the prompt doesn't accept 'LC_ALL=zh_CN.utf8 wine /home/lockywolf/.wine/drive_c/Program\ Files/Tencent/WeChat/WeChat.exe'.

Am I doing something wrong?
Comment 10 lockywolf 2018-12-05 09:46:44 CET
Sorry, obviously, `xfce4-appfinder -c'.
Comment 11 Andre Miranda editbugs 2018-12-05 12:46:26 CET
appfinder runs as a daemon, have tried 'xfce4-appfinder -q' first?
Comment 12 lockywolf 2018-12-06 06:09:41 CET
Indeed, this worked out fine. 

I didn't realize that ./src/xfce4-appfinder -c actually spawns the system's appfinder.

Let me think if I can invent any tests for potential abuse of this feature.
Comment 13 Git Bot editbugs 2020-05-26 00:56:15 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfce4-appfinder/-/issues/13.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #14614

Reported by:
lockywolf
Reported on: 2018-08-19
Last modified on: 2020-05-26

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
4.13.0

Attachments

appfinder local desktop files (87.57 KB, image/png)
2018-08-22 05:24 CEST , Andre Miranda
no flags
allow_envv_launcher.patch (2.45 KB, patch)
2018-11-24 22:22 CET , Andre Miranda
no flags

Additional information