You are not logged in.

#1 2015-02-11 13:04:40

Mr_ED-horsey
Member
From: Portland, OR
Registered: 2011-04-06
Posts: 177

[solved] Map oblogout to poweroff button on Acer C720 Chromebook?

It's set by default to Super+X, but every time I miss the backspace button I accidentally hit that button and end up turning my computer off. I'm using Openbox and tried it with obkey and directly editing my rc.xml file, but it still turns off my laptop when it's pressed. I had a similar issue with search button not being able to launch dmenu on it's own, but hitting Super+space was a decent compromise, but unintentionally force shutting down my laptop isn't something I'm prepared to live with. All I want it to do is pop up my oblogout screen when hit the power off button (the key is F12) so I can cancel the shut down in case it's unintentionally it.

Any help with this would be much appreciated.I searched Google, the Archwiki and the forums and couldn't really find a solution for the problem.

Contents of rc.xml:

<openbox_config xmlns="http://openbox.org/3.4/rc">
  <resistance>
    <strength>10</strength>
    <screen_edge_strength>20</screen_edge_strength>
  </resistance>
  <focus>
    <focusNew>yes</focusNew>
    <!-- always try to focus new windows when they appear. other rules do
apply -->
    <followMouse>no</followMouse>
    <!-- move focus to a window when you move the mouse into it -->
    <focusLast>yes</focusLast>
    <!-- focus the last used window when changing desktops, instead of the one
under the mouse pointer. when followMouse is enabled -->
    <underMouse>no</underMouse>
    <!-- move focus under the mouse, even when the mouse is not moving -->
    <focusDelay>200</focusDelay>
    <!-- when followMouse is enabled, the mouse must be inside the window for
this many milliseconds (1000 = 1 sec) before moving focus to it -->
    <raiseOnFocus>no</raiseOnFocus>
    <!-- when followMouse is enabled, and a window is given focus by moving the
mouse into it, also raise the window -->
  </focus>
  <placement>
    <policy>UnderMouse</policy>
    <!-- 'Smart' or 'UnderMouse' -->
    <center>yes</center>
    <!-- whether to place windows in the center of the free area found or
the top left corner -->
    <monitor>Active</monitor>
    <!-- with Smart placement on a multi-monitor system, try to place new windows
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
the active window is -->
    <primaryMonitor>1</primaryMonitor>
    <!-- The monitor where Openbox should place popup dialogs such as the
focus cycling popup, or the desktop switch popup.  It can be an index
from 1, specifying a particular monitor.  Or it can be one of the
following: 'Mouse' - where the mouse is, or
'Active' - where the active window is -->
  </placement>
  <theme>
    <name>Greybird</name>
    <titleLayout>LIMC</titleLayout>
    <!--
available characters are NDSLIMC, each can occur at most once.
N: window icon
L: window label (AKA title).
I: iconify
M: maximize
C: close
S: shade (roll up/down)
D: omnipresent (on all desktops).
-->
    <keepBorder>yes</keepBorder>
    <animateIconify>yes</animateIconify>
    <font place="ActiveWindow">
      <name>Sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveWindow">
      <name>Sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuHeader">
      <name>Sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuItem">
      <name>Sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="ActiveOnScreenDisplay">
      <name>Sans</name>
      <size>9</size>
      <weight>Normal</weight>
      <slant>Normal</slant>
    </font>
    <font place="InactiveOnScreenDisplay">
      <name>Sans</name>
      <size>9</size>
      <weight>Normal</weight>
      <slant>Normal</slant>
    </font>
  </theme>
  <desktops>
    <!-- this stuff is only used at startup, pagers allow you to change them
during a session

these are default values to use when other ones are not already set
by other applications, or saved in your session

use obconf if you want to change these without having to log out
and back in -->
    <number>4</number>
    <firstdesk>1</firstdesk>
    <names>
      <!-- set names up here if you want to, like this:
<name>desktop 1</name>
<name>desktop 2</name>
-->
    </names>
    <popupTime>875</popupTime>
    <!-- The number of milliseconds to show the popup for when switching
desktops.  Set this to 0 to disable the popup. -->
  </desktops>
  <resize>
    <drawContents>yes</drawContents>
    <popupShow>Nonpixel</popupShow>
    <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
    <popupPosition>Center</popupPosition>
    <!-- 'Center', 'Top', or 'Fixed' -->
    <popupFixedPosition>
      <!-- these are used if popupPosition is set to 'Fixed' -->
      <x>10</x>
      <!-- positive number for distance from left edge, negative number for
distance from right edge, or 'Center' -->
      <y>10</y>
      <!-- positive number for distance from top edge, negative number for
distance from bottom edge, or 'Center' -->
    </popupFixedPosition>
  </resize>
  <!-- You can reserve a portion of your screen where windows will not cover when
