Comments (12)
In desktop mode, you can use the sleep function through the power button.
from holoiso.
Huh? Can you unpack this and run sudo python powerbutton.py
in terminal and send me the output?
powerbutton.zip
I suppose powerbutton handler requires some tuning...
from holoiso.
Output Here!
[yjaking@SteamOSPC Downloads]$ sudo python powerbutton.py
/dev/input/event15 Microsoft X-Box 360 pad 0
/dev/input/event17 B.O.W Mouse e0:d4:64:da:0c:9f
/dev/input/event16 B.O.W Keyboard e0:d4:64:da:0c:9f
/dev/input/event8 Logitech USB Optical Mouse usb-0000:03:00.4-1.1/input0
/dev/input/event14 HD-Audio Generic Front Headphone ALSA
/dev/input/event13 HD-Audio Generic Mic ALSA
/dev/input/event12 HD-Audio Generic HDMI/DP,pcm=9 ALSA
/dev/input/event11 HD-Audio Generic HDMI/DP,pcm=8 ALSA
/dev/input/event10 HD-Audio Generic HDMI/DP,pcm=7 ALSA
/dev/input/event9 HD-Audio Generic HDMI/DP,pcm=3 ALSA
/dev/input/event7 Microsoft X-Box 360 pad usb-0000:03:00.3-4/input0
/dev/input/event6 PC Speaker isa0061/input0
/dev/input/event5 Video Bus LNXVIDEO/video/input0
/dev/input/event4 Goodix Capacitive TouchScreen input/ts
/dev/input/event3 AT Translated Set 2 keyboard isa0060/serio0/input0
/dev/input/event2 Power Button LNXPWRBN/button/input0
/dev/input/event1 Power Button PNP0C0C/button/input0
/dev/input/event0 Lid Switch PNP0C0D/button/input0
from holoiso.
Output Here!
[yjaking@SteamOSPC Downloads]$ sudo python powerbutton.py /dev/input/event15 Microsoft X-Box 360 pad 0 /dev/input/event17 B.O.W Mouse e0:d4:64:da:0c:9f /dev/input/event16 B.O.W Keyboard e0:d4:64:da:0c:9f /dev/input/event8 Logitech USB Optical Mouse usb-0000:03:00.4-1.1/input0 /dev/input/event14 HD-Audio Generic Front Headphone ALSA /dev/input/event13 HD-Audio Generic Mic ALSA /dev/input/event12 HD-Audio Generic HDMI/DP,pcm=9 ALSA /dev/input/event11 HD-Audio Generic HDMI/DP,pcm=8 ALSA /dev/input/event10 HD-Audio Generic HDMI/DP,pcm=7 ALSA /dev/input/event9 HD-Audio Generic HDMI/DP,pcm=3 ALSA /dev/input/event7 Microsoft X-Box 360 pad usb-0000:03:00.3-4/input0 /dev/input/event6 PC Speaker isa0061/input0 /dev/input/event5 Video Bus LNXVIDEO/video/input0 /dev/input/event4 Goodix Capacitive TouchScreen input/ts /dev/input/event3 AT Translated Set 2 keyboard isa0060/serio0/input0 /dev/input/event2 Power Button LNXPWRBN/button/input0 /dev/input/event1 Power Button PNP0C0C/button/input0 /dev/input/event0 Lid Switch PNP0C0D/button/input0
So, let's try tinkering with it then!
Can you run sudo sed -i 's/isa0060\/serio0\/input0/PNP0C0C\/button\/input0/g' /usr/lib/hwsupport/power-button-handler.py
and run SteamOS session, then try to use power button?
from holoiso.
First of all, thank you for your quick response.
You are a wonderful person.
But the results are not good.
Still in the same SteamOS session, pressing the power button does not go into sleep mode.
This is also a common symptom of people using AYA Neo around them.
from holoiso.
source code is here!
#!/usr/bin/python
import evdev
import threading
import os
powerbuttondev = None
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
for device in devices:
if device.phys == "PNP0C0C/button/input0":
powerbuttondev = device;
else:
device.close()
longpresstimer = None
def longpress():
os.system( "~/.steam/root/ubuntu12_32/steam -ifrunning steam://longpowerpress" )
global longpresstimer
longpresstimer = None
if powerbuttondev != None:
for event in powerbuttondev.read_loop():
if event.type == evdev.ecodes.EV_KEY and event.code == 116: # KEY_POWER
if event.value == 1:
longpresstimer = threading.Timer( 1.0, longpress )
longpresstimer.start()
elif event.value == 0:
if longpresstimer != None:
os.system( "~/.steam/root/ubuntu12_32/steam -ifrunning steam://shortpowerpress" )
longpresstimer.cancel()
longpresstimer = None
powerbuttondev.close()
exit()
print ( "power-button-handler.py: Can't find device for power button!" )
from holoiso.
I modified the source code arbitrarily
Even after changing to PNP0C0C --> LNXPWRBN and testing, the slim mode did not work.
from holoiso.
Investigating the event with hexdump, the event that responds when the power button is pressed seems to be 'event2'.
from holoiso.
after sudo sed -i 's/isa0060\/serio0\/input0/PNP0C0C\/button\/input0/g' /usr/lib/hwsupport/power-button-handler.py
aya neo shutdown immediately
from holoiso.
I clear all codes in power-button-handler.py, it's same
from holoiso.
Can you try this?
#247 (comment)
This worked for the Steam Deck. I am curious if it works on other devices as well.
If yes it means the Gaming Mode follows standard ACPI Events.
from holoiso.
I have a oxp mini amd, and find a solution for my device, you could try it:
Step 1.
According #247
Edit:
/etc/systemd/logind.conf
Change:
#HandlePowerKey=poweroff
to
HandlePowerKey=ignore
now, press the power button will not shutdown the device immediately, device only poweroff with long press
Step 2.
Run
sudo evtest
, select an input and press power button, by doing this on all input, find which eventX fire a event when you press button.
Get phys of the device fromcat /proc/bus/input/devices
and update the /usr/lib/hwsupport/power-button-handler.py accordingly(or just create the InputDevice with the path '/dev/input/eventX')
Step 2.5.(Maybe only for oxp mini amd)
For oxp mini amd, press power button will not fire a event, it will fire a press event and a release event when you release the button, so long press will never be triggered. An solution is to update /usr/lib/hwsupport/power-button-handler.py script, change logic from detect long press to detect double press
Step 3.
Run
~/.steam/root/ubuntu12_32/steam -ifrunning steam://longpowerpress
in ssh brings up the power menu with no problem, but sudo will cause a coredump.
So update /usr/bin/gamescope-session @ line 188,
change(while true; do
/usr/lib/hwsupport/power-button-handler.py
done) &
to
(while true; do
sudo -E /usr/lib/hwsupport/power-button-handler.py
done) &
should fix the problem
from holoiso.
Related Issues (20)
- Does not work with Steam Deck OLED HOT 5
- Can this work under Virtual Box? VBox just says VM failed to boot. HOT 2
- Intel graphics help HOT 4
- Include Ayn drivers by default to control LED lights and fan speeds
- Only 640x480 resolution is available in steamdeck gui HOT 3
- [Report] Monitors Conflicting
- [Report] Installer USB does not have a option to boot into the installer HOT 1
- Switch from pipewire to pulseaudio?
- HEEELLLPPP MEEEE PLSSSSS HOT 2
- Download page not working HOT 3
- [Report] USB Booting throws me back to BIOS HOT 8
- The ability to install normal arch packages or AUR packages. HOT 2
- Auto Mounting second drive HOT 13
- [Report] Can't see the bootable USB flash drive HOT 1
- Add support for nvidia GPUs HOT 1
- [Report] Installer Broken? HOT 4
- Get Logo, then nothing (sort of) HOT 3
- URL to latest release ISO is broken, returns 404 HOT 7
- [Report] HOT 2
- [Report] Installer sstuck on steam deck LOGO
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holoiso.