feat\!: switch to Hyprland. Touchscreen gestures not implemented properly
This commit is contained in:
parent
1d43d899ee
commit
ce51ddb46e
29 changed files with 558 additions and 567 deletions
33
hypr/scripts/gestures.sh
Executable file
33
hypr/scripts/gestures.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
SIDE="$1"
|
||||
TOUCH="$2"
|
||||
workspaces=($(hyprctl workspaces -j | jq '.[] | .id'))
|
||||
current_workspace=$(hyprctl monitors -j | jq '.[0].activeWorkspace.id')
|
||||
|
||||
echo $current_workspace
|
||||
if [[ ${workspaces[-1]} == ${workspaces[0]} ]]; then
|
||||
if [[ $current_workspace == "1" ]]; then
|
||||
hyprctl dispatch workspace 2
|
||||
|
||||
elif [[ $SIDE == "prev" ]]; then
|
||||
hyprctl dispatch workspace $[${workspaces[0]} - 1]
|
||||
|
||||
elif [[ $SIDE == "next" ]]; then
|
||||
hyprctl dispatch workspace $[${workspaces[0]} + 1]
|
||||
fi
|
||||
|
||||
elif [[ $SIDE == "prev" ]]; then
|
||||
if [[ $current_workspace == "1" ]]; then
|
||||
hyprctl dispatch workspace ${workspaces[-1]}
|
||||
else
|
||||
hyprctl dispatch workspace $[$current_workspace - 1]
|
||||
fi
|
||||
|
||||
elif [[ $SIDE == "next" ]]; then
|
||||
hyprctl dispatch workspace $[$current_workspace + 1]
|
||||
fi
|
||||
|
||||
if [[ $TOUCH == "touch" ]]; then
|
||||
sleep 0.2
|
||||
sudo input-emulator touch tap 1280 720
|
||||
fi
|
16
hypr/scripts/lose-focus.sh
Executable file
16
hypr/scripts/lose-focus.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
while true
|
||||
do
|
||||
while killall -0 blueman-manager
|
||||
do
|
||||
if [[ $(bluetoothctl show | grep Powered | grep yes) ]]; then
|
||||
if [[ $(hyprctl activewindow | grep blueman-manager) == "" && $(hyprctl clients | grep blueman-manager) != "" ]]; then
|
||||
killall blueman-manager
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
fi
|
||||
done
|
||||
sleep 0.1
|
||||
done
|
27
hypr/scripts/tablet/autorotate.sh
Executable file
27
hypr/scripts/tablet/autorotate.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
execute() {
|
||||
swww img $HOME/Pictures/BG/black.jpg
|
||||
sleep 0.1
|
||||
|
||||
echo "Rotating"
|
||||
|
||||
swww img $HOME/Pictures/BG/bonzai.jpg
|
||||
/home/matt/.config/lisgd/config &
|
||||
lisgd_pid=$! # Save the PID of the lisgd process
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
echo "Cleaning up..."
|
||||
kill $lisgd_pid # Terminate the lisgd process
|
||||
wait $lisgd_pid # Wait for the process to exit
|
||||
}
|
||||
|
||||
# Register the cleanup function to be called on script exit
|
||||
trap cleanup EXIT
|
||||
|
||||
# Loop to listen to the command
|
||||
while IFS='$\n' read -r line; do
|
||||
rotation="$(echo $line | sed -En "s/^.*orientation changed: (.*)/\1/p")"
|
||||
[[ ! -z $rotation ]] && execute
|
||||
done < <(stdbuf -oL monitor-sensor)
|
12
hypr/scripts/tablet/laptop-mode.sh
Executable file
12
hypr/scripts/tablet/laptop-mode.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
eww update toggle-state=false
|
||||
/usr/bin/setsysmode laptop
|
||||
|
||||
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false
|
||||
|
||||
brightnessctl -d tpacpi::kbd_backlight s 2
|
||||
|
||||
killall iio-hyprland
|
||||
#swaymsg output eDP-1 transform 0
|
||||
$HOME/.config/lisgd/config
|
||||
killall autorotate.sh
|
10
hypr/scripts/tablet/osk-toggle.sh
Executable file
10
hypr/scripts/tablet/osk-toggle.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $(busctl get-property --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible) == "b true" ]]
|
||||
then
|
||||
echo "Running"
|
||||
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
||||
else
|
||||
echo "Stopped"
|
||||
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
||||
fi
|
13
hypr/scripts/tablet/tablet-mode.sh
Executable file
13
hypr/scripts/tablet/tablet-mode.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
eww update toggle-state=true
|
||||
setsysmode tablet
|
||||
|
||||
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
|
||||
|
||||
brightnessctl -d tpacpi::kbd_backlight s 0
|
||||
|
||||
iio-hyprland &
|
||||
|
||||
$HOME/.config/hypr/scripts/tablet/autorotate.sh &
|
||||
killall autorotate.sh
|
||||
$HOME/.config/hypr/scripts/tablet/autorotate.sh &
|
7
hypr/scripts/tablet/tablet-toggle.sh
Executable file
7
hypr/scripts/tablet/tablet-toggle.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $(gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled) == true ]]; then
|
||||
$HOME/.config/sway/scripts/tablet/laptop-mode.sh
|
||||
else
|
||||
$HOME/.config/sway/scripts/tablet/tablet-mode.sh
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue