So you'd like to run apps from the commandline as su or user
Tags computer mad science, kde, opensuse, utilities
So you'd like to run apps from the commandline as su or user
In case it's not clear, and it probably isn't, this modification (openSUSE version so far):
[x] Allows users to run gui apps (such as kate or kwrite, konqueror or dolphin) and non-gui apps with the same syntax, no wrappers. I.e., makes kde work WITH linux instead of against it.
[x] Allows uniform syntax for calling script-based programs which may now call gui apps or not and run without crashing, whether run as user or superuser.
[x] superuser handling done once, programatically instead requiring recurring wrapper call every time you run a gui app (which WILL crash in kde without this modification if you are already superuser).
Try this without the modification. It will demonstrate half the reason this modification (or something like it) is necessary.
CRASH!
Here's the finished version for openSUSE. The code for kubuntu is still not quite finished.
The above is tested and bug-free for openSUSE 11.4. (At least it is for me and I've been using it for several months.)
Kubuntu Note:
The kubuntu code will be forthcoming soon but may require some help from some of the old timers around here because we need to catch and handle relaying a SIGHUP to root's 'knotify' in order to prevent SUDO_USER hanging in the dimmed state when trying to logout or shutdown.
Root's knotify can be looked up using 'pgrep knotify -u root' and sent the signal (kill -s 15 <PID>) as superuser in order to clear the stuff that hangs, but that shouldn't be necessary.
That *should* be handled programmatically too.
In case it's not clear, and it probably isn't, this modification (openSUSE version so far):
[x] Allows users to run gui apps (such as kate or kwrite, konqueror or dolphin) and non-gui apps with the same syntax, no wrappers. I.e., makes kde work WITH linux instead of against it.
[x] Allows uniform syntax for calling script-based programs which may now call gui apps or not and run without crashing, whether run as user or superuser.
[x] superuser handling done once, programatically instead requiring recurring wrapper call every time you run a gui app (which WILL crash in kde without this modification if you are already superuser).
Try this without the modification. It will demonstrate half the reason this modification (or something like it) is necessary.
Code:
su # enter password kdesu kwrite
Here's the finished version for openSUSE. The code for kubuntu is still not quite finished.
Code:
# For openSUSE, run apps as user or 'su' # without kdesu/xdg-su or any other su # wrapper. # Integrates gui and terminal apps the way # you'd expect them to be. # How: # add this to, or create /root/(dot)bashrc # containing this code. function _su_check_connected { dbus-send --dest=org.freedesktop /org/freedesktop org.freedesktop.Hello 2>/dev/null } function _su_check { if [ "$USER" != "root" ]; then for i in /root/.dbus/session-bus/*; do source $i export DBUS_SESSION_BUS_ADDRESS if _su_check_connected ; then # we are now connected to the first dbus-daemon that worked return fi done # if no files contain a valid address, we'll just create one. export $(dbus-launch) # if root logs in before su does, root's daemon will get reused # otherwise there will be one for su and one for root. # two daemons is tolerable. 600+ is not. fi } _su_check
Kubuntu Note:
The kubuntu code will be forthcoming soon but may require some help from some of the old timers around here because we need to catch and handle relaying a SIGHUP to root's 'knotify' in order to prevent SUDO_USER hanging in the dimmed state when trying to logout or shutdown.
Root's knotify can be looked up using 'pgrep knotify -u root' and sent the signal (kill -s 15 <PID>) as superuser in order to clear the stuff that hangs, but that shouldn't be necessary.
That *should* be handled programmatically too.
Total Comments 0