they are maximized, or when they are initially placed.
Many programs reserve space automatically, but you can use this in other
cases. -->
  <margins>
    <top>1</top>
    <bottom>0</bottom>
    <left>0</left>
    <right>0</right>
  </margins>
  <dock>
    <position>TopLeft</position>
    <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
    <floatingX>0</floatingX>
    <floatingY>0</floatingY>
    <noStrut>no</noStrut>
    <stacking>Below</stacking>
    <!-- 'Above', 'Normal', or 'Below' -->
    <direction>Vertical</direction>
    <!-- 'Vertical' or 'Horizontal' -->
    <autoHide>no</autoHide>
    <hideDelay>300</hideDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <showDelay>300</showDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <moveButton>Middle</moveButton>
    <!-- 'Left', 'Middle', 'Right' -->
  </dock>
  <keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <keybind key="F1">
      <action name="DesktopLeft"/>
    </keybind>
    <keybind key="F5">
      <action name="Execute">
        <command>skype</command>
      </action>
    </keybind>
    <keybind key="F12">
      <action name="Execute">
      <startupnotify>
      <enabled>true</enabled>
      <name>oblogout</name>
      </startupnotify>
      <command>oblogout</command>
      </action>
    </keybind>
    <keybind key="F2">
      <action name="DesktopRight"/>
    </keybind>
    <keybind key="W-d">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <keybind key="F4">
      <action name="ToggleFullscreen"/>
    </keybind>
    <keybind key="W-m">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <command>google-chrome-stable</command>
        <startupnotify>
          <enabled>yes</enabled>
          <name>Web Browser</name>
        </startupnotify>
      </action>
    </keybind>
    <keybind key="W-t">
      <action name="Execute">
        <command>terminator</command>
        <startupnotify>
          <enabled>yes</enabled>
          <name>terminal</name>
        </startupnotify>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="Execute">
        <command>geany</command>
        <startupnotify>
          <enabled>yes</enabled>
          <name>Leafpad</name>
        </startupnotify>
      </action>
    </keybind>
    <keybind key="W-f">
      <action name="Execute">
        <command>thunar</command>
        <startupnotify>
          <enabled>yes</enabled>
          <name>File Manager</name>
        </startupnotify>
      </action>
    </keybind>
    <keybind key="W-q">
      <action name="Execute">
        <command>xkill</command>
        <startupnotify>
          <enabled>yes</enabled>
          <name>Kill an application</name>
        </startupnotify>
      </action>
    </keybind>
    <keybind key="W-space">
      <action name="Execute">
        <command>dmenu_run -fn &quot;-xos4-terminus-medium-r-*-*-20-*&quot;</command>
      </action>
    </keybind>
    <keybind key="F7">
      <action name="Execute">
        <command>xbacklight -inc 10</command>
      </action>
    </keybind>
    <keybind key="F10">
      <action name="Execute">
        <command>amixer set Master 5%+ unmute</command>
      </action>
    </keybind>
    <keybind key="F9">
      <action name="Execute">
        <command>amixer set Master 5%- unmute</command>
      </action>
    </keybind>
    <keybind key="F8">
      <action name="Execute">
        <command>amixer set Master toggle</command>
      </action>
    </keybind>
    <keybind key="F6">
      <action name="Execute">
        <command>xbacklight -dec 10</command>
      </action>
    </keybind>
  </keyboard>
  <mouse>
    <dragThreshold>8</dragThreshold>
    <!-- number of pixels the mouse must move before a drag begins -->
    <doubleClickTime>200</doubleClickTime>
    <!-- in milliseconds (1000 = 1 second) -->
    <screenEdgeWarpTime>400</screenEdgeWarpTime>
    <!-- Time before changing desktops when the pointer touches the edge of the
screen while moving a window, in milliseconds (1000 = 1 second).
Set this to 0 to disable warping -->
    <context name="Frame">
      <mousebind action="Press" button="A-Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Click" button="A-Left">
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Drag" button="A-Left">
        <action name="Move"/>
      </mousebind>
      <mousebind action="Press" button="A-Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Drag" button="A-Right">
        <action name="Resize"/>
      </mousebind>
      <mousebind action="Press" button="A-Middle">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind action="Click" button="A-Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="A-Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Click" button="C-A-Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="C-A-Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Click" button="A-S-Up">
        <action name="SendToDesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="A-S-Down">
        <action name="SendToDesktopNext"/>
      </mousebind>
    </context>
    <context name="Titlebar">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Move"/>
      </mousebind>
      <mousebind action="DoubleClick" button="Left">
        <action name="ToggleMaximizeFull"/>
      </mousebind>
      <mousebind action="Press" button="Middle">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind action="Click" button="Up">
        <action name="Shade"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
        <action name="Lower"/>
      </mousebind>
      <mousebind action="Click" button="Down">
        <action name="Unshade"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="Top">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize">
          <edge>top</edge>
        </action>
      </mousebind>
    </context>
    <context name="Left">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize">
          <edge>left</edge>
        </action>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="Right">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize">
          <edge>right</edge>
        </action>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="Bottom">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize">
          <edge>bottom</edge>
        </action>
      </mousebind>
      <mousebind action="Press" button="Middle">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="BLCorner">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="BRCorner">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="TLCorner">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="TRCorner">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Drag" button="Left">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="Client">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Press" button="Middle">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Icon">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="AllDesktops">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Click" button="Left">
        <action name="ToggleOmnipresent"/>
      </mousebind>
    </context>
    <context name="Shade">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Click" button="Left">
        <action name="ToggleShade"/>
      </mousebind>
    </context>
    <context name="Iconify">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Click" button="Left">
        <action name="Iconify"/>
      </mousebind>
    </context>
    <context name="Maximize">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Press" button="Middle">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Click" button="Left">
        <action name="ToggleMaximizeFull"/>
      </mousebind>
      <mousebind action="Click" button="Middle">
        <action name="ToggleMaximizeVert"/>
      </mousebind>
      <mousebind action="Click" button="Right">
        <action name="ToggleMaximizeHorz"/>
      </mousebind>
    </context>
    <context name="Close">
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind action="Click" button="Left">
        <action name="Close"/>
      </mousebind>
    </context>
    <context name="Desktop">
      <mousebind action="Click" button="Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Click" button="A-Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="A-Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Click" button="C-A-Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="C-A-Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Press" button="Left">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Root">
      <!-- Menus -->
      <mousebind action="Press" button="Middle">
        <action name="ShowMenu">
          <menu>client-list-combined-menu</menu>
        </action>
      </mousebind>
      <mousebind action="Press" button="Right">
        <action name="ShowMenu">
          <menu>root-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="MoveResize">
      <mousebind action="Click" button="Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="Down">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind action="Click" button="A-Up">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind action="Click" button="A-Down">
        <action name="DesktopNext"/>
      </mousebind>
    </context>
  </mouse>
  <menu><!-- You can specify more than one menu file in here and they are all loaded,
