This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHAT=/home/$USER/.local/bin/chatgpt-cli | |
TEMP_FILE="/tmp/selection_$(date +%Y%m%d%H%M%S).txt" | |
xclip -o -selection primary > "$TEMP_FILE" | |
xfce4-terminal -e "bash -c '$CHAT -c $TEMP_FILE ; sleep 5'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if xclip is installed | |
if ! command -v xclip >/dev/null 2>&1; then | |
echo "Error: xclip is not installed. Please install xclip to use this script." >&2 | |
exit 1 | |
fi | |
# Check if a file name is provided as an argument | |
if [ $# -eq 0 ]; then |