change location of scripts to add to repo

This commit is contained in:
matt1432 2023-05-28 19:54:01 -04:00
parent d136851de4
commit a1f485d6e5
7 changed files with 108 additions and 3 deletions

View file

@ -0,0 +1,63 @@
#!/bin/bash
# This script handles rotation of the screen and related input devices automatically
# using the output of the monitor-sensor command (part of the iio-sensor-proxy package)
# for sway.
# The target screen and input device names should be configured in the below variables.
# Note: input devices using the libinput driver (e.g. touchscreens) should be included
# in the WAYLANDINPUT array.
#
# You can get a list of input devices with the `swaymsg -t output` command.
#
# This script was forked from https://gitlab.com/snippets/1793649 by Fishonadish
SCREEN="eDP-1"
WAYLANDINPUT=("1386:21227:Wacom_HID_52EB_Finger"
"1386:21227:Wacom_HID_52EB_Pen")
function rotate_ms {
case $1 in
"normal")
rotate 0
/home/matt/.config/lisgd/config &
;;
"right-up")
rotate 90
/home/matt/.config/lisgd/config &
;;
"bottom-up")
rotate 180
/home/matt/.config/lisgd/config &
;;
"left-up")
rotate 270
/home/matt/.config/lisgd/config &
;;
esac
}
function rotate {
swww img $HOME/Pictures/BG/black.jpg
sleep 0.1
TARGET_ORIENTATION=$1
echo "Rotating to" $TARGET_ORIENTATION
swaymsg output $SCREEN transform $TARGET_ORIENTATION
swww img $HOME/Pictures/BG/bonzai.jpg
for i in "${WAYLANDINPUT[@]}"
do
swaymsg input "$i" map_to_output "$SCREEN"
done
}
while IFS='$\n' read -r line; do
rotation="$(echo $line | sed -En "s/^.*orientation changed: (.*)/\1/p")"
[[ ! -z $rotation ]] && rotate_ms $rotation
done < <(stdbuf -oL monitor-sensor)

View file

@ -0,0 +1,10 @@
#!/bin/bash
/usr/bin/setsysmode laptop
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false
brightnessctl -d tpacpi::kbd_backlight s 2
killall autorotate.sh
swaymsg output eDP-1 transform 0
$HOME/.config/lisgd/config

View 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

View file

@ -0,0 +1,8 @@
#!/bin/bash
setsysmode tablet
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
brightnessctl -d tpacpi::kbd_backlight s 0
$HOME/.config/sway/scripts/tablet/autorotate.sh

View 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

View file

@ -82,19 +82,19 @@
},
"custom/osk": {
"format":" 󰌌 ",
"on-click": "$HOME/.scripts/osk-toggle.sh",
"on-click": "$HOME/.config/sway/scripts/tablet/osk-toggle.sh",
"restart-interval": 1,
},
"custom/quicksettings": {
"format":"  ",
"on-click": "$HOME/.scripts/quick-toggle.sh",
"on-click": "$HOME/.config/waybar/scripts/quick-toggle.sh",
"restart-interval": 1,
},
"custom/tablet": {
"format":" 󰦧 ",
"on-click": "$HOME/.scripts/tablet-toggle.sh",
"on-click": "$HOME/.config/sway/scripts/tablet/tablet-toggle.sh",
"restart-interval": 1,
},

7
waybar/scripts/quick-toggle.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
if [[ $(eww state | grep br_icon) ]]; then
eww close actions && eww close actions-closer
else
eww open actions && eww open actions-closer
fi