mirror of
https://github.com/Dejvino/pinephone-sway-poc.git
synced 2024-12-22 02:28:49 +00:00
Added pinephone-toolkit build. Extracted script for power sleep and wake.
This commit is contained in:
parent
10fccd77a1
commit
ad71068a6a
7
Makefile
7
Makefile
@ -28,7 +28,7 @@ install_user_htop:
|
||||
###
|
||||
# INSTALL - SYSTEM
|
||||
###
|
||||
install_system: install_system_check install_system_lightdm install_system_bin
|
||||
install_system: install_system_check install_system_lightdm install_system_bin install_pptk
|
||||
|
||||
install_system_check:
|
||||
@echo "Note: install needs to be run as root."
|
||||
@ -40,6 +40,11 @@ install_system_bin:
|
||||
chmod go+rx usr/local/bin/*
|
||||
cp usr/local/bin/* /usr/local/bin/
|
||||
|
||||
install_pptk:
|
||||
cd pinephone-toolkit && meson build
|
||||
ninja -C pinephone-toolkit/build
|
||||
ninja -C pinephone-toolkit/build install
|
||||
|
||||
###
|
||||
# FETCH
|
||||
###
|
||||
|
@ -201,11 +201,11 @@ bindsym $mod+r mode "resize"
|
||||
#
|
||||
# Power Button
|
||||
#
|
||||
set $pplock 'swayphone_power_sleep'
|
||||
set $ppunlock 'swayphone_power_wakeup'
|
||||
set $lockapp swaylock
|
||||
set $lock '$lockapp -f -c 000000'
|
||||
set $unlock 'killall $lockapp'
|
||||
set $pplock 'pptk-led set red 1; pptk-cpu-sleep enable; pptk-backlight get > ~/.backlight ; pptk-backlight set 0'
|
||||
set $ppunlock 'pptk-led set red 0; pptk-cpu-sleep disable; pptk-backlight set `cat ~/.backlight`'
|
||||
## wish this worked...
|
||||
#bindsym XF86PowerOff exec $lock
|
||||
#bindsym --locked XF86PowerOff exec $unlock
|
||||
@ -213,8 +213,18 @@ set $ppunlock 'pptk-led set red 0; pptk-cpu-sleep disable; pptk-backlight set `c
|
||||
bindcode 124 exec $lock; exec $pplock
|
||||
bindcode --locked 124 exec $unlock; exec $ppunlock
|
||||
|
||||
exec swayidle -w \
|
||||
timeout 15 'swaymsg exec $lock; $pplock' \
|
||||
resume 'swaymsg exec $unlock; $ppunlock' \
|
||||
before-sleep 'swaymsg exec $lock; $pplock'
|
||||
|
||||
# Scale the touchscreen LCD 2x
|
||||
output DSI-1 scale 2
|
||||
#output DSI-1 scale 2
|
||||
|
||||
# Bind input and output for correct rotation support
|
||||
input 1046:4097:Goodix_Capacitive_TouchScreen map_to_output DSI-1
|
||||
#output DSI-1 transform 90
|
||||
output DSI-1 transform 0
|
||||
|
||||
# Keyboard
|
||||
exec squeekboard
|
||||
@ -243,5 +253,5 @@ exec "waybar -c ~/.config/waybar/config_0 -b b0"
|
||||
exec "waybar -c ~/.config/waybar/config_1 -b b1"
|
||||
|
||||
# Restore backlight
|
||||
exec "cat ~/.backlight && pptk-backlight set `cat ~/.backlight`"
|
||||
exec 'swayphone_power_wakeup'
|
||||
|
||||
|
@ -103,10 +103,18 @@
|
||||
"sway/workspaces": {
|
||||
"all-outputs": false,
|
||||
"disable-scroll": true,
|
||||
"persistent_workspaces": {
|
||||
"1": [],
|
||||
"2:T": [],
|
||||
"3:F": [],
|
||||
"8:M": [],
|
||||
"9:K": []
|
||||
},
|
||||
"format": "{name}",
|
||||
"format-icons": {
|
||||
"1:www": "龜", // Icon: firefox-browser
|
||||
"2:mail": "", // Icon: mail
|
||||
"1:T": "", // Icon: terminal
|
||||
"2:F": "龜", // Icon: firefox-browser
|
||||
"8:M": "", // Icon: mail
|
||||
"3:editor": "", // Icon: code
|
||||
"4:terminals": "", // Icon: terminal
|
||||
"5:portal": "", // Icon: terminal
|
||||
|
2
home/config/waybar/style.css
Normal file → Executable file
2
home/config/waybar/style.css
Normal file → Executable file
@ -12,7 +12,7 @@
|
||||
background: #282828;
|
||||
color: white;
|
||||
font-family: "awesome 5";
|
||||
font-size: 10px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
BACKLIGHT=~/.backlight
|
||||
|
||||
dialog --menu EXECUTE 20 40 10 \
|
||||
dialog --menu Backlight 0 0 10 \
|
||||
10 FULL \
|
||||
9 . \
|
||||
8 . \
|
||||
|
10
usr/local/bin/swayphone_power_sleep
Executable file
10
usr/local/bin/swayphone_power_sleep
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
pptk-led set red 1
|
||||
pptk-cpu-sleep enable
|
||||
|
||||
# save current backlight for wakeup
|
||||
pptk-backlight get > ~/.backlight
|
||||
# shut down backlight
|
||||
pptk-backlight set 0
|
||||
|
12
usr/local/bin/swayphone_power_wakeup
Executable file
12
usr/local/bin/swayphone_power_wakeup
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
BACKLIGHT_FILE=~/.backlight
|
||||
BACKLIGHT_MIN=3
|
||||
|
||||
pptk-led set red 0
|
||||
pptk-cpu-sleep disable
|
||||
|
||||
# restore last saved backlight level
|
||||
BACKLIGHT=$((`cat $BACKLIGHT_FILE` >= $BACKLIGHT_MIN ? `cat $BACKLIGHT_FILE` : $BACKLIGHT_MIN))
|
||||
pptk-backlight set $BACKLIGHT
|
||||
|
Loading…
Reference in New Issue
Block a user