Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotfiles: utility to pipe message straight to OWUI #24

Open
mecattaf opened this issue Jan 11, 2025 · 0 comments
Open

dotfiles: utility to pipe message straight to OWUI #24

mecattaf opened this issue Jan 11, 2025 · 0 comments

Comments

@mecattaf
Copy link
Owner

To make this happen, I created a simple shell script that:

Uses Zenity to open a dialog box where I can input my prompt.

Launches a Chromium "installed app" version of OpenWebUI in a new window, automatically inserting the prompt into the /?q=xxx part of the URL.

Next, I set up a .desktop entry to treat the script like a desktop application.

Finally, I assigned a keyboard shortcut (Alt+Space) to launch the .desktop entry.

Here are the scripts:

the bash script in `~/.local/bin

!/bin/bash

Prompt the user for input

input=$(zenity --entry --title="Ask LLM" --text="Prompt:")

Check if the user canceled the dialog

if [ $? -eq 1 ]; then
exit 0
fi

Construct the URL with the user's input

url="https://my.openwebui.instance?q=$input"

Run the installed PWA in Chromium with the custom URL

flatpak run org.chromium.Chromium --profile-directory=Default --app-id=myinstalledopenwebuistandaloneappthroughchromiumid --new-window --app-launch-url-for-shortcuts-menu-item="$url"

the .desktop entry located in ~/.local/share/applications

[Desktop Entry]
Name=Ask LLM
Comment=Opens a zenscript dialogue to query llm through openwebui
Exec=/home/myself/.local/bin/llmquestion-to-openwebui.sh
Icon=dialog-question
Terminal=false
Type=Application
Categories=Utility;
Keywords=LLM;Chat;

instead of zenity we can use rofi or similar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant