Re: HandleLidSwitch issue.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a crude script that I run on machine startup that it puts my
cpus at the lowest speed when the lid is closed, but otherwise leaves
the machine on.

#!/bin/bash
laststate=open
while [ true ] ; do
  lidstate=`cat /proc/acpi/button/lid/LID0/state | awk '{print $2}'`
  if [ "${lidstate}" == "open" ] && [ "${laststate}" == "closed" ] ; then
    echo "at `date` lid was opened"
    /usr/local/bin/highspeed
    laststate=${lidstate}
    grep -i mhz /proc/cpuinfo
  elif [ "${lidstate}" == "closed" ] && [ "${laststate}" == "open" ] ; then
      echo "at `date` lid was closed"
      /usr/local/bin/lowspeed
      laststate=${lidstate}
      grep -i mhz /proc/cpuinfo
  fi
  sleep 10
done

On Mon, Mar 23, 2020 at 4:23 PM Samuel Sieb <samuel@xxxxxxxx> wrote:
>
> On 3/23/20 1:24 PM, Erik P. Olsen wrote:
> > [erik@Erik-PC ~]$ sudo evtest /dev/input/event1
> > Input driver version is 1.0.1
> > Input device ID: bus 0x19 vendor 0x0 product 0x5 version 0x0
> > Input device name: "Lid Switch"
> > Supported events:
> >    Event type 0 (EV_SYN)
> >    Event type 5 (EV_SW)
> >      Event code 0 (SW_LID) state 0
> > Properties:
> > Testing ... (interrupt to exit)
> >
> > But I don't see any event.
>
> Then that would be why it isn't working.  Has it ever worked?
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux