diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-18 17:52:21 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-18 18:38:21 +0100 |
| commit | 273f57260449a8247eb1e7ca640dba6af8a90ad2 (patch) | |
| tree | 14d364dbe3c8eb7599f802a61e1f617ddfcdf111 /bin/wsudo | |
| parent | 7a7ef68421ceb67642560ee00d0c51301934f3c0 (diff) | |
bin: drop some scripts
chrome-extension-dl fs kp mesoninit once open wsudo
Diffstat (limited to 'bin/wsudo')
| -rwxr-xr-x | bin/wsudo | 44 |
1 files changed, 0 insertions, 44 deletions
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 |