mabox-colorizer/bin/gtkctl

71 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2024-09-04 12:58:53 +02:00
#!/bin/bash
# gtkctl - GTK widget (theme), Icons settings for Mabox
GTK2RC="$HOME"/.gtkrc-2.0
GTK3RC="$HOME"/.config/gtk-3.0/settings.ini
get_theme(){
GTK_THEME=( $(grep "gtk-theme-name" ${GTK2RC} | cut -d'"' -f2) )
echo ${GTK_THEME}
}
get_icons(){
GTK_ICON=( $(grep "gtk-icon-theme-name" ${GTK2RC} | cut -d'"' -f2) )
echo ${GTK_ICON}
}
theme(){
# set GTK theme
:
}
icons(){
# set icon theme
sd "^gtk-icon-theme-name=.*" "gtk-icon-theme-name=\"${1}\"" ${GTK2RC}
sd "^gtk-icon-theme-name=.*" "gtk-icon-theme-name=${1}" ${GTK3RC}
reload-gtk
}
papcolor(){
ICON_DIR="$HOME/.local/share/icons"
case "$1" in
adwaita|black|blue|bluegrey|breeze|brown|carmine|cyan|darkcyan|deeporange|green|grey|indigo|magenta|nordic|orange|palebrown|paleorange|pink|red|teal|violet|white|yaru|yellow)
;;
*)
exit 1
esac
if [ -f "${ICON_DIR}/Papirus-Mabox-$1/index.theme" ];then
TITLE="Icons theme changed!"
TEXT="Papirus folders color: <b>${1^}</b>"
icons Papirus-Mabox-$1
notify-send.sh -u normal -i "${ICON_DIR}/Papirus-Mabox-$1/64x64/places/folder-linux.svg" "$TITLE" "$TEXT"
else
TITLE="Please wait..."
TEXT="Preparing ${1} folder color icons"
TITLE2="Success!"
TEXT2="${1^} icons color variant generated successfully"
notify-send.sh -u critical -i /usr/share/icons/Papirus/64x64/places/folder-${1}.svg -R /tmp/papicon "$TITLE" "$TEXT"
papirus-folder-color.sh -c ${1}
notify-send.sh -u normal -i "${ICON_DIR}/Papirus-Mabox-$1/64x64/places/folder-linux.svg" -R /tmp/papicon "$TITLE2" "$TEXT2"
icons Papirus-Mabox-$1
fi
}
case "$1" in
get_theme)get_theme;;
get_icons)get_icons "$2";;
theme)theme "$2";;
icons)icons "$2";;
papcolor)papcolor "$2";;
*):;;
esac