LINUX.ORG.RU

помогите настроить команду при нажатии клавишы

 , , ,


1

1

Добрый день, Вам! Прошу помочь решить проблему: Есть ноутбук Dell latitude xt2l. Он сенсорный и поворот экрана играет большую роль в работе. На винде для этого есть специальная клавиша на передней панели. В Gnome Shell на Ubuntu 13.04 для этого приходится каждый раз лазить в настройки, что довольно неудобно. Решил оживить эту функцию + добавить на соседнюю клавишу(тоже неработающую) функцию возврата в нормальную ориентацию. Сейчас при нажатии данной клавиши выводит пиктограмму окна с крестиком в нижнем левом углу. Проверил работу команды:

xrandr -o left
- в терминале работает. Нашел статью статью. После ввода xev терминал выдал мне:
gor@gor-Latitude-XT2:~$ xev
Outer window is 0x3400001, inner window is 0x3400002

PropertyNotify event, serial 8, synthetic NO, window 0x3400001,
    atom 0x27 (WM_NAME), time 991341, state PropertyNewValue

PropertyNotify event, serial 9, synthetic NO, window 0x3400001,
    atom 0x22 (WM_COMMAND), time 991341, state PropertyNewValue

PropertyNotify event, serial 10, synthetic NO, window 0x3400001,
    atom 0x28 (WM_NORMAL_HINTS), time 991341, state PropertyNewValue

CreateNotify event, serial 11, synthetic NO, window 0x3400001,
    parent 0x3400001, window 0x3400002, (10,10), width 50, height 50
border_width 4, override NO

PropertyNotify event, serial 14, synthetic NO, window 0x3400001,
    atom 0x160 (WM_PROTOCOLS), time 991341, state PropertyNewValue

MapNotify event, serial 15, synthetic NO, window 0x3400001,
    event 0x3400001, window 0x3400002, override NO

ConfigureNotify event, serial 18, synthetic NO, window 0x3400001,
    event 0x3400001, window 0x3400001, (0,0), width 178, height 178,
    border_width 0, above 0x4a007b0, override NO

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x208 (_NET_WM_ALLOWED_ACTIONS), time 991342, state PropertyNewValue

ReparentNotify event, serial 18, synthetic NO, window 0x3400001,
    event 0x3400001, window 0x3400001, parent 0x140294a,
    (0,0), override NO

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x168 (_NET_WM_DESKTOP), time 991359, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x168 (_NET_WM_DESKTOP), time 991359, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x165 (_NET_FRAME_EXTENTS), time 991359, state PropertyNewValue

ConfigureNotify event, serial 18, synthetic NO, window 0x3400001,
    event 0x3400001, window 0x3400001, (10,36), width 178, height 178,
    border_width 0, above 0x0, override NO

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x192 (WM_STATE), time 991359, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x3400001,
    atom 0x16e (_NET_WM_STATE), time 991359, state PropertyNewValue

ConfigureNotify event, serial 20, synthetic YES, window 0x3400001,
    event 0x3400001, window 0x3400001, (1,137), width 178, height 178,
    border_width 2, above 0x0, override NO

MapNotify event, serial 20, synthetic NO, window 0x3400001,
    event 0x3400001, window 0x3400001, override NO

VisibilityNotify event, serial 20, synthetic NO, window 0x3400001,
    state VisibilityUnobscured

Expose event, serial 20, synthetic NO, window 0x3400001,
    (0,0), width 178, height 10, count 3

Expose event, serial 20, synthetic NO, window 0x3400001,
    (0,10), width 10, height 58, count 2

Expose event, serial 20, synthetic NO, window 0x3400001,
    (68,10), width 110, height 58, count 1

Expose event, serial 20, synthetic NO, window 0x3400001,
    (0,68), width 178, height 110, count 0

PropertyNotify event, serial 20, synthetic NO, window 0x3400001,
    atom 0x16e (_NET_WM_STATE), time 991365, state PropertyNewValue

FocusIn event, serial 20, synthetic NO, window 0x3400001,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 20, synthetic NO, window 0x0,
    keys:  0   0   0   0   16  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

PropertyNotify event, serial 20, synthetic NO, window 0x3400001,
    atom 0x16e (_NET_WM_STATE), time 991365, state PropertyNewValue

PropertyNotify event, serial 33, synthetic NO, window 0x3400001,
    atom 0x16e (_NET_WM_STATE), time 991407, state PropertyNewValue

KeyRelease event, serial 33, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 991429, (526,140), root:(529,279),
    state 0x4000, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

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

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

KeymapNotify event, serial 36, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

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

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

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

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

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

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

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

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

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

EnterNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000417, (176,25), root:(179,164),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus YES, state 16384

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

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000417, (176,25), root:(179,164),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000425, (171,25), root:(174,164),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000435, (166,24), root:(169,163),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000441, (162,23), root:(165,162),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000449, (158,23), root:(161,162),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000457, (154,22), root:(157,161),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000465, (151,22), root:(154,161),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000473, (148,21), root:(151,160),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000481, (145,21), root:(148,160),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000489, (142,20), root:(145,159),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000497, (139,20), root:(142,159),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000505, (136,19), root:(139,158),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000513, (132,18), root:(135,157),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000521, (128,17), root:(131,156),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000529, (123,16), root:(126,155),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000537, (119,14), root:(122,153),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000545, (117,14), root:(120,153),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000553, (115,13), root:(118,152),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000561, (112,12), root:(115,151),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000569, (111,12), root:(114,151),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000785, (110,13), root:(113,152),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000801, (112,15), root:(115,154),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000817, (114,17), root:(117,156),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000825, (115,18), root:(118,157),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000841, (117,20), root:(120,159),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000857, (118,22), root:(121,161),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000873, (119,23), root:(122,162),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000889, (120,24), root:(123,163),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000897, (121,25), root:(124,164),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000913, (123,27), root:(126,166),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000921, (124,28), root:(127,167),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000937, (125,29), root:(128,168),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000945, (126,30), root:(129,169),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000953, (128,32), root:(131,171),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000961, (128,33), root:(131,172),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000969, (128,34), root:(131,173),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000977, (130,37), root:(133,176),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000985, (131,38), root:(134,177),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1000993, (133,40), root:(136,179),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001003, (136,42), root:(139,181),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001009, (138,43), root:(141,182),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001017, (141,45), root:(144,184),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001025, (144,47), root:(147,186),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001033, (146,48), root:(149,187),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001041, (148,50), root:(151,189),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001049, (151,52), root:(154,191),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001057, (153,53), root:(156,192),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001065, (155,55), root:(158,194),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001073, (158,58), root:(161,197),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001081, (161,60), root:(164,199),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001089, (163,62), root:(166,201),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001096, (166,65), root:(169,204),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001105, (169,67), root:(172,206),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001113, (172,70), root:(175,209),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001121, (175,72), root:(178,211),
    state 0x4000, is_hint 0, same_screen YES

LeaveNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1001129, (178,74), root:(181,213),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus YES, state 16384

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

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

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

EnterNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003208, (177,5), root:(180,144),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus YES, state 16384

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

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003208, (177,5), root:(180,144),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003287, (176,4), root:(179,143),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003303, (175,3), root:(178,142),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003311, (175,1), root:(178,140),
    state 0x4000, is_hint 0, same_screen YES

MotionNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003319, (174,0), root:(177,139),
    state 0x4000, is_hint 0, same_screen YES

LeaveNotify event, serial 36, synthetic NO, window 0x3400001,
    root 0x83, subw 0x0, time 1003327, (173,-2), root:(176,137),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus YES, state 16384

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

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

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

ClientMessage event, serial 36, synthetic YES, window 0x3400001,
    message_type 0x160 (WM_PROTOCOLS), format 32, message 0x15e (WM_DELETE_WINDOW)
gor@gor-Latitude-XT2:~$ 
Я так понял что код клавиши 36, но что дальше делать не понимаю, объясните пожалуйста. Может есть более простой способ сделать это?



Последнее исправление: CYB3R (всего исправлений: 2)

В настройках клавиатуры - shortcuts - custom shortcuts. В гноме есть настройки! Шок, скандал, 42 фото

goingUp ★★★★★
()
Ответ на: комментарий от goingUp

а вот и не помогает. Думаете не пробовал. Вот мои настройки в скрине. Верхнее попытка настроить клавишу поворота, нижняя - соседняя клавиша. При нажатии ни на одну из них экран не поворачивается. Если поможете - буду очень благодарен

badazimer
() автор топика

есть еще надежда на AutoKey - когда далаю на данную клавишу действие - пиктограмка при нажатии не появляется. Правда я не знаю Питона для создания скрипта xrandr -o left.

Между прочим AutoKey говорит что номер клавиши - 199

badazimer
() автор топика
Ответ на: комментарий от badazimer

в этой программе с помощью скрипта

import subprocess
subprocess.call(['xdg-open', '/home/gor'])
смог заставить эту кнопку домашнюю папку. Может кто подскажет каким скриптом запустить команду в терминале?

badazimer
() автор топика
Ответ на: комментарий от badazimer

У меня именно так настроено переключение звука между колонками и наушниками, все работает. Попробуйте установить что именно не работает - поставить другой хоткей или вписать команду попроще (у меня кстати прописан полный путь к скрипту).

goingUp ★★★★★
()
Ответ на: комментарий от badazimer

Вряд ли дело в том, что у меня скрипт. Попробуйте назначить другой хоткей или прописать полный путь к xrandr (/usr/bin/xrandr)

goingUp ★★★★★
()
Ответ на: комментарий от goingUp

в простом виде - xrandr -o left - да, работает отлично

badazimer
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.