<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I wondered much the same about
      lxsession-default, in part because I want to set the power button
      to actually just "Shut Down" as I have it set in Power
      Preferences.  Now, pressing the power button produces the logout
      window, which I equate with "Ask."<br>
      <br>
      So far I have not found any documentation for lxsession-default.<br>
      <br>
      I made it part-way to the goal with "xset dpms force off." That
      just turns off the monitor, but it does do so without root
      permission.<br>
      <br>
      On 4/30/2014 4:55 PM, Andre Rodovalho wrote:<br>
    </div>
    <blockquote
cite="mid:CABLbVHOS9d0RQ0CYAsmoF3BOJQhnjAuWpdjOjmXOi39ZMyBTrQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">I know <b>lxsession-logout</b> gives us that logout
        window which hibernate, suspend and others are available... I
        tried to insert some commands but I had no luck. Maybe you can
        search this lxssession-logout documentation or it's source
        code...
        <div>
          <br>
        </div>
        <div><b>lxsession-default quit</b> triggers to
          lxsession-logout...<br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2014-04-30 17:11 GMT-03:00 John Hupp <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:lubuntu@prpcompany.com" target="_blank">lubuntu@prpcompany.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <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!
                <div>
                  <div class="h5"><br>
                    <br>
                    On 4/30/2014 3:30 PM, John Hupp wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <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>
                      And then:<br>
                      <br>
                      chown root:root toggle-wifi.sh<br>
                      chmod 4755 toggle-wifi.sh<br>
                      <br>
                      I also tried inserting 'sudo command' in front of
                      the rfkill commands in toggle-wifi.sh, and I tried
                      'sudo command toggle-wifi.sh' in the
                      lubuntu-rc.xml command statement.<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>
                        #<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
                            moz-do-not-send="true"
                            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>
                          Is there more current documentation for this
                          task?  Is ibus-setup supposed to handle this
                          job somehow under Lubuntu 14.04?  Or is there
                          another place preferred for auto-starting
                          setkeycodes commands?<br>
                          <br>
                          On 4/29/2014 3:54 PM, John Hupp wrote:<br>
                        </div>
                        <blockquote type="cite">
                          <div>Thanks, Andre, for all of those great
                            tips.<br>
                            <br>
                            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">
                            <div dir="ltr">I tested here, and it works: <a
                                moz-do-not-send="true"
href="http://askubuntu.com/questions/181390/what-is-the-command-for-sleep-hibernate"
                                target="_blank">http://askubuntu.com/questions/181390/what-is-the-command-for-sleep-hibernate</a><br>
                              <br>
                              <code><b>pm-suspend</b> and<b> </b></code><code><b>pm-hibernate</b></code><br>
                            </div>
                            <div class="gmail_extra"><br>
                              <br>
                              <div class="gmail_quote">2014-04-29 16:13
                                GMT-03:00 Andre Rodovalho <span
                                  dir="ltr"><<a
                                    moz-do-not-send="true"
                                    href="mailto:andre.rodovalho@gmail.com"
                                    target="_blank">andre.rodovalho@gmail.com</a>></span>:<br>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  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>
                                    <div> <br>
                                    </div>
                                    <div>I'm not sure what commands you
                                      can execute to sleep and
                                      hibernate, but you can control
                                      radio with <b>rfkill</b>. I'm not
                                      sure if those commands really
                                      require root access, but on that
                                      case you can do a: <b>gksu command</b></div>
                                    <div><b><br>
                                      </b></div>
                                    <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
                                          moz-do-not-send="true"
                                          href="mailto:israeldahl@gmail.com"
                                          target="_blank">israeldahl@gmail.com</a>></span>:
                                      <div>
                                        <div><br>
                                          <blockquote
                                            class="gmail_quote"
                                            style="margin:0 0 0
                                            .8ex;border-left:1px #ccc
                                            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><font color="#888888"><br>
                                                --<br>
                                                Regards<br>
                                              </font></span>
                                            <div>
                                              <div><br>
                                                <br>
                                                --<br>
                                                Lubuntu-users mailing
                                                list<br>
                                                <a
                                                  moz-do-not-send="true"
href="mailto:Lubuntu-users@lists.ubuntu.com" target="_blank">Lubuntu-users@lists.ubuntu.com</a><br>
                                                Modify settings or
                                                unsubscribe at: <a
                                                  moz-do-not-send="true"
href="https://lists.ubuntu.com/mailman/listinfo/lubuntu-users"
                                                  target="_blank">https://lists.ubuntu.com/mailman/listinfo/lubuntu-users</a><br>
                                              </div>
                                            </div>
                                          </blockquote>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                            <br>
                            <fieldset></fieldset>
                            <br>
                          </blockquote>
                          <br>
                          <br>
                          <fieldset></fieldset>
                          <br>
                        </blockquote>
                        <br>
                        <br>
                        <fieldset></fieldset>
                        <br>
                      </blockquote>
                      <br>
                      <br>
                      <fieldset></fieldset>
                      <br>
                    </blockquote>
                    <br>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            --<br>
            Lubuntu-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Lubuntu-users@lists.ubuntu.com">Lubuntu-users@lists.ubuntu.com</a><br>
            Modify settings or unsubscribe at: <a
              moz-do-not-send="true"
              href="https://lists.ubuntu.com/mailman/listinfo/lubuntu-users"
              target="_blank">https://lists.ubuntu.com/mailman/listinfo/lubuntu-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>