Hi,
Imagine no user logged in to neither GUI nor CLI but a background service is running. Is it possible to send a notification to GUI after completion of the processing running on the background?
I have checked notify-send but could not find such a specific example.
Thanks in advance.
Regards,
On 8/6/19 12:13 PM, Danishka Navin wrote:
Imagine no user logged in to neither GUI nor CLI but a background service is running. Is it possible to send a notification to GUI after completion of the processing running on the background?
So you want to send a notification to the gdm login screen? You can do that using the gdm user's dbus and the notify2 python library. Install "python3-notify2" and create a python script for the notification (example below). Then you can run: sudo -u gdm DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/42/bus /tmp/notif.py My test script was at /tmp/notif.py
# cat /tmp/notif.py #!/usr/bin/python3
import notify2
notify2.init("my test")
n = notify2.Notification("Hey you!", "information here") n.show()
Thanks Samuel. It worked!
On Wed, Aug 7, 2019 at 2:17 AM Samuel Sieb samuel@sieb.net wrote:
On 8/6/19 12:13 PM, Danishka Navin wrote:
Imagine no user logged in to neither GUI nor CLI but a background service is running. Is it possible to send a notification to GUI after completion of the processing running on the background?
So you want to send a notification to the gdm login screen? You can do that using the gdm user's dbus and the notify2 python library. Install "python3-notify2" and create a python script for the notification (example below). Then you can run: sudo -u gdm DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/42/bus /tmp/notif.py My test script was at /tmp/notif.py
# cat /tmp/notif.py #!/usr/bin/python3
import notify2
notify2.init("my test")
n = notify2.Notification("Hey you!", "information here") n.show() _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
for LXDE based system which user should I use? I can't see lxdm on fedora lxde spin.
On Wed, Aug 7, 2019 at 12:15 PM Danishka Navin danishka@gmail.com wrote:
Thanks Samuel. It worked!
On Wed, Aug 7, 2019 at 2:17 AM Samuel Sieb samuel@sieb.net wrote:
On 8/6/19 12:13 PM, Danishka Navin wrote:
Imagine no user logged in to neither GUI nor CLI but a background service is running. Is it possible to send a notification to GUI after completion of the processing running on the background?
So you want to send a notification to the gdm login screen? You can do that using the gdm user's dbus and the notify2 python library. Install "python3-notify2" and create a python script for the notification (example below). Then you can run: sudo -u gdm DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/42/bus /tmp/notif.py My test script was at /tmp/notif.py
# cat /tmp/notif.py #!/usr/bin/python3
import notify2
notify2.init("my test")
n = notify2.Notification("Hey you!", "information here") n.show() _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
-- Danishka Navin
On 9/23/19 9:43 AM, Danishka Navin wrote:
for LXDE based system which user should I use? I can't see lxdm on fedora lxde spin.
Use the "ps" ("ps auxw | less" is what I usually use) command to see what process is running, maybe lightdm. When you find it, you will see which user it is running as. However, I don't know which DMs support notifications.
On Mon, Sep 23, 2019 at 10:32 PM Samuel Sieb samuel@sieb.net wrote:
On 9/23/19 9:43 AM, Danishka Navin wrote:
for LXDE based system which user should I use? I can't see lxdm on fedora lxde spin.
Use the "ps" ("ps auxw | less" is what I usually use) command to see what process is running, maybe lightdm. When you find it, you will see which user it is running as. However, I don't know which DMs support notifications.
Noticed that there is dbus user not sure if its the correct one to use.
On 9/23/19 10:42 AM, Danishka Navin wrote:
On Mon, Sep 23, 2019 at 10:32 PM Samuel Sieb <samuel@sieb.net mailto:samuel@sieb.net> wrote:
On 9/23/19 9:43 AM, Danishka Navin wrote: > for LXDE based system which user should I use? > I can't see lxdm on fedora lxde spin. Use the "ps" ("ps auxw | less" is what I usually use) command to see what process is running, maybe lightdm. When you find it, you will see which user it is running as. However, I don't know which DMs support notifications.Noticed that there is dbus user not sure if its the correct one to use.
No, you need to find the display manager process. lxdm is usually the one used for lxde.
On Tue, Sep 24, 2019 at 1:55 AM Samuel Sieb samuel@sieb.net wrote:
On 9/23/19 10:42 AM, Danishka Navin wrote:
On Mon, Sep 23, 2019 at 10:32 PM Samuel Sieb <samuel@sieb.net mailto:samuel@sieb.net> wrote:
On 9/23/19 9:43 AM, Danishka Navin wrote: > for LXDE based system which user should I use? > I can't see lxdm on fedora lxde spin. Use the "ps" ("ps auxw | less" is what I usually use) command to see what process is running, maybe lightdm. When you find it, you willsee
which user it is running as. However, I don't know which DMs support notifications.Noticed that there is dbus user not sure if its the correct one to use.
No, you need to find the display manager process. lxdm is usually the one used for lxde.
I have checked /etc/sysconfig/desktop and found that lxdm is the Display Manager
On Tue, 2019-09-24 at 12:13 +0530, Danishka Navin wrote:
No, you need to find the display manager process. lxdm is usually the one used for lxde.
I have checked /etc/sysconfig/desktop and found that lxdm is the Display Manager
That may not be reliable. I only ever use KDE, but my /etc/sysconfig/desktop file says:
$ cat /etc/sysconfig/desktop DESKTOP=GNOME
OTOH, I have:
$ systemctl status sddm ● sddm.service - Simple Desktop Display Manager Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-20 10:53:31 BST; 3 days ago ...
poc
On 9/24/19 5:44 PM, Patrick O'Callaghan wrote:
On Tue, 2019-09-24 at 12:13 +0530, Danishka Navin wrote:
No, you need to find the display manager process. lxdm is usually the one used for lxde.
I have checked /etc/sysconfig/desktop and found that lxdm is the Display Manager
That may not be reliable. I only ever use KDE, but my /etc/sysconfig/desktop file says:
$ cat /etc/sysconfig/desktop DESKTOP=GNOME
OTOH, I have:
$ systemctl status sddm ● sddm.service - Simple Desktop Display Manager Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-20 10:53:31 BST; 3 days ago
Which is why the accurate way to determine the DM is....
[egreshko@meimei ~]$ ll /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 36 Nov 5 2017 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/sddm.service
And note where the symbolic link points
On Tue, 2019-09-24 at 17:49 +0800, Ed Greshko wrote:
On 9/24/19 5:44 PM, Patrick O'Callaghan wrote:
On Tue, 2019-09-24 at 12:13 +0530, Danishka Navin wrote:
No, you need to find the display manager process. lxdm is usually the one used for lxde.
I have checked /etc/sysconfig/desktop and found that lxdm is the Display Manager
That may not be reliable. I only ever use KDE, but my /etc/sysconfig/desktop file says:
$ cat /etc/sysconfig/desktop DESKTOP=GNOME
OTOH, I have:
$ systemctl status sddm ● sddm.service - Simple Desktop Display Manager Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-20 10:53:31 BST; 3 days ago
Which is why the accurate way to determine the DM is....
[egreshko@meimei ~]$ ll /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 36 Nov 5 2017 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/sddm.service
And note where the symbolic link points
Exactly.
poc
On Tue, Sep 24, 2019 at 4:29 PM Patrick O'Callaghan pocallaghan@gmail.com wrote:
On Tue, 2019-09-24 at 17:49 +0800, Ed Greshko wrote:
On 9/24/19 5:44 PM, Patrick O'Callaghan wrote:
On Tue, 2019-09-24 at 12:13 +0530, Danishka Navin wrote:
No, you need to find the display manager process. lxdm is usually
the
one used for lxde.
I have checked /etc/sysconfig/desktop and found that lxdm is the
Display
Manager
That may not be reliable. I only ever use KDE, but my /etc/sysconfig/desktop file says:
$ cat /etc/sysconfig/desktop DESKTOP=GNOME
OTOH, I have:
$ systemctl status sddm ● sddm.service - Simple Desktop Display Manager Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-20 10:53:31 BST; 3 days ago
Which is why the accurate way to determine the DM is....
[egreshko@meimei ~]$ ll /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 36 Nov 5 2017
/etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/sddm.service
And note where the symbolic link points
Thanks.
That confirmed its lxdm
[danishka@localhost-live ~]$ [danishka@localhost-live ~]$ ll /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 36 Sep 19 09:05 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/lxdm.service [danishka@localhost-live ~]$ cat /etc/sysconfig/desktop PREFERRED=/usr/bin/startlxde DISPLAYMANAGER=/usr/sbin/lxdm [danishka@localhost-live ~]$