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 'GL' | sed 's/.*GL //') if [ "$new_data" ]; then diff --git a/sync-all-repos b/sync-all-repos index 881f624..5772a27 100755 --- a/sync-all-repos +++ b/sync-all-repos @@ -1,9 +1,9 @@ #!/bin/sh -onlystatic="" +onlystatic="yes" if [ $# -ge 1 ]; then - onlystatic=yes + onlystatic="" fi set -e diff --git a/until-event b/until-event index 960888e..05171c0 100755 --- a/until-event +++ b/until-event @@ -25,6 +25,8 @@ arrival="2019-08-21"; event="Master Thesis" arrival="2019-09-26"; event="Flying back from Korea" arrival="2019-12-31"; event="1387.24 instances" arrival="2020-08-01"; event="83kg" +arrival="2022-03-31"; event="79kg" +arrival="2022-05-25"; event="79kg" export arrival event diff --git a/vpn.sh b/vpn.sh new file mode 100755 index 0000000..2c6e670 --- /dev/null +++ b/vpn.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# 2022-02-10, 10:25, Nico Schottelius + +set -e + +case "$1" in + lf) + sudo openconnect --protocol=gp portal.techcorpapps.com --user nschottelius + ;; + lx) + cd ~/Nextcloud/luxembourg/nico/ + sudo openvpn --config nico.ovpn + ;; + *) + echo "$0 lf lx" + ;; +esac diff --git a/x-left-right b/x-left-right new file mode 100755 index 0000000..a44a4df --- /dev/null +++ b/x-left-right @@ -0,0 +1,4 @@ +#!/bin/sh + +xrandr --output DP3 --auto --left-of eDP1 +xrandr --output DP2 --auto --right-of eDP1