Browse Source

Added pinephone-toolkit build. Extracted script for power sleep and wake.

pull/1/head
Dejvino 3 years ago
parent
commit
ad71068a6a
7 changed files with 54 additions and 9 deletions
  1. +6
    -1
      Makefile
  2. +14
    -4
      home/config/sway/config
  3. +10
    -2
      home/config/waybar/config_0
  4. +1
    -1
      home/config/waybar/style.css
  5. +1
    -1
      usr/local/bin/swayphone_backlightselect
  6. +10
    -0
      usr/local/bin/swayphone_power_sleep
  7. +12
    -0
      usr/local/bin/swayphone_power_wakeup

+ 6
- 1
Makefile View File

@@ -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
###


+ 14
- 4
home/config/sway/config View File

@@ -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'


+ 10
- 2
home/config/waybar/config_0 View File

@@ -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


+ 1
- 1
home/config/waybar/style.css View File

@@ -12,7 +12,7 @@
background: #282828;
color: white;
font-family: "awesome 5";
font-size: 10px;
font-size: 24px;
font-weight: bold;
}



+ 1
- 1
usr/local/bin/swayphone_backlightselect View File

@@ -2,7 +2,7 @@

BACKLIGHT=~/.backlight

dialog --menu EXECUTE 20 40 10 \
dialog --menu Backlight 0 0 10 \
10 FULL \
9 . \
8 . \


+ 10
- 0
usr/local/bin/swayphone_power_sleep View 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
- 0
usr/local/bin/swayphone_power_wakeup View 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…
Cancel
Save