Update: sudoer for xremap.service

This commit is contained in:
Akemi Izuko 2023-12-23 20:14:07 -07:00
parent cb032aacb7
commit b349891915
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
2 changed files with 17 additions and 4 deletions

View file

@ -69,5 +69,5 @@ case "$(echo "$1" | awk '{print tolower($0)}')" in
;; ;;
esac esac
systemctl restart xremap sudo /usr/bin/systemctl restart xremap.service
sleep 2 sleep 2

View file

@ -145,6 +145,7 @@ xremap_checks() {
check_xremap_etc check_xremap_etc
check_xremap_executable check_xremap_executable
check_xremap_systemd check_xremap_systemd
check_xremap_sudoer
} }
check_xremap_config() { check_xremap_config() {
@ -207,6 +208,18 @@ check_xremap_systemd() {
return $return_code return $return_code
} }
check_xremap_sudoer() {
local return_code=0
if ! sudo -l | grep -Eq 'NOPASSWD:[[:space:]]+/usr/bin/systemctl restart xremap.service'; then
printf "ERR: xremap.service not passwordless for sudoers\n"
printf "\t $ please echo \"%wheel ALL=NOPASSWD: /usr/bin/systemctl restart xremap.service\" >> /etc/sudoers.d/xremap\n"
return_code=1
fi
return $return_code
}
#################### ####################
# Browsers # Browsers
#################### ####################
@ -300,9 +313,9 @@ check_vimiv_plugin() {
if ! [[ -e /usr/lib/qt/plugins/imageformats/libqavif.so ]]; then if ! [[ -e /usr/lib/qt/plugins/imageformats/libqavif.so ]]; then
printf "ERR: Missing avif support for vimiv\n" printf "ERR: Missing avif support for vimiv\n"
cat <<HELP cat <<HELP
$ curl -LO 'https://github.com/novomesk/qt-avif-image-plugin/archive/refs/tags/v0.5.0.tar.gz' $ curl -LO 'https://github.com/novomesk/qt-avif-image-plugin/archive/refs/tags/v0.5.1.tar.gz'
$ tar xf qt-avif-image-plugin-0.5.0.tar.gz $ tar xf qt-avif-image-plugin-0.5.1.tar.gz
$ cd qt-avif-image-plugin-0.5.0 $ cd qt-avif-image-plugin-0.5.1
$ ./build_libqavif_dynamic.sh $ ./build_libqavif_dynamic.sh
$ please make install $ please make install
HELP HELP