Associare il tasto win per aprire menu in KDE 4.xx

tasto_win_kde
KDE nella versioni inferiori alla 5 (ovvero della famiglia 4.xx) non permette – ricorrendo al pannello di controllo – di associare in modo esclusivo il tasto win (detto anche meta o super L) per aprire il menù principale del desktop enviroment, ossia il kickoff menù; in quest’articolo vedremo come fare se si utilizza una versione dell’ambiente desktop inferiore alla 5.

Una possibile soluzione sarebbe quella di associare il tasto ad uno “virtuale”, ad esempio F13 che a sua volta andrà utilizzato per aprire il menù; anzitutto utilizziamo l’utility xev fornita da xorg e pertanto utilizzabile su qualunque distribuzione linux che implementi tale versione dell’X window system per ricavare il keycode associato al tasto. Alla pressione del tasto verrà fuori qualcosa di simile:

Outer window is 0x4800001, inner window is 0x4800002

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

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

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

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

PropertyNotify event, serial 13, synthetic NO, window 0x4800001,
    atom 0x1e3 (_KDE_NET_WM_USER_CREATION_TIME), time 99654, state PropertyNewValue

PropertyNotify event, serial 14, synthetic NO, window 0x4800001,
    atom 0x13d (WM_PROTOCOLS), time 99655, state PropertyNewValue

MapNotify event, serial 15, synthetic NO, window 0x4800001,
    event 0x4800001, window 0x4800002, override NO

ConfigureNotify event, serial 20, synthetic NO, window 0x4800001,
    event 0x4800001, window 0x4800001, (0,0), width 178, height 178,
    border_width 0, above 0x3800012, override NO

ReparentNotify event, serial 20, synthetic NO, window 0x4800001,
    event 0x4800001, window 0x4800001, parent 0x2000519,
    (0,0), override NO

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x1dc (_KDE_NET_WM_ACTIVITIES), time 99658, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x14b (_NET_WM_STATE), time 99658, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x145 (_NET_WM_DESKTOP), time 99686, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x142 (_NET_FRAME_EXTENTS), time 99688, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x191 (_KDE_NET_WM_FRAME_STRUT), time 99688, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x1c9 (_NET_WM_ALLOWED_ACTIONS), time 99688, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x14b (_NET_WM_STATE), time 99688, state PropertyNewValue

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

VisibilityNotify event, serial 20, synthetic NO, window 0x4800001,
    state VisibilityFullyObscured

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x165 (WM_STATE), time 99694, state PropertyNewValue

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

KeymapNotify event, serial 20, 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   

ConfigureNotify event, serial 20, synthetic YES, window 0x4800001,
    event 0x4800001, window 0x4800001, (735,26), width 178, height 178,
    border_width 0, above 0x0, override NO

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x1dc (_KDE_NET_WM_ACTIVITIES), time 99694, state PropertyNewValue

PropertyNotify event, serial 20, synthetic NO, window 0x4800001,
    atom 0x14b (_NET_WM_STATE), time 99694, state PropertyNewValue

VisibilityNotify event, serial 31, synthetic NO, window 0x4800001,
    state VisibilityUnobscured

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

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

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

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

PropertyNotify event, serial 31, synthetic NO, window 0x4800001,
    atom 0x1c7 (_NET_WM_ICON_GEOMETRY), time 99718, state PropertyNewValue

KeyPress event, serial 32, synthetic NO, window 0x4800001,
    root 0xaa, subw 0x0, time 100638, (-250,226), root:(485,252),
    state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x4800001,
    root 0xaa, subw 0x0, time 100706, (-250,226), root:(485,252),
    state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

La parte del testo che ci interessa è keycode 133 il codice associato al tasto. Esso varia a seconda del modello di tastiera in uso, a quella italiana corrisponde il 133. Tutto quello che dobbiamo fare è creare uno script bash, da inserire nel percorso:

/home/nomeutente/.kde4/

Alternativamente anche:

home/nomeutente/.kde4/Autostart

Creaimo dunque lo script, avvalendoci di i xmodmap

#!/bin/bash
xmodmap -e 'keycode 133 = F13'

Ora, dopo aver aperto il menù kickoff di KDE andiamo in impostazioni di sistema –—–> scorciatoie e gesti —–> scorciatoie globali della tastiera—-> selezioniamo dal menù a tendina “componente di KDE” —–>Shell del desktop di Plasma ——> andiamo su  Attiva oggetto menù dell’avviatore di applicazioni ed infine impostiamo il tasto, come da seguente screenshot:

kde_scorciatoie_globali_tastiera

Basterà poi riavviare X.Org e KDE ed il collegamento funzionerà. Altra alternativa è quello di installare il pacchetto ksuperkey, un’estensione di KDE, per le versioni inferiori alla 5.8; per questa e le successive invece essa sarà già presente di default.

Seguiteci anche su Facebook, Google Plus, Tumblr, Twitter e Telegram, per restare sempre in contatto con noi e con le nostre guide.



Cerca

Seguici

Live da Facebook
Live da Twitter
Seguici su Telegram
Canale InsiDevCode Telegram