Great thanks to ivanbartsov and Matija Nalis for their idea, which is the base to achieve this.
Notices: X only.
- Put
askpass-rofi.sh
andrun-gui-as.sh
to your environmentPATH
. - Run
rofi -show drun -run-command 'run-gui-as.sh {cmd}'
- [Optional] set evnironment
RUN_GUI_AS_NOLOGIN
to show user which set to nologin, but the application maybe cannot run.
If you need audio, redirect the audio of the program's running user to your logind user.
For example, my login user use pipewire and target running user using pulseaudio.
I just start a pipewire-pulse server which listen on localhost:port
, and change the default pulseaudio server to 'localhost:port' in /etc/pulse/client.conf
Check your distrubition documents and pipewire/pulseaudio or other audio server for these infomation.
I have not yet found a way to use fcitx
.