1
0
mirror of https://github.com/Dejvino/pinephone-sway-poc.git synced 2024-11-21 13:32:35 +00:00

Add lisgd and rot8 support

This commit is contained in:
Dejvino 2020-06-06 22:07:20 +02:00
parent ad71068a6a
commit b7521eca62
7 changed files with 77 additions and 8 deletions

7
.gitmodules vendored
View File

@ -1,3 +1,10 @@
[submodule "pinephone-toolkit"]
path = pinephone-toolkit
url = https://github.com/Dejvino/pinephone-toolkit
[submodule "rot8"]
path = rot8
url = https://github.com/Dejvino/rot8.git
branch = accelerometer_param
[submodule "lisgd"]
path = lisgd
url = https://git.sr.ht/~mil/lisgd

View File

@ -28,7 +28,7 @@ install_user_htop:
###
# INSTALL - SYSTEM
###
install_system: install_system_check install_system_lightdm install_system_bin install_pptk
install_system: install_system_check install_system_lightdm install_system_bin install_pptk install_rot8 install_lisgd
install_system_check:
@echo "Note: install needs to be run as root."
@ -45,6 +45,16 @@ install_pptk:
ninja -C pinephone-toolkit/build
ninja -C pinephone-toolkit/build install
install_rot8:
cd rot8 && cargo build --release
cp rot8/target/release/rot8 /usr/local/bin/
install_lisgd:
cd lisgd && git fetch origin && git reset --hard origin/master
cd lisgd && git apply ../patches/lisgd.patch
cd lisgd && make
cp lisgd/lisgd /usr/local/bin/
###
# FETCH
###

View File

@ -111,27 +111,33 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Workspaces:
#
set $W3 '3:F'
set $W9 '9:K'
for_window [app_id="firefox"] move workspace $W3; workspace $W3; border none
for_window [app_id="keepassxc"] move workspace $W9; workspace $W9; border none
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+3 workspace $W3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+9 workspace $W9
bindsym $mod+0 workspace 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+3 move container to workspace $W3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+9 move container to workspace $W9
bindsym $mod+Shift+0 move container to workspace 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
@ -218,14 +224,17 @@ exec swayidle -w \
resume 'swaymsg exec $unlock; $ppunlock' \
before-sleep 'swaymsg exec $lock; $pplock'
# Scale the touchscreen LCD 2x
#output DSI-1 scale 2
# Scale the touchscreen LCD UI
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
# Display rotation daemon
exec 'rot8 --display DSI-1 --threshold 0.97 --x-file /sys/bus/iio/devices/iio:device2/in_accel_y_raw --y-file /sys/bus/iio/devices/iio:device2/in_accel_x_raw --y-invert'
# Keyboard
exec squeekboard
@ -239,6 +248,8 @@ exec lisgd \
-g "2,r,l, swaymsg workspace next" \
-g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
-g "2,d,u, swaymsg exec swayphone_keyboard_show" \
-g "2,l,u, swaymsg fullscreen" \
-g "2,r,d, swaymsg kill" \
-g "3,l,r, swaymsg focus right" \
-g "3,r,l, swaymsg focus left" \
-g "3,u,d, swaymsg focus down" \

View File

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

1
lisgd Submodule

@ -0,0 +1 @@
Subproject commit 877beea2738df5f3a99da3f4e2ab5442b92baa80

39
patches/lisgd.patch Normal file
View File

@ -0,0 +1,39 @@
diff --git a/lisgd.c b/lisgd.c
index 9d3442b..78f6a3c 100644
--- a/lisgd.c
+++ b/lisgd.c
@@ -109,19 +109,21 @@ touchup(struct libinput_event *e)
);
}
- if (xend[slot] > xstart[slot] && fabs(xend[slot] - xstart[slot]) > threshold) {
- start = Left;
- end = Right;
- } else if (xend[slot] < xstart[slot] && fabs(xend[slot] - xstart[slot]) > threshold) {
- start = Right;
- end = Left;
- } else if (yend[slot] > ystart[slot] && fabs(yend[slot] - ystart[slot]) > threshold) {
- start = Up;
- end = Down;
- } else if (yend[slot] < ystart[slot] && fabs(yend[slot] - ystart[slot]) > threshold) {
- start = Down;
- end = Up;
- } else {
+ int move_x = fabs(xend[slot] - xstart[slot]) > threshold
+ ? (xend[slot] > xstart[slot] ? 1 : -1) : 0;
+ int move_y = fabs(yend[slot] - ystart[slot]) > threshold
+ ? (yend[slot] > ystart[slot] ? 1 : -1) : 0;
+ switch (move_x * 100 + move_y) {
+ case -100 -1: start = Right; end = Up; break;
+ case -100 +0: start = Right; end = Left; break;
+ case -100 +1: start = Right; end = Down; break;
+ case +0 -1: start = Down; end = Up; break;
+ case +0 +1: start = Up; end = Down; break;
+ case +100 -1: start = Left; end = Up; break;
+ case +100 +0: start = Left; end = Right; break;
+ case +100 +1: start = Left; end = Down; break;
+ case +0 +0:
+ default:
if (verbose) {
fprintf(stderr, "Input didn't match a known gesture\n");
}

1
rot8 Submodule

@ -0,0 +1 @@
Subproject commit 8f2128c172be8ecc3e76e0801534413b301ccbd2