Difference between revisions of "User:Chazza"

From ArchWiki
Jump to: navigation, search
(Desktop menu: cull desktop menu section)
m (add link to github)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[ArchWiki:Maintainers|ArchWiki Maintainer]]
 
[[ArchWiki:Maintainers|ArchWiki Maintainer]]
  
Hello all. I'm from the UK and I've been using Arch since mid 2013. See also, my [https://aur.archlinux.org/packages/?SeB=m&K=Chazza AUR packages].
+
Hello all. I'm from the UK and I've been using Arch since mid 2013. See also, my [https://aur.archlinux.org/packages/?SeB=m&K=Chazza AUR packages] and my [https://github.com/charlesbos GitHub].
 
 
== (Openbox) Keybinds ==
 
 
 
All keybinds must be added to the {{ic|~/.config/openbox/rc.xml}} file, and below the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading. Although a brief overview has been provided here, a more in-depth explanation of keybindings can be found at [http://openbox.org/wiki/Help:Bindings openbox.org]. {{AUR|obkey}} is a utility for adjust key-binding. Before using obkey, you should use obconf to create {{ic|~/.config/openbox/rc.xml}}.
 
 
 
=== Special keys ===
 
 
 
While the use of standard alpha-numeric keys for keybindings is self-explanatory, special names are assigned to other types of keys, such as {{ic|modifers}}, {{ic|multimedia}} keys and {{ic|navigation}} keys.
 
 
 
==== Modifiers ====
 
 
 
{{ic|Modifer}} keys play an important role in keybindings (e.g. holding down the {{ic|shift}} or {{ic|CTRL / control}} key in combination with another key to undertake an action). Using modifers helps to prevent conflicting keybinds, whereby two or more actions are linked to the same key or combination of keys. The syntax to use a modifer with another key is:
 
 
 
"<modifier>-<key>"
 
 
 
The modifer codes are as follows:
 
 
 
* {{ic|S}}: Shift
 
* {{ic|C}}: Control / CTRL
 
* {{ic|A}}: Alt
 
* {{ic|W}}: Super / Windows
 
* {{ic|M}}: Meta
 
* {{ic|H}}: Hyper (If it is bound to something)
 
 
 
For example, the code below would use {{ic|super}} and {{ic|t}} to launch {{Pkg|lxterminal}}
 
 
 
<keybind key="W-t">
 
    <action name="Execute">
 
        <command>lxterminal</command>
 
    </action>
 
</keybind>
 
 
 
==== Multimedia keys ====
 
 
 
Where available, it is possible to set the appropriate {{ic|multimedia}} keys to perform their intended functions, such as to control the volume and/or the screen brightness. These will usually be integrated into the {{ic|function}} keys, and are identified by their appropriate symbols. See [[Extra keyboard keys]] for details.
 
 
 
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):
 
 
 
* {{ic|XF86AudioRaiseVolume}}: Increase volume
 
* {{ic|XF86AudioLowerVolume}}: Decrease volume
 
* {{ic|XF86AudioMute}}: Mute / unmute volume
 
* {{ic|XF86MonBrightnessUp}}: Increase screen brightness
 
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness
 
 
 
Examples of how these may be used in {{ic|~/.config/openbox/rc.xml}} have been provided in the [[#Volume control]] section.
 
 
 
==== Navigation keys ====
 
 
 
These are the directional / arrow keys, usually used to move the cursor up, down, left, or right. The (self-explanatory) navigation codes are as follows:
 
 
 
* {{ic|Up}}: Up
 
* {{ic|Down}}: Down
 
* {{ic|Left}}: Left
 
* {{ic|Right}}: Right
 
 
 
=== Volume control ===
 
 
 
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.
 
 
 
==== ALSA ====
 
 
 
If [[ALSA]] is used for sound, the {{ic|amixer}} program can be used to adjust the volume, which is part of the {{Pkg|alsa-utils}} package. The following example - using the {{ic|multimedia}} keys intended to control the volume - will adjust the volume by +/- 5% (which may be changed, as desired):
 
 
 
<keybind key="XF86AudioRaiseVolume">
 
    <action name="Execute">
 
        <command>amixer set Master 5%+ unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioLowerVolume">
 
    <action name="Execute">
 
        <command>amixer set Master 5%- unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioMute">
 
    <action name="Execute">
 
        <command>amixer set Master toggle</command>
 
    </action>
 
</keybind>
 
 
 
==== Pulseaudio ====
 
 
 
Where using [[PulseAudio]] with [[ALSA]] as a backend, the {{ic|amixer}} program commands will have to be modifed, as illustrated below in comparison to the ALSA example:
 
 
 
<keybind key="XF86AudioRaiseVolume">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master 5%+ unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioLowerVolume">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master 5%- unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioMute">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master toggle</command>
 
    </action>
 
</keybind>
 
 
 
==== OSS ====
 
 
 
{{Note|This option may be suitable for more experienced users.}}
 
 
 
Where using [[OSS]], it is possible to create keybindings to raise or lower specific mixers. This allows, for example, the volume of a specific application (such as an audio player) to be changed without changing the overall system volume settings in turn. In this instance, the application must first have been [[OSS#Configuring_Applications_for_OSS|configured]]  to use its own mixer.
 
 
 
In the following example, [[MPD]] has been configured to use its own mixer - also named {{ic|mpd}} - to increase and decrease the volume by a single decibel at a time. The {{ic|--}} that appears after the {{ic|ossmix}} command has been added to prevent a negative value from being treated as an argument:
 
 
 
<keybind key="[chosen keybind]">
 
    <action name="Execute">
 
        <command>ossmix -- mpd +1</command>
 
    </action>
 
</keybind>
 
<keybind key="[chosen keybind]">
 
    <action name="Execute">
 
        <command>ossmix -- mpd -1</command>
 
    </action>
 
</keybind>
 
 
 
=== Media player control ===
 
 
 
The {{AUR|playerctl}} command-line utility can be used to bind multimedia keys to player actions. It should work with most media players.
 
 
 
<keybind key="XF86AudioPlay">
 
    <action name="Execute">
 
        <command>playerctl play</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioPause">
 
    <action name="Execute">
 
        <command>playerctl pause</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioNext">
 
    <action name="Execute">
 
        <command>playerctl next</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioPrev">
 
    <action name="Execute">
 
        <command>playerctl previous</command>
 
    </action>
 
</keybind>
 
 
 
=== Brightness control ===
 
 
 
The {{ic|xbacklight}} program is used to control screen brightness, which is part of the [[Xorg]] X-Window system. In the example below, the {{ic|multimedia}} keys intended to control the screen brightness will adjust the settings by +/- 10%:
 
 
 
<keybind key="XF86MonBrightnessUp">
 
      <action name="Execute">
 
        <command>xbacklight +10</command>
 
      </action>
 
</keybind>
 
<keybind key="XF86MonBrightnessDown">
 
      <action name="Execute">
 
        <command>xbacklight -10</command>
 
      </action>
 
</keybind>
 
 
 
=== Window snapping ===
 
 
 
Many desktop environments and window managers support ''window snapping'' (e.g. Windows 7 Aero snap), whereby they will automatically snap into place when moved to the edge of the screen. This effect can also be simulated in Openbox through the use of keybinds on focused windows.
 
 
 
As illustrated in the example below, percentages must be used to determine window sizes (see [http://openbox.org/wiki/Help:Actions openbox.org] for further information). In this instance, The {{ic|super}} key is used in conjunction with the {{ic|navigation}} keys:
 
 
 
<keybind key="W-Left">
 
    <action name="UnmaximizeFull"/>
 
    <action name="MaximizeVert"/>
 
    <action name="MoveResizeTo">
 
        <width>50%</width>
 
    </action>
 
    <action name="MoveToEdge"><direction>west</direction></action>
 
</keybind>
 
<keybind key="W-Right">
 
    <action name="UnmaximizeFull"/>
 
    <action name="MaximizeVert"/>
 
    <action name="MoveResizeTo">
 
        <width>50%</width>
 
    </action>
 
    <action name="MoveToEdge"><direction>east</direction></action>
 
</keybind>
 
 
 
However, it should be noted that once a window has been 'snapped' to an edge, it will remain vertically maximised unless subsequently maximised and then restored. The solution is to implement additional keybinds - in this instance using the {{ic|down}} and {{ic|up}} keys - to do so. This will also make pulling 'snapped' windows from screen edges faster as well:
 
 
 
<keybind key="W-Down">
 
    <action name="Unmaximize"/>
 
</keybind>
 
<keybind key="W-Up">
 
    <action name="Maximize"/>
 
</keybind>
 
 
 
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap-git}} are also available to automatically simulate window snapping behaviour without the use of keybinds.
 

Latest revision as of 11:08, 28 September 2017

ArchWiki Maintainer

Hello all. I'm from the UK and I've been using Arch since mid 2013. See also, my AUR packages and my GitHub.