ports/x11-wm/lxmed/files/pc-su
Rusmir Dusko dc2d931c44 LXMenuEditor is a small, simple, free, open source, easy to use application
that allows you to customize the LXDE menu.

LXMenuEditor is very useful for people that want to create their own,
customized menus for LXDE.

This editor can also be used to customize GNOME's main menu and menus
of other enviroments, although it's specially designed for the LXDE environment.

WWW: http://lxmed.sourceforge.net/

PR:		ports/175936
Submitted by:	nemysis (self)
Approved by:	pawel (mentor)
2013-10-18 23:43:34 +00:00

34 lines
797 B
Bash

#!/bin/sh
# Wrapper script which finds the right "su" program
# to use for graphical root execution
if [ `id -r -u` != "0" ] ; then
VARS="`echo $@`"
# Try qsudo first, should always be the default
which qsudo >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
qsudo $VARS
exit $?
fi
# Now try gksu
which gksu >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
gksu -a "$VARS"
exit $?
fi
# Lastly we have kdesu
which kdesu >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
kdesu -t -c "$VARS"
exit $?
fi
# If no utility could be found...
echo "No graphical switch-user utility found!"
exit 1
else
${@}
fi