Update configs
This commit is contained in:
parent
a0b18cc1c8
commit
886c4caac9
@ -2,12 +2,10 @@
|
|||||||
shadow = true;
|
shadow = true;
|
||||||
no-dnd-shadow = true;
|
no-dnd-shadow = true;
|
||||||
no-dock-shadow = true;
|
no-dock-shadow = true;
|
||||||
clear-shadow = true;
|
|
||||||
shadow-radius = 7;
|
shadow-radius = 7;
|
||||||
shadow-offset-x = -7;
|
shadow-offset-x = -7;
|
||||||
shadow-offset-y = -7;
|
shadow-offset-y = -7;
|
||||||
shadow-opacity = 0.60;
|
shadow-opacity = 0.60;
|
||||||
shadow-ignore-shaped = true;
|
|
||||||
|
|
||||||
# Opacity
|
# Opacity
|
||||||
menu-opacity = 1.0;
|
menu-opacity = 1.0;
|
||||||
@ -17,7 +15,7 @@ inactive-opacity-override = false;
|
|||||||
|
|
||||||
# Fade
|
# Fade
|
||||||
fading = true;
|
fading = true;
|
||||||
fade-delta = 7.0;
|
fade-delta = 8.0;
|
||||||
fade-in-step = 0.03;
|
fade-in-step = 0.03;
|
||||||
fade-out-step = 0.028;
|
fade-out-step = 0.028;
|
||||||
alpha-step = 0.06;
|
alpha-step = 0.06;
|
||||||
|
@ -38,19 +38,19 @@ EOF
|
|||||||
|
|
||||||
#-- Utility functions --#
|
#-- Utility functions --#
|
||||||
|
|
||||||
msg() { printf "$1\e[0m \e[1m$2\e[0m\n"; }
|
msg() { printf "$1\\e[0m \e[1m$2\e[0m\n"; }
|
||||||
die() { printf "\e[1m\e[31merror:\e[0m $1\n"; exit ${2:-1}; }
|
die() { printf "\e[1m\e[31merror:\e[0m $1\n"; exit ${2:-1}; }
|
||||||
|
|
||||||
comp() { # compare AUR package versions, returns 0 or 1.. usage: comp "package" "current version"
|
comp() { # compare AUR package versions, returns 0 or 1.. usage: comp "package" "current version"
|
||||||
NEW="$(curl --silent "$PKG_ADDR/$1" | awk '/Details:/ {sub(/<\/h.?>/, ""); print $4}')"
|
NEW="$(curl --silent "$PKG_ADDR/$1" | awk '/Details:/ {sub(/<\/h.?>/, ""); print $4}')"
|
||||||
|
[[ $i =~ -git$ ]] && NEW="$(grep -ow '[0-9]*\.[0-9]*\.[0-9]*' <<< "$NEW")"
|
||||||
[[ -n $NEW && "$2" == "$NEW" ]] && return 0 || return 1
|
[[ -n $NEW && "$2" == "$NEW" ]] && return 0 || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
yesno() { # only shown when not using --noconfirm, returns 0 or 1.. usage: yesno "question"
|
yesno() { # only shown when not using --noconfirm, returns 0 or 1.. usage: yesno "question"
|
||||||
if [[ $NOCONF ]]; then
|
[[ $NOCONF ]] && return 0
|
||||||
printf "\n\e[34m::\e[0m \e[1m$1? [Y/n]\e[0m "; read -r conf
|
printf "\n\e[34m::\e[0m \e[1m$1? [Y/n]\e[0m "; read -r conf
|
||||||
[[ $conf =~ [nN] ]] && return 1 # return non zero when confirm n/N
|
[[ $conf =~ [nN] ]] && return 1 # return non zero when confirm n/N
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,23 +64,22 @@ prepupdate() { # prep for package update.. usage: prepupdate
|
|||||||
}
|
}
|
||||||
|
|
||||||
update() { # check update for each package in AUR_PKGS=().. usage: update
|
update() { # check update for each package in AUR_PKGS=().. usage: update
|
||||||
local cur
|
local ver
|
||||||
local up=()
|
local up=()
|
||||||
msg '\e[34m::' "Synchronizing AUR package versions..."
|
msg '\e[34m::' "Synchronizing AUR package versions..."
|
||||||
for i in "${AUR_PKGS[@]}"; do
|
for i in "${AUR_PKGS[@]}"; do
|
||||||
ver="$(pacman -Qs "^$i$" 2>/dev/null | awk 'NR==1 {print $2}')"
|
ver="$(pacman -Qs "^$i$" 2>/dev/null | awk 'NR==1 {print $2}')"
|
||||||
|
[[ $i =~ -git$ ]] && ver="$(grep -ow '[0-9]*\.[0-9]*\.[0-9]*' <<< "$ver")"
|
||||||
if [[ $ver ]]; then
|
if [[ $ver ]]; then
|
||||||
comp "$i" "$ver" && printf "$i-$ver --> up to date\n" || up+=("$i")
|
printf "\e7 $i-$ver \e[1m\e[33m?\e[0m\e8"
|
||||||
else
|
comp "$i" "$ver" && printf " $i-$ver \e[1m\e[32m✓\e[0m\n" ||
|
||||||
msg '\e[33m::' "$i is not installed.. skipping"
|
{ up+=("$i"); printf " $i-$ver \e[1m\e[33m*\e[0m\n"; }
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
msg '\e[34m::' "Starting AUR package upgrade..."
|
msg '\e[34m::' "Starting AUR package upgrade..."
|
||||||
if (( ${#up[@]} > 0 )); then
|
if (( ${#up[@]} > 0 )); then
|
||||||
printf "\n\e[1mPackages (${#up[@]})\e[0m %s\n\n" "${up[@]}"
|
printf "\n\e[1mPackages (${#up[@]})\e[0m %s\n\n" "${up[@]}"
|
||||||
for i in "${up[@]}"; do
|
for i in "${up[@]}"; do getpkg "$i" 0; done
|
||||||
getpkg "$i"
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
printf " there is nothing to do\n"
|
printf " there is nothing to do\n"
|
||||||
fi
|
fi
|
||||||
@ -103,15 +102,14 @@ getpkg() { # install an AUR package.. usage: getpkg "package"
|
|||||||
local bd="$BUILD_DIR/$1"
|
local bd="$BUILD_DIR/$1"
|
||||||
local pkgbuild="$bd/PKGBUILD"
|
local pkgbuild="$bd/PKGBUILD"
|
||||||
|
|
||||||
comp "$1" && msg '\e[1m'$'\e[33mwarning:' "$1-$OLD is up to date -- reinstalling"
|
(( $# > 1 )) && comp "$1" && msg '\e[1m'$'\e[33mwarning:' "$1-$OLD is up to date -- reinstalling"
|
||||||
(( CACHE == 1 )) || rm -rf "$bd" >/dev/null 2>&1
|
(( CACHE == 1 )) || rm -rf "$bd" >/dev/null 2>&1
|
||||||
[[ -d $bd ]] || mkdir -p "$bd"
|
[[ -d $bd ]] || mkdir -p "$bd"
|
||||||
|
|
||||||
if [[ ! -e $pkgbuild || $CACHE -eq 0 ]]; then
|
if [[ ! -e $pkgbuild || $CACHE -eq 0 ]]; then
|
||||||
git clone "$AUR_ADDR/$1" "$bd" || die "failed to clone $AUR_ADDR/$1"
|
git clone "$AUR_ADDR/$1" "$bd" || die "failed to clone $AUR_ADDR/$1"
|
||||||
elif [[ -e $pkgbuild ]]; then
|
elif [[ -e $pkgbuild ]]; then
|
||||||
cd "$bd"
|
cd "$bd" && git pull || die "failed to pull from $AUR_ADDR/$1"
|
||||||
git pull || die "failed to pull from $AUR_ADDR/$1"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -e $pkgbuild ]] && cd "$bd" || die "$bd doesn't contain a PKGBUILD"
|
[[ -e $pkgbuild ]] && cd "$bd" || die "$bd doesn't contain a PKGBUILD"
|
||||||
@ -121,19 +119,20 @@ getpkg() { # install an AUR package.. usage: getpkg "package"
|
|||||||
}
|
}
|
||||||
|
|
||||||
view() { # view PKGBUILD.. usage: view "package" "/path/to/PKGBUILD"
|
view() { # view PKGBUILD.. usage: view "package" "/path/to/PKGBUILD"
|
||||||
if ! [[ $NOVIEW ]]; then
|
[[ $NOVIEW ]] && return 0
|
||||||
yesno "View the PKGBUILD for $1" || return 1
|
yesno "View the PKGBUILD for $1" || return 0
|
||||||
if hash nvim >/dev/null 2>&1; then
|
if hash nvimpager >/dev/null 2>&1; then
|
||||||
nvim -n -R -u "$(find /usr/share/nvim/ -wholename '*/macros/less.vim')" "$2"
|
nvimpager "$2"
|
||||||
elif hash vim >/dev/null 2>&1; then
|
elif [[ $PAGER ]]; then
|
||||||
vim -n -R -u "$(find /usr/share/vim/ -wholename '*/macros/less.vim')" "$2"
|
$PAGER "$2"
|
||||||
else
|
else
|
||||||
less -P " -- Viewing PKGBUILD for $1 -- (press q to exit)" "$2"
|
less -P " -- Viewing PKGBUILD for $1 -- (press q to exit)" "$2"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildpkg() { # build package.. usage: buildpkg "package" "/path/to/PKGBUILD"
|
buildpkg() { # build package.. usage: buildpkg "package" "/path/to/PKGBUILD"
|
||||||
|
local depends=()
|
||||||
|
local validpgpkeys=()
|
||||||
eval "$(cat "$BUILD_DIR/$1/PKGBUILD")"
|
eval "$(cat "$BUILD_DIR/$1/PKGBUILD")"
|
||||||
(( ${#validpgpkeys[@]} > 0 )) && importkeys ${validpgpkeys[*]}
|
(( ${#validpgpkeys[@]} > 0 )) && importkeys ${validpgpkeys[*]}
|
||||||
(( ${#depends[@]} > 0 )) && builddeps "$1" ${depends[*]}
|
(( ${#depends[@]} > 0 )) && builddeps "$1" ${depends[*]}
|
||||||
@ -158,7 +157,7 @@ builddeps() { # build package depends.. usage: builddeps "package" ${DEPENDS[@]}
|
|||||||
msg '\e[33m::' "resolving AUR dependency -> $depend"
|
msg '\e[33m::' "resolving AUR dependency -> $depend"
|
||||||
getpkg "$depend" || die "failed to build dependency $depend"
|
getpkg "$depend" || die "failed to build dependency $depend"
|
||||||
done
|
done
|
||||||
cd "$BUILD_DIR/$pdir"
|
cd "$BUILD_DIR/$pdir" || die "failed to cd $BUILD_DIR/$pdir"
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- Argument parsing & execution --#
|
#-- Argument parsing & execution --#
|
||||||
|
Reference in New Issue
Block a user