From 273f57260449a8247eb1e7ca640dba6af8a90ad2 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 18 Nov 2022 17:52:21 +0100 Subject: bin: drop some scripts chrome-extension-dl fs kp mesoninit once open wsudo --- bin/wsudo | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 bin/wsudo (limited to 'bin/wsudo') diff --git a/bin/wsudo b/bin/wsudo deleted file mode 100755 index 1ac1e33..0000000 --- a/bin/wsudo +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# -# Enable root access to x-windows system. -# -# Motivation: Trying to run a graphical application as root via su, sudo in a -# Wayland session (e.g. GParted or Gedit), will fail. Apps which use polkit to -# request administrator permissions for just certain operations and only when -# needed are not affected (they are not started as root right away). -# [1] https://bugzilla.redhat.com/show_bug.cgi?id=1274451 -# -# Based on a Reddit comment. -# [2] https://www.reddit.com/r/Fedora/comments/5eb633/solution_running_graphical_app_with_sudo_in/ - -usage() { - printf "usage: wsudo [-d] [command]\n" -} - -# make sure there is an argument -if (( $# == 0 )); then - echo "error: Illegal number of parameters." >&2 - exit 1 -fi - -if ! type -p "$1" &>/dev/null; then - echo "$1 not found. Aborting." >&2 - exit 1 -fi - -for cmd in sudo xhost; do - if ! type -P $cmd &>/dev/null; then - echo "$cmd it's not installed. Aborting." >&2 - exit 1 - fi -done - -set -x - -xhost +SI:localuser:root -SUDO_ASKPASS="`command -v askpass`" sudo -A "${@}" -#disable root access after application terminates -xhost -SI:localuser:root -#print access status to allow verification that root access was removed -xhost -- cgit 1.4.1