*Guida a CrunchBang - Scorciatoie da tastiera

Scorciatoie da tastiera

Per sveltire il lavoro è possibile configurare la tastiera affinché una combinazione di tasti dia avvio ad applicazioni od alla esecuzione di funzioni/azioni, come espellere un CD dal lettore. Anche in questo caso, modificare le scorciatoie basta richiede la modifica di un file testuale. Si tratta di una modifica delicata, ma tutto sommato semplice. Si tratta di modificare un file XML seguendo questi passaggi:

  1. Aprite il menù principale (Super + Win)
  2. Recatevi sulla voce "Settings", poi spostatevi su "Openbox" e quindi cliccate su "Edit rc.xml"
  3. Si aprirà la pagina di Geany. In essa recatevi alla sezione riguardante la tastiera (keyboard), come indicato in figura (1)

    *

  4. Per aggiungere una nuova scorciatoia, occorre anzitutto definire cosa deve fare. In questo esempio produrrò una scorciatoia per espellere un CD dal lettore.
  5. Ho copiato una keybind della sezione "Keybindings for running applications" e l'ho modificata come segue:
    1. Nella parte <keybind key=""> (2) ho aggiunto tra le virgolette la combinazione di tasti (C che sta per Ctrl ed e) in modo che apparisse in questo modo: <keybind key="C-e">
    2. Ho lasciato identica le sezioni <action name="Execute">, <enabled>true
    3. Nella sezione <command></command> ho inserito il comando "eject", in modo che apparisse così: <command></command>
    4. Alla fine il blocco della keybind appariva in questo modo:
      
            <keybind key="C-e">
            <action name="Execute">
              <startupnotify>
                <enabled>true</enabled>
                <name>Run Program</name>
              </startupnotify>
              <command>eject</command>
            </action>
            </keybind>
    5. Ho quindi copiato il blocco e l'ho incollato nella parte finale della sezione "keyboard"
    6. Ho salvato e poi ho riavviato Openbox:

      Menù (Win+Barra spaziatrice) → Settings → Openbox &rarr: Restart

    7. Ho premuto i tasti Ctrl + e e si è aperto il cassetto del lettore CD
  6. Chiudete Geany
Ecco qui sotto come appare la sezione "keyboard" nel file rx.xml di CrunchBang. Studiatevelo bene per poterlo modificare correttamente:

<keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <!-- Keybindings for desktop switching -->
    <keybind key="C-A-Left">
      <action name="DesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Right">
      <action name="DesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Up">
      <action name="DesktopUp">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Down">
      <action name="DesktopDown">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Left">
      <action name="SendToDesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Right">
      <action name="SendToDesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Up">
      <action name="SendToDesktopUp">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Down">
      <action name="SendToDesktopDown">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="W-F1">
      <action name="Desktop">
        <desktop>1</desktop>
      </action>
    </keybind>
    <keybind key="W-F2">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
    </keybind>
    <keybind key="W-F3">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
    </keybind>
    <keybind key="W-F4">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <!-- Keybindings for windows -->
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="A-Escape">
      <action name="Lower"/>
      <action name="FocusToBottom"/>
      <action name="Unfocus"/>
    </keybind>
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>
    <keybind key="Print">
      <action name="Execute">
        <execute>xfce4-screenshooter</execute>
      </action>
    </keybind>
    <keybind key="A-Print">
      <action name="Execute">
        <execute>scrot '%Y-%m-%d--%s_$wx$h_scrot.png'... ~/images/$f'</execute>
      </action>
    </keybind>
    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow"/>
    </keybind>
    <keybind key="C-A-Tab">
      <action name="NextWindow">
        <panels>yes</panels>
        <desktop>yes</desktop>
      </action>
    </keybind>
    <!-- Keybindings for running applications -->
    <keybind key="A-F2">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Run Program</name>
        </startupnotify>
        <command>gmrun</command>
      </action>
    </keybind>
    <keybind key="A-F3">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>dmenu-bind</name>
        </startupnotify>
        <command>~/.config/dmenu/dmenu-bind.sh</command>
      </action>
    </keybind>
    <keybind key="W-f">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>thunar</name>
        </startupnotify>
        <command>thunar</command>
      </action>
    </keybind>
    <keybind key="W-t">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Terminal</name>
        </startupnotify>
        <command>terminator</command>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Web Browser</name>
        </startupnotify>
        <command>x-www-browser</command>
      </action>
    </keybind>
    <keybind key="W-l">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Lock screen</name>
        </startupnotify>
        <command>cb-lock</command>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Editor</name>
        </startupnotify>
        <command>geany</command>
      </action>
    </keybind>
    <keybind key="W-m">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Mediaplayer</name>
        </startupnotify>
        <command>vlc</command>
      </action>
    </keybind>
    <keybind key="W-v">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Volume</name>
        </startupnotify>
        <command>xfce4-mixer</command>
      </action>
    </keybind>
    <keybind key="W-x">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Logout</name>
        </startupnotify>
        <command>cb-exit</command>
      </action>
    </keybind>
    <keybind key="W-Tab">
      <action name="ShowMenu">
        <menu>client-list-combined-menu</menu>
      </action>
    </keybind>
    <keybind key="W-space">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="A-C-q">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
  </keyboard>

Precedente | Indice | Successiva

Torna in alto