3
2
Fork
You've already forked timecheck
5

Notify non-desktop user sessions #9

Open
opened 2020年05月17日 05:53:13 +02:00 by sdicke · 5 comments
Contributor
Copy link

If a user is logged in without running at least a desktop session, then sendNotificationToUser should fail.

A possible solution is to use write, but this comes with the problem, that the usability of interactive programs could be disrupted, especially programs who uses libncurses. Maybe there is a way to detect such programs before selecting a tty.

If a user is logged in without running at least a desktop session, then sendNotificationToUser should fail. A possible solution is to use write, but this comes with the problem, that the usability of interactive programs could be disrupted, especially programs who uses libncurses. Maybe there is a way to detect such programs before selecting a tty.
Collaborator
Copy link

Is there even a proper way to find out if a user has a desktop session or not?

Is there even a proper way to find out if a user has a desktop session or not?
Author
Contributor
Copy link

I don`t know. Systemds loginctl can detect it. But if it is not available it could be not very easy. One way could be parsing the output of ps.

I don`t know. Systemds *loginctl* can detect it. But if it is not available it could be not very easy. One way could be parsing the output of *ps*.
Author
Contributor
Copy link

I`m experimenting with a way to dectect a suitable tty to inform the user in non-GUI sessions. It is not ready for a pull request know. But I believe that I found a way to dectect terminals without running interactive programs. But probably it would fail with terminals with background jobs and with shells with unusual names.

I`m experimenting with a way to dectect a suitable tty to inform the user in non-GUI sessions. It is not ready for a pull request know. But I believe that I found a way to dectect terminals without running interactive programs. But probably it would fail with terminals with background jobs and with shells with unusual names.
Collaborator
Copy link

I don`t know. Systemds loginctl can detect it. But if it is not available it could be not very easy. One way could be parsing the output of ps.

Maybe we should make loginctl a dependency 🤔 but then we'll get problems with systemd haters...

> I don`t know. Systemds *loginctl* can detect it. But if it is not available it could be not very easy. One way could be parsing the output of *ps*. Maybe we should make loginctl a dependency 🤔 but then we'll get problems with systemd haters...
Owner
Copy link

Well..
I would prefere as little dependencies as possible.

And another point is the usecase.
I "developed" this script for normal users that are using a GUI.
So for me and the usecase I've had here this is not needed.
Sure, if it is well working there is no reason to don't support systems/users without GUI.

At all, it is not my first priority. And not the second either.

But feel free to think of it ;)

Well.. I would prefere as little dependencies as possible. And another point is the usecase. I "developed" this script for normal users that are using a GUI. So for me and the usecase I've had here this is not needed. Sure, if it is well working there is no reason to don't support systems/users without GUI. At all, it is not my first priority. And not the second either. But feel free to think of it ;)
Sign in to join this conversation.
No Branch/Tag specified
master
testing
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nuron/timecheck#9
Reference in a new issue
nuron/timecheck
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?