dotfiles/actuator/uzui/set_win_mode

32 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-10-06 01:15:38 -04:00
#!/bin/bash
WINDOW_MODE=$(cat "${XDG_CACHE_HOME}/window_mode")
if [ "$1" == "portrait" ] && [ "${WINDOW_MODE}" != "portrait" ]; then
echo "portrait" > "${XDG_CACHE_HOME}"/window_mode
rotate-screen eDP-1 left;
xinput set-prop 9 --type=float "Coordinate Transformation Matrix" 0 -1 0 1 0 0 0 0 1
xinput set-prop 10 --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
2023-10-06 01:41:47 -04:00
xinput set-prop 17 --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
2023-10-06 01:15:38 -04:00
pkill actuator;
actuator "${XDG_CONFIG_HOME}/actuator/uzui/portrait.toml" &
elif [ "$1" == "landscape" ] && [ "${WINDOW_MODE}" != "landscape" ]; then
echo "landscape" > "${XDG_CACHE_HOME}"/window_mode
rotate-screen eDP-1 normal;
xinput set-prop 9 --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
xinput set-prop 10 --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
2023-10-06 01:41:47 -04:00
xinput set-prop 17 --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
2023-10-06 01:15:38 -04:00
pkill actuator;
actuator "${XDG_CONFIG_HOME}/actuator/uzui/landscape.toml" &
elif [ "$1" == "tablet" ] && [ "${WINDOW_MODE}" != "tablet" ]; then
echo "tablet" > "${XDG_CACHE_HOME}"/window_mode
rotate-screen eDP-1 inverted;
xinput set-prop 9 --type=float "Coordinate Transformation Matrix" -1 0 0 0 -1 0 0 0 1
xinput set-prop 10 --type=float "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1
2023-10-06 01:41:47 -04:00
xinput set-prop 17 --type=float "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1
2023-10-06 01:15:38 -04:00
pkill actuator;
actuator "${XDG_CONFIG_HOME}/actuator/uzui/tablet.toml" &
fi