1
0
mirror of https://github.com/Mayccoll/Gogh.git synced 2023-08-10 21:12:46 +03:00

Major update with tilix support

This commit is contained in:
phenonymous 2018-11-22 14:30:40 +01:00
parent db039c6b4b
commit 61fb958374
3 changed files with 37 additions and 31 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
out.txt out.txt
gh-pages/node_modules gh-pages/node_modules
*lock* *lock*
.stfolder
apply-colors-original.sh

View File

@ -5,7 +5,7 @@
# | =========================================== # | ===========================================
UUIDGEN="${UUIDGEN:-$(command -v uuidgen)}" UUIDGEN="${UUIDGEN:-$(command -v uuidgen)}"
DCONF="${DCONF:-$(command -v dconf)}" DCONF="${DCONF:-$(command -v dconf)}"
GCONF="${GCONF:-$(command -v gconftool)}" GCONF="${GCONF:-$(command -v gconftool-2)}"
GS="${GS:-$(command -v gsettings)}" GS="${GS:-$(command -v gsettings)}"
case "${TERMINAL}" in case "${TERMINAL}" in
@ -26,6 +26,7 @@ case "${TERMINAL}" in
touch "$CFGFILE" touch "$CFGFILE"
fi fi
;; ;;
guake|tilix|mate-terminal|gnome-terminal* ) guake|tilix|mate-terminal|gnome-terminal* )
case "${TERMINAL}" in case "${TERMINAL}" in
guake|gnome-terminal* ) guake|gnome-terminal* )
@ -45,10 +46,6 @@ case "${TERMINAL}" in
fi fi
;; ;;
* )
printf '%s\n' "Unsupported terminal"
exit 1
;;
esac esac
@ -146,7 +143,7 @@ gcset() {
local key="$1"; shift local key="$1"; shift
local val="$1" local val="$1"
"$GCONFTOOL" --set --type "$type" "$PROFILE_KEY/$key" -- "$val" "$GCONF" --set --type "$type" "$PROFILE_KEY/$key" -- "$val"
} }
# Because gconftool doesn't have "append" # Because gconftool doesn't have "append"
@ -158,12 +155,12 @@ glist_append() {
entries="$( entries="$(
{ {
"$GCONFTOOL" --get "$key" | tr -d "[]" | tr , "\n" | grep -F -v "$val" "$GCONF" --get "$key" | tr -d "[]" | tr , "\n" | grep -F -v "$val"
echo "$val" echo "$val"
} | head -c-1 | tr "\n" , } | head -c-1 | tr "\n" ,
)" )"
"$GCONFTOOL" --set --type list --list-type "$type" "$key" "[$entries]" "$GCONF" --set --type list --list-type "$type" "$key" "[$entries]"
} }
gset() { gset() {
@ -447,34 +444,34 @@ case "${TERMINAL}" in
apply_cygwin apply_cygwin
;; ;;
guake|gnome-terminal* ) guake )
if [[ -z ${DCONF} ]]; then if [[ -n "$($DCONF list /apps/guake/style/)" ]]; then
if [[ "${TERMINAL}" == "guake" ]]; then apply_guake
apply_guake legacy
else
BASE_KEY="/apps/gnome-terminal/profiles"
apply_gtk legacy
fi
else else
if [[ "${TERMINAL}" == "guake" ]]; then apply_guake legacy
apply_guake fi
else ;;
BASE_KEY="/org/gnome/terminal/legacy/profiles:"
PROFILE_LIST_KEY="${BASE_KEY}/list"
PROFILE_SLUG=":${PROFILE_SLUG}"
: ${DEFAULT_SLUG:=":$($DCONF read ${BASE_KEY}/default | tr -d \')"} gnome-terminal* )
: ${DEFAULT_SLUG:=":$($DCONF list ${BASE_KEY}/ | grep '/$' | head -n1 | tr -d ':/')"} if [[ -n "$($DCONF list /org/gnome/terminal/)" ]]; then
BASE_KEY="/org/gnome/terminal/legacy/profiles:"
PROFILE_LIST_KEY="${BASE_KEY}/list"
PROFILE_SLUG=":${PROFILE_SLUG}"
echo $PROFILE_SLUG : ${DEFAULT_SLUG:=":$($DCONF read ${BASE_KEY}/default | tr -d \')"}
echo $DEFAULT_SLUG : ${DEFAULT_SLUG:=":$($DCONF list ${BASE_KEY}/ | grep '/$' | head -n1 | tr -d ':/')"}
LEFT_WRAPPER="[" echo $PROFILE_SLUG
RIGHT_WRAPPER=] echo $DEFAULT_SLUG
PALETTE_DELIM="', '"
apply_gtk LEFT_WRAPPER="["
fi RIGHT_WRAPPER=]
PALETTE_DELIM="', '"
apply_gtk
else
BASE_KEY="/apps/gnome-terminal/profiles"
apply_gtk legacy
fi fi
;; ;;
@ -505,6 +502,11 @@ case "${TERMINAL}" in
apply_gtk apply_gtk
;; ;;
* )
printf '%s\n' "Unsupported terminal!"
exit 1
;;
esac esac
unset PROFILE_NAME unset PROFILE_NAME

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euxo pipefail
declare -a THEMES=( declare -a THEMES=(
'3024-day.sh' '3024-day.sh'
'3024-night.sh' '3024-night.sh'