diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-12-04 19:24:15 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-12-04 19:24:15 +0800 |
| commit | 3ff94f7498babd9e42b48cae82915ee559a13d3f (patch) | |
| tree | 7b8777ba4dd8b8a8b15b38b4d03bde6ed5ded8d5 /dot-config/rofi/scripts | |
| parent | 8187a91b9af014906ed2aaead9431939ddbaa8e4 (diff) | |
add: sgpt
Diffstat (limited to 'dot-config/rofi/scripts')
| -rwxr-xr-x | dot-config/rofi/scripts/rofi_clipboard | 2 | ||||
| -rwxr-xr-x | dot-config/rofi/scripts/sgpt | 21 |
2 files changed, 22 insertions, 1 deletions
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" |
