Re,
On 11/01/2014 09:40 PM, Paul Wise wrote:
Under gnome-shell classic mode I didn't see the user notification,
possibly because I was running needrestart as root from a virtual
console, my gnome-shell session was entirely separate and I didn't
switch back to my gnome-shell session until after needrestart completed.
When I switch back to my session immediately the situation is better but
not by much, there is a notification in the notification area but the
notifications indicator in the gnome-shell classic mode only lists the
count of notifications. The notification itself contains HTML tags. The
the Desktop Notifications Specification[1] allows using some HTML tags,
although I use the paragraph tag which is not listed in the spec (works
on KDE4). Desktop notification might not be the approach to notify the
user...
[1]
https://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#markup
notification in my case listed processes that would be automatically
restarted if I manually kill them (evolution mail client related
services), a process that would kill my session entirely if I killed it
(gnome-session), 3 other services that I'm not sure if they can be
restarted or not and one application (xchat) that I would need to do
some work in and only then manually close and restart (since it contains
state that is not restored on restart). The notification also includes
process identifiers which 90% of users aren't going to understand.
I think you are going to need to integrate better with the various
desktops. For example in the gnome-shell overview mode you could have an
indicator icon on top of windows that need to be restarted. For all
desktops and window managers etc you could also add an indicator to the
window decorations.
...as I already expected a requirement for a deeper integration. IMHO
this is should not be part of needrestart's "core" features. It should
be possible to create specific packages (needrestart-notify-gnome,
needrestart-notify-kde or needrestart-notify-x11,
needrestart-notify-wayland?) and spawn a restart notification service in
each new user session. This service could be triggered by a hook in
needrestart's notify.d/ and use advanced features like window decoration
from within the user's session.
If the user is using systemd based user sessions (those are coming but
not yet in GNOME etc), (I think) you will be able to autorestart user
services in those sessions using systemctl.
I don't think that systemd makes anything easier for the applications...
i.e. restarting xchat will still be disruptive :-)
Your current implementation is X11 specific, Wayland is coming and
personally I will be switching to it ASAP due to the improved security
properties of Wayland compared to Xorg.
I would suggest this instead of grep | sed:
export DISPLAY=$(sed -z -n s/DISPLAY=//p /proc/$NR_SESSPPID/environ)
Thanks.
Under the GDM login manager for normal users, your code will not work
because GDM does not use ~/.Xauthority but sets XAUTHORITY to a custom
path. I expect you will need to extract at least the XAUTHORITY variable
and possibly others. It only worked for me because I add a symlink from
~/.Xauthority to $XAUTHORITY so that my cronjobs can access $DISPLAY.
Since I'm using kdm/kde.session I did expect problems with other display
managers and/or session managers... you're right, I forgot the
XAUTHORITY file.
IIRC PackageKit has some support for restarting programs in user
sessions, I would recommend looking at their implementation.
I'll take a look...
Thanks for the feedback,
Thomas
--
:: WWW: http://fiasko-nw.net/~thomas/ ::
::: Jabber: xmpp:tho...@jabber.fiasko-nw.net :::
:: flickr: http://www.flickr.com/photos/laugufe/ ::
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org