Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a prefered or standard way to prompt the desktop and ask the end-user to attach an external HDD, thumb/key drive, or media card?
I'm asking because we have all grown to hate on-screen pop-up everything.
I'd like to use the notification features of the desktop, but I don't see a way for that to (1) stay on screen very long, and (2) allow end-user interaction with the notifying application.
In a nightmare long ago*, applications and utilities would issue a prompt at an "operator's console" asking that a specific disk pack or mag tape get mounted. The application would wait for the operator, often nagging every so often. Once the media was mounted, the operator would inform the application about which drive was used, if more than one was available, and processing would proceed.
Consider the need to copy files to external storage every day at 9AM.
This copy gets managed by a cron-job. Who knows how the workstation is being used at 0900 each day. From the cron-job, I'd like to prompt the desktop to attach the device to use for the data target, nagging the desktop until the request is satisfied, and so on.
Thanks in advance,
~~~ 8d;-} Dan
____________________
* re: "operator's console -- One example of this is the OPR utility from Digital® Tops10™. See Tops-10 Operator's Guide (This is a PDF file download.)
It appears that I need to clarify my question/request.
I have scripts that run at various times. These scripts expect access to one or more EXTERNAL HDD devices -- drives not thumb/key devices or media cards. When the script runs, its required device might not be connected or powered up. Thus I want the script to prompt at the desktop to ask, I should probably say "nag," the end-user to make the desired device connected and online.
Given how everyone really hates popup everything, I would prefer to avoid something that suddenly appears on screen, and takes input focus away from whatever typing might be going on. Most desktop environments (DE) have some sort of notifier feature. Sadly, they are not really suitable for the sort of deferred interaction that suits my application requirements. I want the end-user to notice the pending request and remain aware of it until they provide the requested device. I don't want any sort of in-your-face win-dose do-this-now interruption.
I've thought about doing the following:
create a dialog at the back/bottom of the open window panels
use the notifier to announce that the dialog exists -- similar to how print queues announce their events
wait for interaction with the dialog
repeat until the request gets satisfied
give up after some while and notify that fact
Does this seem reasonable? Would everyone hate this sort of passive behind-the-curtain popup behavior?
If anyone has other, better, or different ideas, I'm eager to hear your suggestions.
It appears that I need to clarify my question/request.
I have scripts that run at various times. These scripts expect access to one or more EXTERNAL HDD devices -- drives not thumb/key devices or media cards. When the script runs, its required device might not be connected or powered up. Thus I want the script to prompt at the desktop to ask, I should probably say "nag," the end-user to make the desired device connected and online.
Given how everyone really hates popup everything, I would prefer to avoid something that suddenly appears on screen, and takes input focus away from whatever typing might be going on. Most desktop environments (DE) have some sort of notifier feature. Sadly, they are not really suitable for the sort of deferred interaction that suits my application requirements. I want the end-user to notice the pending request and remain aware of it until they provide the requested device. I don't want any sort of in-your-face win-dose do-this-now interruption.
I've thought about doing the following:
create a dialog at the back/bottom of the open window panels
use the notifier to announce that the dialog exists -- similar to how print queues announce their events
wait for interaction with the dialog
repeat until the request gets satisfied
give up after some while and notify that fact
Does this seem reasonable? Would everyone hate this sort of passive behind-the-curtain popup behavior?
If anyone has other, better, or different ideas, I'm eager to hear your suggestions.
Thanks in advance,
~~~ 0;-Dan
I would use the desktop environment notification feature but give several warnings at timed intervals, including one saying "Final warning". You might think about also including an icon in the system tray that features an exclamation mark if a drive remains unattached which needs to be attached, to act as a permanent reminder once the warnings have been given and ignored.
Userland stuff (USBs, etc) are usually mounted at /media/user/something
Where fixed assets are at /mnt/ and not accessible to the user w\out elevated permissions/privs.
I would use the desktop environment notification feature but give several warnings at timed intervals, including one saying "Final warning". You might think about also including an icon in the system tray that features an exclamation mark if a drive remains unattached which needs to be attached, to act as a permanent reminder once the warnings have been given and ignored.
Very good suggestions.
Thank you for this effort,
~~~ 0;-Dan
...
Userland stuff (USBs, etc) are usually mounted at /media/user/something
Where fixed assets are at /mnt/ and not accessible to the user w\out elevated permissions/privs.
I'm aware of /mnt/* and /media/username/*.
Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
the USB hardware notices the new connection
a "which device" dance happens
an "its a disk" (of some sort) dance happens
things appear in /dev
something creates mount points
something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
... I could go on...
Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
the USB hardware notices the new connection
a "which device" dance happens
an "its a disk" (of some sort) dance happens
things appear in /dev
something creates mount points
something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
... I could go on...
Thanks in advance,
~~~ 0;-Dan
As far as I know, you can determine through the desktop environment whether or not removable devices are auto mounted.
For example, on my MATE system, there is the configuration item: org.mate.media-handling automount true
The actual mounting process, including deciding on the location, appears to be carried out by udisks (in the case of my system, udisks2).
I'm no expert and the following may not be totally correct but should be the basics of how things happen.
In a nutshell, when a USB device is plugged into a computer it goes through an enumeration process and if identified by the USB subsystem the appropriate driver is installed. A device is identified by its descriptors. In the case of a storage system the driver creates the device ID. Check out the link below.
Where and how it is mounted is dependent on the distribution/desktop. I'm not exactly sure how the desktop gets the message that a drive was inserted but I assume by some process communication like d-bus which is used by udisks. By convention these days external media is mounted at /media. Depending on distribution/desktop the mount point name is typically one of the following, volume name if it exists, UUID if it exists or by device ID.
The desktop itself should have a configuration setting that enables auto mounting as well as the mount options.
Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
the USB hardware notices the new connection
a "which device" dance happens
an "its a disk" (of some sort) dance happens
things appear in /dev
something creates mount points
something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
udev
and really, please at least try to do some research yourself before asking such questions.
...
and really, please at least try to do some research yourself before asking such questions.
Thank you for this reminder.
In my defense, I'd like to point out that having knowledge of system behavior and having any idea of the several names that it might be called are two distinctly different bases of knowledge. In addition, some behaviors and their supporting packages have been rapidly moving targets for several years -- even to the point of changes from one release to the next. In my specific case, the parts and packages and names for detecting connection of a device, loading drivers, making entries in /dev, connecting /dev entries with upper-level modules or components so that the end-user layers might access them, creating mount points when required, mounting drives, and so on, are a real boiling sea ... and thus not even include the issues of SysV-init vs. Upstart vs. Systemd and friends.
I expected to find prose of some sort that would walk me through the processing whereby one connects a device by USB, the crank turns, and an end-user mounted file system becomes available. That prose might continue to discuss how that process might be configured or altered by an admin end-user. When I did not find the prose that I sought, I asked questions.
I regret that my lack of knowledge resulted in questions for which answers should have been obvious to others who are better or differently informed. I regret, too, that "you just gotta know" and "read the code" are attitudes that continue to prevail in the Linux/Unix world.
If I understand. You want to prompt people to plug in a drive so that backups can happen? I'll say it. That is a terrible plan. Anytime manual intervention is required for a backup to happen then you will miss backups guaranteed! I don't even trust myself to plug in a drive when prompted. I do it all over the network. Hell I'm not even sure when my backups run, just know they fire daily. Relying on people / employees? to keep up with this is a bad idea all around. This should be fully automatic, preferably over the network to a NAS, cloud storage, anything that doesn't require anyone to follow a prompt. This prompt you happen to be trying to make very easy to ignore. Recipe for disaster is what this looks like to me. I don't mean to offend of course. There are a number of better ways to go about this.
Unless I misread your intent of course?
Last edited by jmgibson1981; 10-03-2018 at 04:52 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.