0

I've tried both the keyboard shortcut and xdotool to send some media commands(details attached below), but it doesn't seem to work with big alerting icon showing in the middle of the screen.

The big alerting icon shown after I send the media commands

I'm using Ubuntu GNOME 16.04 LTS. What should I do to fix it? Thank you.


Keyboard shortcuts that don't work:

"Sound and Media" Play
"Sound and Media" Next
"Sound and Media" Pause

Simulate AudioNext in terminal doesn't work either:

$ xdotool key XF86AudioNext

However XF86AudioPlay does work with xdotool

$ xdotool key XF86AudioPlay


I also use xev to show the key events for debug.

With "Sound and Media" Play shortcut set to Ctrl+Shift+Alt+Z, the following messages are shown.

The last one, Z, does not appear. Instead, FocusOut event, FocusIn event, and KeymapNotify event are shown.

KeyPress event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4802102, (76,-21), root:(571,868),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4802910, (76,-21), root:(571,868),
    state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4803598, (76,-21), root:(571,868),
    state 0xc, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 36, synthetic NO, window 0x2a00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 36, synthetic NO, window 0x2a00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 36, synthetic NO, window 0x0,
    keys:  2   0   0   0   32  0   4   0   1   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4811094, (76,-21), root:(571,868),
    state 0xd, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4811118, (76,-21), root:(571,868),
    state 0xc, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
    root 0x124, subw 0x0, time 4811182, (76,-21), root:(571,868),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

ClientMessage event, serial 36, synthetic YES, window 0x2a00001,
    message_type 0x11f (WM_PROTOCOLS), format 32, message 0x11d (WM_DELETE_WINDOW)
  • The Z key is event is probably consumed by gnome before it is propagated to xev. Which media players did you try? Maybe they don't support the next/pause command. XF86AudioPlay should also pause when media is playing. – danzel Jul 13 '18 at 9:03
  • @danzel My keyboard doesn't have media keys, so I'm using a GNOME extension, Media keys. I use a Chrome extension "YouTube Music Control" to receive the media key command. I gave xdotool another try today. XF86AudioPlay does the play/pause function fine. XF86AudioNext and XF86AudioMute do work today (I rebooted my compuer). XF86AudioPrev still shows a big icon. System shortcuts still fail (play/pause/next/prev) with the icon. – Chiu Jul 16 '18 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.