sddm / sddm

QML based X11 and Wayland display manager
GNU General Public License v2.0
1.88k stars 328 forks source link

Add a command to play a sound when sddm is ready. #613

Open markg85 opened 8 years ago

markg85 commented 8 years ago

Hi,

You know these sounds. Windows has them when your computer starts and it arrives at the login screen. Ubuntu has them with whatever login manager they use these days (lightdm?). Mac has it..

It would be very nice if SDDM would get support for this as well. It could probably be a new sddm command in QML like "sddm.play("/some/file.wav")" however, that would give you the pain of actually playing a sound file from within QML or C++.. It could work (and probably will for most), but having a command possibility (like you can set a command for halt and reboot) would probably be the most flexible way to implement this.

As a side note. In QML there is the Audio component: http://doc.qt.io/qt-5/qml-qtmultimedia-audio.html themes could probably use that and accomplish what i'm requesting

Cheers, Mark

jleclanche commented 8 years ago

I'd be ok to approve a PR with a setting that adds an Audio.LoginReady path and plays that.

@plfiorini good on your side too?

ellisistfroh commented 8 years ago

Does this mean then we get a sound when SDDM is up and fine AND anotherone when KDE is up and fine. I always thought this DM wishes to remain _Simple_DDM.

Ubuntu for example had just a few release turned off their beloved drum-shake-sound (african?) for several reasons. It can be activated by request wt some command-line knowledge. And please: Linux/FOSS should never ever try to imitate/mimic W$. And the sound there come exactely when? Surely not at the login-screen. Don't know if Mate or LXQt do have that already?

jleclanche commented 8 years ago

Easy there, it's a setting.

ellisistfroh commented 8 years ago

Well, that had to exspected, then. In general (don't like that wording) this is a task to be considered for a DE (desktop-environment) rather than a DM (display-manager). The lesser there is to be exposed the better.

Good to know, that Qt evolves into that direction, it could probably give me a chance to evolve a sound theme (very personal, called "Alley-Cat" (197x) – got to check on DRM).

I love closed bug-reports: Can we close this one w/o hurting?

jleclanche commented 8 years ago

@ellisistfroh Again, it's a setting. Playing a sound when the DM is ready is a fine request and it doesn't cost much.

We're not talking about actually picking a sound, adding it into git and playing it automatically, just adding a line in the config file for the sake of users that want it.

Please stop now.

Tynach commented 8 years ago

This would be very helpful for knowing when the computer is ready for me to start typing my password. Sometimes it's ready when my monitor is still 'off' (it switches off then back on when it goes from the boot splash to SDDM), and I've sometimes tried timing it so I can type my password before it comes up... But usually I end up typing half of my password.

A rather silly and pointless thing for me to do, but I imagine there are real use cases where you're busy with other things (perhaps having multiple devices around you) and want an easy way to know the instant a computer is ready to be logged into.

Unrelated: I couldn't find a setting in KDE for playing a sound when logged into either. Not that I particularly need/want one, but for similar reasons as above someone might find it handy.

I'd try programming it myself, except I haven't the slightest idea where to start. I barely know how to use Qt Creator, and I'm not familiar with the SDDM codebase.

vlig commented 8 years ago

I found a SDDM theme named LainWired here. It has audio files and in Main.qml there are Audio sections. No sound after boot, but sounding after sddm-greeter --theme /usr/share/sddm/themes/lain-wired/ from working KDE5. I guess there is no access to soundcard from clean SDDM?

plfiorini commented 8 years ago

QtMultimedia probably needs pulseaudio running with the systemd user session and requires GStreamer which is tons of dependencies. That said GStreamer is probably already available in any desktop distro. Running pulseaudio automatically might be tricky but it might turn out not to be a requirement for QtMultimedia. Then there is access to the home directory from the sddm user.

The first step to get this feature into SDDM is to make a simple theme that plays a sound from an accessible path like /usr/share/whatever and check if it gets player.

If it works it means it's relatively easy to add a new setting in the theme and make SDDM play it.