just don't make menu ids clash or, well, it'll be kind of pointless --><!-- default menu file (or custom one in $HOME/.config/openbox/) --><file>menu.xml</file><hideDelay>200</hideDelay><!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again --><middle>no</middle><!-- center submenus vertically about the parent entry --><submenuShowDelay>100</submenuShowDelay><!-- time to delay before showing a submenu after hovering over the parent
entry.
if this is a negative value, then the delay is infinite and the
submenu will not be shown until it is clicked on --><submenuHideDelay>400</submenuHideDelay><!-- time to delay before hiding a submenu when selecting another
entry in parent menu -->
if this is a negative value, then the delay is infinite and the
submenu will not be hidden until a different submenu is opened --&gt;
<applicationIcons>yes</applicationIcons>
<!-- controls if icons appear in the client-list-(combined-)menu -->
<manageDesktops>yes</manageDesktops>
<!-- show the manage desktops section in the client-list-(combined-)menu -->
<showIcons>yes</showIcons>
</menu>
  <applications>
    <application class="*">
      <position>
        <monitor>1</monitor>
      </position>
      <focus>yes</focus>
      <maximized>no</maximized>
    </application>
  </applications>
</openbox_config>

Last edited by Mr_ED-horsey (2015-02-11 13:31:55)


Desktop: Fedora 21 Mate + Compiz [x86_64] on 2 TiB HDD  /  Windows 7 Professional [x86_64] on 500 GiB HDD
Laptop: Arch Linux + Openbox [i686] 120 GiB SSD on Acer c720 Chromebook

Offline

#2 2015-02-11 13:12:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [solved] Map oblogout to poweroff button on Acer C720 Chromebook?

Please be careful with pronouns - it's not entirely clear in your first paragraph which buttons you are referring to in which cases.  Is the problem that you sometimes accidentally hit the poweroff button?  And to deal with this you'd like to make that button trigger oblogout rather than immediately shutting off?

If that's the case, you can edit /etc/systemd/logind.conf to uncomment the line for handling the powerswitch and change the action there (see wiki).  You can't bind oblogout there, but you can make it so the power switch is ignored.  Then if you also want to bind it to oblogout, you should then be able to do so in openbox's rc.xml.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-02-11 13:31:32

Mr_ED-horsey
Member
From: Portland, OR
Registered: 2011-04-06
Posts: 177

Re: [solved] Map oblogout to poweroff button on Acer C720 Chromebook?

Trilby wrote:

Please be careful with pronouns - it's not entirely clear in your first paragraph which buttons you are referring to in which cases.  Is the problem that you sometimes accidentally hit the poweroff button?  And to deal with this you'd like to make that button trigger oblogout rather than immediately shutting off?

If that's the case, you can edit /etc/systemd/logind.conf to uncomment the line for handling the powerswitch and change the action there (see wiki).  You can't bind oblogout there, but you can make it so the power switch is ignored.  Then if you also want to bind it to oblogout, you should then be able to do so in openbox's rc.xml.

Thank you. That was my problem. It's working the way I want it to now. I'll be more careful in the future about how I layout my questions. I admit, I haven't used Arch Linux in over 3 years so I'm a bit rusty right now. Thank you so much. You have no idea how many times I've almost thrown my laptop against the wall over the last few days smile


Desktop: Fedora 21 Mate + Compiz [x86_64] on 2 TiB HDD  /  Windows 7 Professional [x86_64] on 500 GiB HDD
Laptop: Arch Linux + Openbox [i686] 120 GiB SSD on Acer c720 Chromebook

Offline

Board footer

Powered by FluxBB