<div dir="ltr"><div class="gmail_extra"><div>Nice! I will try that out... Anyway, I was able to hibernate adding "sudo" before the command...</div><br><div class="gmail_quote">2014-05-06 19:19 GMT-03:00 John Hupp <span dir="ltr"><<a href="mailto:lubuntu@prpcompany.com" target="_blank">lubuntu@prpcompany.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>It turns out that
      com.ubuntu.enable-hibernate.pkla needs another stanza.  Make it
      thus:<br>
      <br>
      <blockquote>
        <p>[Re-enable hibernate by default in upower]<br>
          Identity=unix-user:*<br>
          Action=org.freedesktop.upower.hibernate<br>
          ResultActive=yes</p>
        <p>[Re-enable hibernate by default in logind]<br>
          Identity=unix-user:*<br>
          Action=org.freedesktop.login1.hibernate<br>
          ResultActive=yes</p>
      </blockquote>
      Now both Menu: Hibernate and the dbus-send command will work:<br>
      <br>
      dbus-send --print-reply --system --dest=org.freedesktop.UPower
      /org/freedesktop/UPower org.freedesktop.UPower.Hibernate<br>
      <br>
      See <a href="http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/" target="_blank">http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/</a><br>
      <br>
      On 4/30/2014 7:50 PM, John Hupp wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      <div>See <a href="http://ubuntuforums.org/showthread.php?t=813387&page=6" target="_blank">http://ubuntuforums.org/showthread.php?t=813387&page=6</a>
        #57 for dbus-send commands that accomplish most of what I
        wanted.<br>
        <br>
        Restart:<br>
        dbus-send --system --print-reply
        --dest=org.freedesktop.ConsoleKit
        /org/freedesktop/ConsoleKit/Manager
        org.freedesktop.ConsoleKit.Manager.Restart<br>
        <br>
        Shutdown:<br>
        dbus-send --system --print-reply
        --dest=org.freedesktop.ConsoleKit
        /org/freedesktop/ConsoleKit/Manager
        org.freedesktop.ConsoleKit.Manager.Stop<br>
        <br>
        Suspend:<br>
        dbus-send --print-reply --system --dest=org.freedesktop.UPower
        /org/freedesktop/UPower org.freedesktop.UPower.Suspend<br>
        <br>
        Hibernate does not work, but it turns out that it does not work
        in the Lubuntu logout menu either.  See bug <a href="https://bugs.launchpad.net/ubuntu/+source/lxsession/+bug/1300798" target="_blank">https://bugs.launchpad.net/ubuntu/+source/lxsession/+bug/1300798</a>. 

        But if "sudo pm-hibernate" works, then you can also make
        Hibernate work from the logout menu in accord with the given
        workaround:<br>
            Create the file
        /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla<br>
        <br>
            The file must have the following content:<br>
        <br>
            [Re-enable hibernate by default]<br>
            Identity=unix-user:*<br>
            Action=org.freedesktop.login1.hibernate<br>
            ResultActive=yes<br>
        <br>
        There is also a dbus-send command which would be nice for a
        keyboard shortcut, but even after creating the above file it
        yields a "not authorized" error for reasons I don't understand. 
        The dbus-send command:<br>
        dbus-send --print-reply --system --dest=org.freedesktop.UPower
        /org/freedesktop/UPower org.freedesktop.UPower.Hibernate<br>
        <br>
        On 4/30/2014 4:11 PM, John Hupp wrote:<br>
      </div>
      <blockquote type="cite">
        
        <div>One problem solved: If I use "nmcli
          nm wifi on" and "nmcli nm wifi off" instead of the rfkill
          commands, this toggles the wifi radio without root
          permissions.<br>
          <br>
          Now if I could find some suspend/standby and hibernate
          commands that don't require root permission, this job would be
          done!<br>
          <br>
          On 4/30/2014 3:30 PM, John Hupp wrote:<br>
        </div>
        <blockquote type="cite">
          
          <div>I spoke too soon.  All the
            programs (rfkill, pm-suspend, pm-hibernate) must run as
            root, and nothing I have tried so far has allowed these keys
            to work as I intend.<br>
            <br>
            I created /home/<user>/.config/openbox/toggle-wifi.sh
            with this content:<br>
            <br>
            #!/bin/bash<br>
            <br>
            if [ $(rfkill list wifi | grep "Soft blocked: yes" | wc -l)
            -eq 1 ] ; then<br>
                rfkill unblock wifi<br>
                zenity --info --text "Enabled wireless"<br>
            else<br>
                rfkill block wifi<br>
                zenity --info --text "Disabled wireless"<br>
            fi<br>
            <br>
            On 4/30/2014 1:09 PM, John Hupp wrote:<br>
          </div>
          <blockquote type="cite">
            
            <div>After thinking about it, I used
              an Upstart job to do what the MultiMediaKeys article
              instructed to be done with bootmisc.sh or rc.local.  <br>
              <br>
              Though I'm no better than an Upstart hacker, especially
              with regard to choice of a 'start on' event, I created
              /etc/init/kb-keys-customize.conf with this content:<br>
              <br>
              # kb-keys-customize<br>
              # Map key codes to the scan codes emitted by Fn-F4, Fn-F5,
              Fn-F12<br>
              <br>
              description "Map Fn-F4, Fn-F5 and Fn-F12 kernel scancodes
              to kernel keycodes"<br>
              author "John Hupp"<br>
              <br>
              start on local-filesystems<br>
              <br>
              script<br>
                  setkeycodes e017 128 e016 129 e018 130<br>
              end script<br>
              <br>
              After rebooting, I found that 'xev -event keyboard' now
              reports that Fn-F4, Fn-F5 and Fn-F12 are mapped to X
              keysyms Cancel, Redo and SunProps, so I expect that I
              should be able to bind those keys in lubuntu-rc.xml to
              Andre's suggested commands.<br>
              <br>
              On 4/29/2014 6:08 PM, John Hupp wrote:<br>
            </div>
            <blockquote type="cite">
              
              <div>The next problem is that
                Fn-F4 and Fn-F5 don't generate any keysyms, so they
                can't be bound to the commands suggested by Andre.<br>
                <br>
                To deal with that, I've been following the In-Depth
                Instructions in <a href="https://help.ubuntu.com/community/MultimediaKeys" target="_blank">https://help.ubuntu.com/community/MultimediaKeys</a>,
                and I have identified the scancodes and picked a couple
                unassigned kernel keycodes, but that article is old, and
                writing setkeycodes commands into
                /etc/init.d/bootmisc.sh or /etc/rc.local seems
                deprecated (those files don't exist).<br>
                <br>
                On 4/29/2014 3:54 PM, John Hupp wrote:<br>
              </div>
              <blockquote type="cite">
                
                <div>I've been looking at the
                  Exec lines in several versions of
                  ~/.config/autostart/LXRandR-autostart.desktop (created
                  when one clicks Save in LXRandR) and thinking about
                  how I could create something that would cause Fn-F7 to
                  toggle through the LVDS, VGA and S-Video outputs, but
                  your approach -- simply binding to LXRandR -- is a
                  MUCH better idea!<br>
                  <br>
                  And if I wanted to add the ability to extend the
                  desktop instead of mirroring it, I could install
                  arandr and just bind to that instead.<br>
                  <br>
                  On 4/29/2014 3:18 PM, Andre Rodovalho wrote:<br>
                </div>
                <blockquote type="cite"><br>
                  <div class="gmail_extra">
                    <div class="gmail_quote">2014-04-29 16:13 GMT-03:00
                      Andre Rodovalho <span dir="ltr"><<a href="mailto:andre.rodovalho@gmail.com" target="_blank">andre.rodovalho@gmail.com</a>></span>:<br>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                        <div dir="ltr">On <span style="font-family:arial,sans-serif;font-size:13px">lubuntu-rc.xml






                            I do:</span>
                          <div><br>
                          </div>
                          <div>
                            <div><keybind key="XF86Display"></div>
                            <div>      <action name="Execute"></div>
                            <div>       
                              <command>lxrandr</command></div>
                            <div>      </action></div>
                            <div>    </keybind><br>
                              <br>
                              <b>lxrandr</b> deals with additional
                              monitors, you just enable them an apply.<br>
                            </div>
                          </div>
                          <br>
                          <div>Hope that helps! To test the shortcuts
                            without restarting all the system you can
                            restart only openbox: <b>openbox --restart</b></div>
                        </div>
                        <div class="gmail_extra"><br>
                          <br>
                          <div class="gmail_quote"> 2014-04-28 22:03
                            GMT-03:00 Israel <span dir="ltr"><<a href="mailto:israeldahl@gmail.com" target="_blank">israeldahl@gmail.com</a>></span>:
                            <div>
                              <div><br>
                                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                                  <div>On 04/28/2014 07:48 PM, John Hupp
                                    wrote:<br>
                                    > I was trying to watch Netflix
                                    on a laptop (with Lubuntu) connected
                                    to<br>
                                    > a TV by S-Video connection.  I
                                    found out that Fn-F7 was not working
                                    to<br>
                                    > select the external VGA or
                                    S-Video displays.<br>
                                    ><br>
                                    > Subsequently I found that Fn-F4
                                    does not put the laptop to sleep,
                                    and<br>
                                    > Fn-F5 does not toggle the WiFi
                                    radio on/off.  (The other common<br>
                                    > special keys work OK.)<br>
                                    ><br>
                                    > So I'm trying to get those keys
                                    working that way via entries in<br>
                                    > lubuntu-rc.xml.<br>
                                    ><br>
                                    > With 'xev -event keyboard' I
                                    found out that Fn-F7 produces the
                                    keysym<br>
                                    > 'XF86Display' but I still need
                                    to know what command to bind that
                                    to.<br>
                                    > So that's my first question.<br>
                                    ><br>
                                    > Fn-F4 and Fn-F5 does not
                                    produce any keysym's, so I'm
                                    currently at a<br>
                                    > loss for how to proceed next
                                    with those.<br>
                                    ><br>
                                    ><br>
                                  </div>
                                  Hi,<br>
                                  <br>
                                  you can use arandr to make a shell
                                  script to switch the display to a<br>
                                  certain mode.  Plug in the monitor and
                                  use arandr to make a setup you<br>
                                  want, and save that.  Then open your
                                  config file for openbox and set<br>
                                  the keyboard shortcut for your display
                                  key (i.e. XF86Display)<br>
                                  to execute the<br>
                                  <command><br>
                                  /bin/bash /path/to/scriptname.sh<br>
                                  </command><br>
                                  while scriptname.sh is whatever you
                                  saved the setup as with the correct<br>
                                  path.<br>
                                  <br>
                                  arandr is a front-end for xrandr.  So
                                  the script is actually using<br>
                                  xrandr to modify your display
                                  settings.<br>
                                  <br>
                                  I hope this helps.<br>
                                  <span></span><br>
                                </blockquote>
                              </div>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></div>