INIT - add script, bin & README
This commit is contained in:
@@ -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
|
||||||
Executable
BIN
Binary file not shown.
Executable
+19
@@ -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)
|
||||||
Reference in New Issue
Block a user