summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-12-04 19:24:15 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-12-04 19:24:15 +0800
commit3ff94f7498babd9e42b48cae82915ee559a13d3f (patch)
tree7b8777ba4dd8b8a8b15b38b4d03bde6ed5ded8d5
parent8187a91b9af014906ed2aaead9431939ddbaa8e4 (diff)
add: sgpt
-rw-r--r--dot-config/hypr/binds.conf1
-rwxr-xr-xdot-config/rofi/scripts/rofi_clipboard2
-rwxr-xr-xdot-config/rofi/scripts/sgpt21
-rw-r--r--dot-config/rofi/sgpt.rasi73
4 files changed, 96 insertions, 1 deletions
diff --git a/dot-config/hypr/binds.conf b/dot-config/hypr/binds.conf
index b0ca97b7..af2bea26 100644
--- a/dot-config/hypr/binds.conf
+++ b/dot-config/hypr/binds.conf
@@ -18,6 +18,7 @@ bind = $mainMod shift, return, exec, $termfloat
bind = $mainMod alt, Delete, execr, $rofiexec/rofi_powermenu
bind = alt, F1, execr, $rofiexec/rofi_launcher
bind = alt, F2, execr, $rofiexec/rofi_runner
+bind = alt, F3, execr, $rofiexec/sgpt
bind = $mainMod, period, execr, $rofiexec/rofi_emoji
# utils
bind = $mainMod, c, execr, $rofiexec/rofi_configs
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"
diff --git a/dot-config/rofi/sgpt.rasi b/dot-config/rofi/sgpt.rasi
new file mode 100644
index 00000000..8e2adde7
--- /dev/null
+++ b/dot-config/rofi/sgpt.rasi
@@ -0,0 +1,73 @@
+/*****----- Global Properties -----*****/
+@import "shared/colors.rasi"
+@import "shared/fonts.rasi"
+
+/*****----- Main Window -----*****/
+window {
+ location: center;
+ anchor: center;
+ fullscreen: false;
+ width: 700px;
+ x-offset: 0px;
+ y-offset: 0px;
+ padding: 20px;
+ border: 1px solid;
+ border-radius: 16px;
+ border-color: @selected;
+ background-color: @background;
+ cursor: "default";
+ children: [ "inputbar", "listview" ];
+}
+
+/*****----- Inputbar -----*****/
+inputbar {
+ enabled: true;
+ spacing: 10px;
+ margin: 0px;
+ padding: 0px;
+ border: 0px solid;
+ border-radius: 16px;
+ border-color: @selected;
+ background-color: transparent;
+ text-color: @foreground;
+ children: [ "textbox-prompt-colon", "prompt", "entry" ];
+}
+
+dummy {
+ expand: false;
+ width: 10px;
+ background-color: transparent;
+}
+textbox-prompt-colon {
+ enabled: true;
+ expand: false;
+ str: "";
+ padding: 10px 13px;
+ border-radius: 16px;
+ background-color: @active;
+ text-color: @background;
+}
+prompt {
+ enabled: true;
+ padding: 10px;
+ border-radius: 16px;
+ background-color: @selected;
+ text-color: @background;
+}
+entry {
+ enabled: true;
+ padding: 10px;
+ border: 0px 0px 1px 0px;
+ border-radius: 16px;
+ border-color: @selected;
+ background-color: @background-alt;
+ text-color: inherit;
+ cursor: text;
+ placeholder: "Ask Anything";
+ placeholder-color: inherit;
+}
+
+/*****----- Listview -----*****/
+listview {
+ enabled: false;
+}