Add ChatGPT Icon

This commit is contained in:
Stephan Raabe
2024-01-05 18:56:52 +01:00
parent 9b93ffc2c0
commit 8e0518c417
4 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
name="Show/Hide ChatGPT"
order=1

View File

@@ -0,0 +1,34 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Hide or show the chatgpt icon in ML4W waybar themes."
# Define File
targetFile="$HOME/dotfiles/waybar/modules.json"
settingsFile="$HOME/dotfiles/.settings/waybar_chatgpt"
# Define Markers
startMarker="START CHATGPT TOOGLE"
endMarker="END CHATGPT TOOGLE"
# Select Value
customvalue=$(gum choose "SHOW" "HIDE")
if [ ! -z $customvalue ]; then
if [ "$customvalue" == "SHOW" ] ;then
customtext=" \"custom\/chatgpt\","
else
customtext=" \/\/\"custom\/chatgpt\","
fi
_replaceInFile $startMarker $endMarker $customtext $targetFile
_writeSettings $settingsFile $customtext
# Reload Waybar
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
_goBack
else
echo "ERROR: Define a value."
sleep 2
_goBack
fi