eonpatapon / mpDris2

MPRIS V2.1 support for mpd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can this work on the tty shell?

i30817 opened this issue · comments

Without ever entering 'gnome session proper, or is that asking too much? I'm interested in using it in this mode and the fact it's using systemd gives me some hope that gnome is not hardwired in the multimedia keys support, much like mpd is not bound to a gnome session and runs fine from a tty.

At its core, mpDris2 is a translator between the MPD protocol and the D-Bus based MPRIS protocol. There's nothing GNOME-related or even systemd-related in that.

So yes, it'll run fine without X11, without GNOME, and without a tty for that matter.

However, if you want to use the additional [Bling] features such as notifications or hotkeys, you'll need an environment that provides compatible notification or hotkey APIs – mpDris2 will not directly print notifications to a tty and it will not directly read key events from evdev.

One of the several dozen libnotify (org.freedesktop.Notifications) providers is required for the notifications, and only the gnome-settings-daemon "media key" API is supported for the hotkeys.

So i guess the question is 'can gnome-settings-daemon run outside of a gnome-shell session and not blow up the shell when started if yes'?

I think it's unlikely. Maybe a project could be started a 'media keys notification daemon' that only does anything on a login tty for this...

No, especially not in 3.18+ where it completely depends on gnome-shell.

Why do you need gnome-settings-daemon specifically? If you need hotkeys on a general X11 session, install xbindkeys/sxhkd and bind something to mpc pause and mpc next. If you need hotkeys on a bare tty console, no GNOME tools would help anyways as they work completely differently.

I don't need it specifically. I just wanted the multimedia keys to be available outside of gnome, in the TTY, preferably with a easy path to creating a config (probably with systemd) where it's only active on TTYs, not after mode switch to the actual gnome with alt+ctrl+fkey.

Good hints about those, but i'm actually using wayland, not sure if they'd work. I guess i'm trying.

edit: i forgot about the 'only one notification daemon at a time' rule - that definitely makes it unfeasible to share with both gnome and a TTY open - i guess.

You wouldn't have to worry about the TTY hotkeys affecting the graphical interface, the console TTY's keyboard handling and the X11 (and I'm sure Wayland) display manager's keyboard handling are completely separate.

When you're on a console VT the kernel does the input handling. When you're on a graphical terminal libinput is in charge, and it sits directly on the /dev/input/ hardware devices. That's why remappings from loadkeys or setkeycodes on the console don't affect X / Wayland, and why setxkbmap and the like can't remap your console keys.

Point is, the moment you hit Alt+# in the console to switch to a graphical term, it stops listening to all keyboard input (except maybe Ctrl+Alt+Del). Even Ctrl+Alt+# is handled by the display server, to switch you back to a console term.

(Way, way more detail on that, courtesy StackExchange.)