Manjaro Difference between revisions of "Openbox"

Difference between revisions of "Openbox"

From Manjaro
imported>Verityproductions
(Created page with "=Overview= The Openbox Window Manager is designed to be highly configurable and customisable. This includes the ability to create your own custom '''keybindings''' - that is ...")
 
(Marked this version for translation)
 
(16 intermediate revisions by 6 users not shown)
Line 1: Line 1:
=Overview=
<languages/>
__TOC__


The Openbox Window Manager is designed to be highly configurable and customisable. This includes the ability to create your own custom '''keybindings''' - that is combinations of key presses - to undertake virtually any action. This includes the ability to create keybindings that can be used to manually control the brightness of your screen.
<translate>
=Overview= <!--T:1-->


Although the Manjaro Openbox flavour provides a user-friendly graphical interface that may be used to alter or create custom keybindings, as the intention is to bind control of the screen brightness to the actual keys designed for this purpose, in this instance it will be necessary to manually edit the Openbox '''rc.xml''' file. This file - amongst other essential functions - serves to store and enable keybindings in the Openbox environment.
<!--T:2-->
The [http://openbox.org/wiki/Main_Page Openbox Window Manager] is designed to be highly configurable and customisable with extensive standards support.  




=Step 1: Opening the ''rc.xml'' File=
<!--T:3-->
[[File: Openbox-wm-18.jpg|left|600px]]
<div style="clear: both"></div>


{{Note|It is not necessary to use the 'sudo' or 'gksu' commands, as you already have full permission to edit and amend the ''rc.xml'' file.}}


=Installing Openbox= <!--T:4-->


You will need to first open your terminal in order to edit the ''rc.xml'' file. The syntax of the command to edit this is:
<!--T:5-->
For information on how to install a basic Openbox environment please review the [[Install_Desktop_Environments#Openbox|Openbox installation instructions]].


[text editor] ~/.config/openbox/rc.xml


=Adjusting keybindings= <!--T:6-->


For example, if you wish to edit the file within the terminal using nano (a standard terminal-based text editor) then enter:
<!--T:7-->
Openbox is built to be customized, and this includes the ability to create your own custom '''keybindings'''. These are combinations of key presses that may be used to undertake virtually any action, usually much faster and more directly than other means, such as by sifting through a menu. Although the Manjaro Openbox Edition provides a user-friendly graphical interface that may be used to alter or create custom keybindings, some combinations of special keys are not easily managed through this interface.


  nano ~/.config/openbox/rc.xml
<!--T:8-->
In this instance it will be necessary to manually edit the Openbox {{ic|rc.xml}} file. One of the many functions of this file is to store and enable keybindings in the Openbox environment. This file is located at {{ic|~/.config/openbox/rc.xml}} and you can edit it with a standard [[Viewing_and_editing_configuration_files|text editor]].


==Example: screen brightness== <!--T:9-->
Once the file has been opened, you will be presented with a substantial amount of commands contained within it. Don't worry about this, as you will only need to add a new block of code, rather than amend anything that is there. The code that must be added to enable full manual control over the screen brightness is as follows:


Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use a text editor like Gedit or Leafpad instead. This will create and open the 99-manjaro.rules file up as a document, making it easier to read and edit. To use Gedit instead, the command is:
    <!--T: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>


  gedit ~/.config/openbox/rc.xml
<!--T:11-->
{{warning|This code cannot just be placed anywhere in the file. It must be placed in a particular section in order to work. Please follow the instructions below to do so.}}
 
<!--T:12-->
To find the correct place to insert the above commands, it is recommended to use the '''Find''' or '''Search''' functions provided by your editor. If your text editor does not have the ability to search, it will be necessary to manually scroll down to about the mid-way point (perhaps using the '''Page Down''' key) to locate the following code:
 
<!--T:13-->
</keyboard>
 
<!--T:14-->
The overall section of the code should look like this:
 
    <!--T:15-->
</keybind>
    </keyboard>
  <mouse>
 
<!--T:16-->
Once located, the new code above can be inserted between the </keybind> and </keyboard> codes. Press <enter> after the </keybind> code to provide a space to do so. Below is an example where this has taken place. The new code inserted has been <font color="green">'''highlighted in green'''</font color> for illustrative purposes:
 
    <!--T:17-->
</keybind>
<font color="green">    <keybind key="XF86MonBrightnessUp"></font color>
<font color="green">      <action name="Execute"></font color>
<font color="green">        <command>xbacklight +10</command></font color>
<font color="green">      </action></font color>
<font color="green">    </keybind></font color>
<font color="green">    <keybind key="XF86MonBrightnessDown"></font color>
<font color="green">      <action name="Execute"></font color>
<font color="green">        <command>xbacklight -10</command></font color>
<font color="green">      </action></font color>
<font color="green">    </keybind></font color>
  </keyboard>
  <mouse>
 
<!--T:18-->
If the command "xbacklight +10" does nothing, find out the minimum value to put instead of 10 by trying to set the brightness to 20, then 40. You can use the following commands:
 
<!--T:19-->
* `xbacklight =X` to change the brightness, and
* `xbacklight -get` to see if the minimum value has been reached.
 
<!--T:20-->
Once you have made the necessary amendments to the file, save the changes and close it.
 
<!--T:21-->
Now logout and back in again for the changes to take effect.
 
 
==Example: volume keys (ALSA)== <!--T:22-->
 
<!--T:23-->
Once the file has been opened, you will be presented with a substantial amount of commands contained within it. Don't worry about this, as you will only need to add a new block of code, rather than amend anything that is there. The code that must be added to enable full manual control over the volume (i.e. to raise, lower, and mute it) is as follows:
 
    <!--T:24-->
<keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer set Master 10%+</command>
      </action>
  </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer set Master 10%-</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer set Master toggle</command>
      </action>
  </keybind>
 
<!--T:25-->
{{warning|This code cannot just be placed anywhere in the file. It must be placed in a particular section in order to work. Please follow the instructions below to do so.}}
 
<!--T:26-->
To find the correct place to insert the above commands, it is recommended to use the '''Find''' or '''Search''' functions provided by your editor. If your text editor does not have the ability to search, it will be necessary to manually scroll down to about the mid-way point (perhaps using the '''Page Down''' key) to locate the following code:
  </keyboard>
 
<!--T:27-->
The overall section of the code should look like this:
 
    <!--T:28-->
</keybind>
    </keyboard>
  <mouse>
 
<!--T:29-->
Once located, the new code above can be inserted between the </keybind> and </keyboard> codes. Press <enter> after the </keybind> code to provide a space to do so. Below is an example where this has taken place. The new code inserted has been <font color="green">'''highlighted in green'''</font color> for illustrative purposes:
 
    <!--T:30-->
</keybind>
<font color="green">    <keybind key="XF86AudioRaiseVolume"></font color>
<font color="green">      <action name="Execute"> </font color>
<font color="green">        <command>amixer set Master 10%+</command></font color>
<font color="green">      </action></font color>
<font color="green">  </keybind></font color>
<font color="green">    <keybind key="XF86AudioLowerVolume"></font color>
<font color="green">    <action name="Execute"></font color>
<font color="green">        <command>amixer set Master 10%-</command></font color>
<font color="green">      </action></font color>
<font color="green">    </keybind></font color>
<font color="green">    <keybind key="XF86AudioMute"></font color>
<font color="green">      <action name="Execute"> </font color>
<font color="green">        <command>amixer set Master toggle</command></font color>
<font color="green">      </action></font color>
<font color="green">  </keybind></font color>
  </keyboard>
  <mouse>
 
<!--T:31-->
Once you have made the necessary amendments to the file, save the changes and close it.
</translate>
 
[[Category:Contents Page{{#translation:}}]]
[[Category:Editions{{#translation:}}]]

Latest revision as of 18:15, 7 September 2021

Other languages:
English • ‎русский

Overview

The Openbox Window Manager is designed to be highly configurable and customisable with extensive standards support.


Openbox-wm-18.jpg


Installing Openbox

For information on how to install a basic Openbox environment please review the Openbox installation instructions.


Adjusting keybindings

Openbox is built to be customized, and this includes the ability to create your own custom keybindings. These are combinations of key presses that may be used to undertake virtually any action, usually much faster and more directly than other means, such as by sifting through a menu. Although the Manjaro Openbox Edition provides a user-friendly graphical interface that may be used to alter or create custom keybindings, some combinations of special keys are not easily managed through this interface.

In this instance it will be necessary to manually edit the Openbox rc.xml file. One of the many functions of this file is to store and enable keybindings in the Openbox environment. This file is located at ~/.config/openbox/rc.xml and you can edit it with a standard text editor.

Example: screen brightness

Once the file has been opened, you will be presented with a substantial amount of commands contained within it. Don't worry about this, as you will only need to add a new block of code, rather than amend anything that is there. The code that must be added to enable full manual control over the screen brightness is as follows:

    <keybind key="XF86MonBrightnessUp">
      <action name="Execute">
        <command>xbacklight +10</command>
      </action>
    </keybind>
    <keybind key="XF86MonBrightnessDown">
      <action name="Execute"> 
        <command>xbacklight -10</command>
      </action>
    </keybind>


Warning
This code cannot just be placed anywhere in the file. It must be placed in a particular section in order to work. Please follow the instructions below to do so.

To find the correct place to insert the above commands, it is recommended to use the Find or Search functions provided by your editor. If your text editor does not have the ability to search, it will be necessary to manually scroll down to about the mid-way point (perhaps using the Page Down key) to locate the following code:

</keyboard>

The overall section of the code should look like this:

    </keybind>
   </keyboard>
  <mouse>

Once located, the new code above can be inserted between the </keybind> and </keyboard> codes. Press <enter> after the </keybind> code to provide a space to do so. Below is an example where this has taken place. The new code inserted has been highlighted in green for illustrative purposes:

    </keybind>
     <keybind key="XF86MonBrightnessUp">
       <action name="Execute">
         <command>xbacklight +10</command>
       </action>
     </keybind>
     <keybind key="XF86MonBrightnessDown">
       <action name="Execute">
         <command>xbacklight -10</command>
       </action>
    </keybind>
  </keyboard>
  <mouse>

If the command "xbacklight +10" does nothing, find out the minimum value to put instead of 10 by trying to set the brightness to 20, then 40. You can use the following commands:

  • `xbacklight =X` to change the brightness, and
  • `xbacklight -get` to see if the minimum value has been reached.

Once you have made the necessary amendments to the file, save the changes and close it.

Now logout and back in again for the changes to take effect.


Example: volume keys (ALSA)

Once the file has been opened, you will be presented with a substantial amount of commands contained within it. Don't worry about this, as you will only need to add a new block of code, rather than amend anything that is there. The code that must be added to enable full manual control over the volume (i.e. to raise, lower, and mute it) is as follows:

   <keybind key="XF86AudioRaiseVolume">
     <action name="Execute"> 
       <command>amixer set Master 10%+</command>
     </action>
  </keybind>
   <keybind key="XF86AudioLowerVolume">
     <action name="Execute">
       <command>amixer set Master 10%-</command>
     </action>
   </keybind>
   <keybind key="XF86AudioMute">
     <action name="Execute"> 
       <command>amixer set Master toggle</command>
     </action>
  </keybind>


Warning
This code cannot just be placed anywhere in the file. It must be placed in a particular section in order to work. Please follow the instructions below to do so.

To find the correct place to insert the above commands, it is recommended to use the Find or Search functions provided by your editor. If your text editor does not have the ability to search, it will be necessary to manually scroll down to about the mid-way point (perhaps using the Page Down key) to locate the following code:

</keyboard>

The overall section of the code should look like this:

    </keybind>
   </keyboard>
  <mouse>

Once located, the new code above can be inserted between the </keybind> and </keyboard> codes. Press <enter> after the </keybind> code to provide a space to do so. Below is an example where this has taken place. The new code inserted has been highlighted in green for illustrative purposes:

    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute"> 
        <command>amixer set Master 10%+</command>
      </action>
   </keybind>
    <keybind key="XF86AudioLowerVolume">
     <action name="Execute">
        <command>amixer set Master 10%-</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute"> 
        <command>amixer set Master toggle</command>
      </action>
   </keybind>
  </keyboard>
  <mouse>

Once you have made the necessary amendments to the file, save the changes and close it.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.