From b0e94c0727719ae52bb9a950ee724094d5142730 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Feb 2023 09:04:38 -0600 Subject: [PATCH] add gsudo script to scripts directory. this script allows you to run graphical programs as root. add requirement for gsudo to PKGBUILD. update opendoas to install doas-sudo-shim since previous package no longer exists. --- gsudo | 9 +++++++++ installers/arch/ajh-base/PKGBUILD | 1 + installers/arch/scripts/opendoas.sh | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 gsudo diff --git a/gsudo b/gsudo new file mode 100755 index 0000000..66cf3de --- /dev/null +++ b/gsudo @@ -0,0 +1,9 @@ +#!/bin/sh +#copied from: https://www.reddit.com/r/Fedora/comments/5eb633/solution_running_graphical_app_with_sudo_in/ +#small script to enable root access to x-windows system +xhost +SI:localuser:root +sudo "$1" +#disable root access after application terminates +xhost -SI:localuser:root +#print access status to allow verification that root access was removed +xhost diff --git a/installers/arch/ajh-base/PKGBUILD b/installers/arch/ajh-base/PKGBUILD index 21507da..cb8fc05 100644 --- a/installers/arch/ajh-base/PKGBUILD +++ b/installers/arch/ajh-base/PKGBUILD @@ -51,6 +51,7 @@ depends=( "openssh" "jq" "pamixer" +"xorg-xhost" #needed to run graphical programs as root #libs/plugins "python-urwid" diff --git a/installers/arch/scripts/opendoas.sh b/installers/arch/scripts/opendoas.sh index 8813647..d40e510 100755 --- a/installers/arch/scripts/opendoas.sh +++ b/installers/arch/scripts/opendoas.sh @@ -6,4 +6,4 @@ echo "permit nopass :wheel as root cmd /sbin/poweroff" >> ~/.cache/doas.conf echo "permit nopass :wheel as root cmd /sbin/reboot" >> ~/.cache/doas.conf sudo cp ~/.cache/doas.conf /etc/doas.conf -yay -S opendoas-sudo +yay -S doas-sudo-shim