Add ubinstall-gtk to polkit

master v2.86
Dmitry Razumov 1 year ago
parent bb145a2891
commit 6be166a715
Signed by: asmeron
GPG Key ID: 50BC1DB583B79706

@ -120,15 +120,15 @@ EOF
XORG_STR_MONITOR+=' Option "Ignore" "true"\n' XORG_STR_MONITOR+=' Option "Ignore" "true"\n'
elif grep -Eiq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Primary" "true"\n' XORG_STR_MONITOR+=' Option "Primary" "true"\n'
elif grep -Eiq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^lo:[[:alnum:]]*$|^LeftOf:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"LeftOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n" XORG_STR_MONITOR+=" Option \"LeftOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif grep -Eiq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^ro:[[:alnum:]]*$|^RightOf:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"RightOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n" XORG_STR_MONITOR+=" Option \"RightOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif grep -Eiq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^ab:[[:alnum:]]*$|^Above:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Above\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n" XORG_STR_MONITOR+=" Option \"Above\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif grep -Eiq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^be:[[:alnum:]]*$|^Below:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Below\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n" XORG_STR_MONITOR+=" Option \"Below\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif grep -Eiq "^rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^rotate:[[:alpha:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Rotate\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n" XORG_STR_MONITOR+=" Option \"Rotate\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
fi fi
[[ -z ${PREFERRED_MODE} ]] && PREFERRED_MODE=$(grep Modeline <<< "${XORG_STR_MONITOR}" | cut -d'"' -f2) [[ -z ${PREFERRED_MODE} ]] && PREFERRED_MODE=$(grep Modeline <<< "${XORG_STR_MONITOR}" | cut -d'"' -f2)

@ -20,13 +20,19 @@ SYSCONF="${ROOTFS}${SYSCONF}"
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/security; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null SOURCE=${SYSCONF}/security; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
declare -A POLKIT
exec_polkit_ubinstall(){
[[ $(cmdline_value ub.sgnfiles) =~ .*"-iso.sgn" ]] && POLKIT[com.ublinux.ubinstall-gtk.]=yes:wheel
}
exec_polkit(){ exec_polkit(){
## Настрока polkit правил ## Настрока polkit правил
rm -f "${ROOTFS}"/etc/polkit-1/rules.d/ublinux-* rm -f "${ROOTFS}"/etc/polkit-1/rules.d/ublinux-*
if [[ -n ${POLKIT[@]} ]]; then if [[ -n ${POLKIT[@]} ]]; then
for RULES in "${!POLKIT[@]}"; do for RULES in "${!POLKIT[@]}"; do
RULES_GROUP= RULES_GROUP=
RULES_FILE="${ROOTFS}/etc/polkit-1/rules.d/ublinux-$(sed 's/\([A-z0-9]*.[A-z0-9]*.[A-z0-9]*\)\..*/\1/' <<< ${RULES}).rules" RULES_FILE="${ROOTFS}/etc/polkit-1/rules.d/ublinux-$(sed 's/\([[:alnum:]]*.[[:alnum:]]*.[[:alnum:]]*\)\..*/\1/' <<< ${RULES}).rules"
RULES_RESULT=$(cut -d: -f1 <<< ${POLKIT[${RULES}]}) RULES_RESULT=$(cut -d: -f1 <<< ${POLKIT[${RULES}]})
for GROUP in $(grep ":" <<< ${POLKIT[${RULES}]} | cut -d: -f2 | tr ',' '\n'); do for GROUP in $(grep ":" <<< ${POLKIT[${RULES}]} | cut -d: -f2 | tr ',' '\n'); do
RULES_GROUP+="&& subject.isInGroup(\"${GROUP}\") " RULES_GROUP+="&& subject.isInGroup(\"${GROUP}\") "
@ -53,4 +59,5 @@ EOF
##### MAIN ##### ##### MAIN #####
################ ################
exec_polkit_ubinstall $@
exec_polkit $@ exec_polkit $@

@ -54,15 +54,15 @@ SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM}) xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM})
elif grep -Eiq "^mode:[0-9x_]*:[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^mode:[0-9x_]*:[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM}) --rate $(cut -d: -f3 <<< ${VIDEO_PORT_PARAM}) xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM}) --rate $(cut -d: -f3 <<< ${VIDEO_PORT_PARAM})
elif grep -Eiq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^lo:[[:alnum:]]*$|^LeftOf:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --left-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^}) xrandr --output ${VIDEO_PORT^^} --left-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif grep -Eiq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^ro:[[:alnum:]]*$|^RightOf:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --right-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^}) xrandr --output ${VIDEO_PORT^^} --right-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif grep -Eiq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^ab:[[:alnum:]]*$|^Above:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --above $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^}) xrandr --output ${VIDEO_PORT^^} --above $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif grep -Eiq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^be:[[:alnum:]]*$|^Below:[[:alnum:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --below $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^}) xrandr --output ${VIDEO_PORT^^} --below $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif grep -Eiq "^Rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then elif grep -Eiq "^Rotate:[[:alpha:]]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --rotate $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^}) xrandr --output ${VIDEO_PORT^^} --rotate $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
fi fi
if [[ -n ${MODELINE} ]]; then if [[ -n ${MODELINE} ]]; then

Loading…
Cancel
Save