From 3ff94f7498babd9e42b48cae82915ee559a13d3f Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 4 Dec 2024 19:24:15 +0800 Subject: add: sgpt --- dot-config/rofi/scripts/rofi_clipboard | 2 +- dot-config/rofi/scripts/sgpt | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 dot-config/rofi/scripts/sgpt (limited to 'dot-config/rofi/scripts') diff --git a/dot-config/rofi/scripts/rofi_clipboard b/dot-config/rofi/scripts/rofi_clipboard index c2c2a46e..28cb35c3 100755 --- a/dot-config/rofi/scripts/rofi_clipboard +++ b/dot-config/rofi/scripts/rofi_clipboard @@ -3,4 +3,4 @@ DIR="$HOME/.config/rofi" RASI="$DIR/clipboard.rasi" # rofi -modi clipboard:"$DIR/scripts/cliphist-rofi-img" -show clipboard -theme ${RASI} -cliphist --image "\x00icon\x1f" list | rofi -dmenu -show-icons -theme ${RASI} | cliphist decode | wl-copy +cliphist --image "\x00icon\x1f" list | rofi -dmenu -i -show-icons -theme ${RASI} | cliphist decode | wl-copy diff --git a/dot-config/rofi/scripts/sgpt b/dot-config/rofi/scripts/sgpt new file mode 100755 index 00000000..abd4e165 --- /dev/null +++ b/dot-config/rofi/scripts/sgpt @@ -0,0 +1,21 @@ +#!/bin/bash + +DIR="$HOME/.config/rofi" +RASI="$DIR/sgpt.rasi" + +INPUT=$(rofi -dmenu -p "" -theme ${RASI}) +if [[ -z $INPUT ]]; then + exit 1 +fi + +zenity --progress --text="Waiting for an answer" --pulsate & + +if [[ $? -eq 1 ]]; then + exit 1 +fi + +PID=$! + +ANSWER=$(sgpt "$INPUT" --role general) +kill $PID +zenity --info --text="$ANSWER" -- cgit v1.2.3