INIT - add script, bin & README

This commit is contained in:
Prof Isen 2023-12-28 16:37:26 +01:00
commit 6fc70141fc
3 changed files with 22 additions and 0 deletions

3
README Normal file
View File

@ -0,0 +1,3 @@
# Install
[[ -z $(cat ~/bin/dwm-scripts/autostart.sh | grep monitor-rotate) ]] && echo "$(realpath monitor-rotate) &" | tee -a /home/guillaume/bin/dwm-scripts/autostart.sh

BIN
autorotate Executable file

Binary file not shown.

19
monitor-rotate Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#
export DISPLAY=:0
Bin=$(dirname $0)/autorotate
while IFS= read -r line
do
if [[ ! -z $(echo $line | grep changed | grep -E "normal|right-up|left-up|bottom-up") ]]
then
tOrientation=$(echo $line | awk '{print $NF}')
case $tOrientation in
normal) ${Bin} normal --display eDP-1;;
right-up) ${Bin} right --display eDP-1;;
left-up) ${Bin} left --display eDP-1;;
bottom-up) ${Bin} invert --display eDP-1;;
esac
fi
done < <(monitor-sensor)