Skip to content

Commit

Permalink
fix: pressing the power button opened the lock screen
Browse files Browse the repository at this point in the history
应该打开关机界面

Issues: linuxdeepin/developer-center#9360
  • Loading branch information
zsien committed Jul 24, 2024
1 parent 80af19c commit 299a422
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ install: build install-dde-data install-icons
cp -r misc/dsg-configs/*.json ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/

cp -f misc/scripts/dde-lock.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
cp -f misc/scripts/dde-shutdown.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
install-dde-data:
mkdir -pv ${DESTDIR}${PREFIX}/share/dde/
cp -r misc/data misc/zoneinfo ${DESTDIR}${PREFIX}/share/dde/
Expand Down
2 changes: 1 addition & 1 deletion keybinding/special_keycode.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (m *Manager) handlePower() {
}
m.systemTurnOffScreen()
case powerActionShowUI:
cmd := "/usr/lib/deepin-daemon/dde-lock.sh"
cmd := "/usr/lib/deepin-daemon/dde-shutdown.sh"
go func() {
locked, err := m.sessionManager.Locked().Get(0)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion misc/scripts/dde-lock.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');setxkbmap -option grab:break_actions&&xdotool key XF86Ungrab&&dbus-send --print-reply --dest=org.deepin.dde.LockFront1 /org/deepin/dde/LockFront1 org.deepin.dde.LockFront1.Show; setxkbmap -option $originmap
originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');
setxkbmap -option grab:break_actions &&
xdotool key XF86Ungrab &&
dbus-send --print-reply --dest=org.deepin.dde.LockFront1 /org/deepin/dde/LockFront1 org.deepin.dde.LockFront1.Show
setxkbmap -option $originmap
7 changes: 7 additions & 0 deletions misc/scripts/dde-shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');
setxkbmap -option grab:break_actions &&
xdotool key XF86Ungrab &&
dbus-send --print-reply --dest=org.deepin.dde.ShutdownFront1 /org/deepin/dde/ShutdownFront1 org.deepin.dde.ShutdownFront1.Show
setxkbmap -option $originmap

0 comments on commit 299a422

Please sign in to comment.