diff --git a/.config/systemd/user/squeekboard.service b/.config/systemd/user/squeekboard.service new file mode 100644 index 0000000..6940ff1 --- /dev/null +++ b/.config/systemd/user/squeekboard.service @@ -0,0 +1,16 @@ +[Unit] +Description=Squeekboard on-screen keyboard +PartOf=graphical-session.target +After=graphical-session.target +Requisite=graphical-session.target + +[Service] +Environment=DISPLAY=:0 +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +Type=simple +ExecStart=/usr/bin/squeekboard +Restart=on-failure +RestartSec=1 + +[Install] +WantedBy=graphical-session.target diff --git a/.local/bin/lisgd-niri.sh b/.local/bin/lisgd-niri.sh new file mode 100755 index 0000000..96b3bdc --- /dev/null +++ b/.local/bin/lisgd-niri.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +DEVICE=/dev/input/by-path/pci-0000:00:15.0-platform-i2c_designware.0-event +ORIENTATION=${ORIENTATION:-normal} + + +echo "Starting lisgd with orientation: $ORIENTATION" >> /tmp/lisgd.log + + +if [[ $ORIENTATION == "normal" ]]; then + niri msg output eDP-1 transform normal +elif [[ $ORIENTATION == "270" ]]; then + niri msg output eDP-1 transform 270 +elif [[ $ORIENTATION == "inverted" ]]; then + niri msg output eDP-1 transform inverted +elif [[ $ORIENTATION == "90" ]]; then + niri msg output eDP-1 transform 90 +else + echo "Unknown orientation: $ORIENTATION" >> /tmp/lisgd.log +fi + +stop_lisgd() { + pkill -f "lisgd -d $DEVICE" 2>/dev/null +} + +start_lisgd() { + echo "Starting lisgd for device: $DEVICE" >> /tmp/lisgd.log + stop_lisgd + sleep 0.1 + lisgd -d "$DEVICE" -t 10 -T 5 \ + -g "4,DU,*,*,niri msg action open-overview" \ + -g "1,DU,B,*,niri msg action open-overview" \ + -g "3,LR,*,*,niri msg action focus-column-left" \ + -g "3,RL,*,*,niri msg action focus-column-right" \ + -g "3,DU,*,*,niri msg action focus-workspace-up" \ + -g "3,UD,*,*,niri msg action focus-workspace-down" \ + & + + LISGD_PID=$! + + echo "Started lisgd with PID: $LISGD_PID" >> /tmp/lisgd.log +} + +cleanup() { + stop_lisgd + exit 0 +} + +trap cleanup SIGINT SIGTERM + + +start_lisgd \ No newline at end of file diff --git a/.local/bin/osk-toggle.sh b/.local/bin/osk-toggle.sh new file mode 100755 index 0000000..93623e3 --- /dev/null +++ b/.local/bin/osk-toggle.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +current=$(gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled) +if [ "$current" = "true" ]; then + gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false +else + gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true +fi \ No newline at end of file diff --git a/.local/bin/rot8 b/.local/bin/rot8 new file mode 100755 index 0000000..869874f Binary files /dev/null and b/.local/bin/rot8 differ diff --git a/.local/bin/tablet-mode.sh b/.local/bin/tablet-mode.sh new file mode 100755 index 0000000..a4dcf16 --- /dev/null +++ b/.local/bin/tablet-mode.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +ARG=$1 +PATH=$PATH:~/.local/bin + +if [[ $ARG == "on" ]]; then + rot8 --display eDP-1 --hooks /home/ficik/.local/bin/lisgd-niri.sh +else + pkill rot8 + niri msg output eDP-1 transform normal + /home/ficik/.local/bin/lisgd-niri.sh +fi \ No newline at end of file