diff --git a/i3left b/i3left new file mode 100755 index 0000000..bc86b83 --- /dev/null +++ b/i3left @@ -0,0 +1,3 @@ +#!/bin/sh + +i3 move workspace to output left diff --git a/i3right b/i3right new file mode 100755 index 0000000..2f5dbd4 --- /dev/null +++ b/i3right @@ -0,0 +1,3 @@ +#!/bin/sh + +i3 move workspace to output right diff --git a/rotate-by-sensor.sh b/rotate-by-sensor.sh new file mode 100755 index 0000000..adfa208 --- /dev/null +++ b/rotate-by-sensor.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# 2022-02-22, Nico Schottelius +# Inspired by https://gist.github.com/Links2004/5976ce97a14dabf773c3ff98d03c0f61 + +output=$(xrandr | awk '/connected primary/ { print $1 }') +input=$(xinput --list | grep -e "Pen Pen" | sed 's/.*id=\([0-9]*\).*/\1/') + +monitor-sensor | ( + while true; do + read line + ORIENTATION=$(echo $line | awk -F: '/Accelerometer orientation changed:/ { print $2 } ' | sed 's/ *//') + + # Check if we are matching on a correct line, if not, skip + if [ -z "$ORIENTATION" ]; then + continue + fi + + echo $ORIENTATION + + case "$ORIENTATION" in + normal) + rotate="normal" + matrix="1 0 0 0 1 0 0 0 1" + ;; + bottom-up) + rotate="inverted" + matrix="-1 0 1 0 -1 1 0 0 1" + ;; + right-up) + rotate="right" + matrix="0 1 0 -1 0 1 0 0 1" + ;; + left-up) + rotate="left" + matrix="0 -1 1 1 0 0 0 0 1" + ;; + esac + +# set -x + xrandr --output ${output} --rotate ${rotate} + xinput set-prop ${input} 'Coordinate Transformation Matrix' ${matrix} +# set +x + done +) diff --git a/screen-always-on b/screen-always-on new file mode 100755 index 0000000..43ab036 --- /dev/null +++ b/screen-always-on @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -ge 1 ]; then + xset +dpms + xautolock -enable +else + xset -dpms + xautolock-disable +fi diff --git a/start-post-i3 b/start-post-i3 index 865c78d..dbfba06 100755 --- a/start-post-i3 +++ b/start-post-i3 @@ -27,3 +27,6 @@ fi # Dell XPS 13" 2-in-1 xinput map-to-output "WCOM48EC:00 056A:48EC Touchscreen" eDP-1 + +# Pipewire sound +pipewire & diff --git a/stva.sh b/stva.sh index 006c4bd..929a174 100755 --- a/stva.sh +++ b/stva.sh @@ -9,7 +9,7 @@ newfile=~/.stva-new oldfile=~/.stva-cur while [ "$new_data" ]; do - new_data=$(curl -Ls https://e-schild.stva.gl.ch/?page=${i} | \ + new_data=$(curl -Ls "https://e-schild.stva.gl.ch/?page=${i}&category=1" | \ grep '