parent
1c8efb9950
commit
6a432b305b
4 changed files with 37 additions and 44 deletions
@ -1,31 +1,31 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
applyptrmatrix() { |
||||
PTRID="$( |
||||
xinput | grep -iE 'touchscreen.+pointer' | grep -oE 'id=[0-9]+' | cut -d= -f2 |
||||
)" |
||||
xinput set-prop "$PTRID" --type=float --type=float "Coordinate Transformation Matrix" "$@" |
||||
PTRID="$( |
||||
xinput | grep -iE 'touchscreen.+pointer' | grep -oE 'id=[0-9]+' | cut -d= -f2 |
||||
)" |
||||
xinput set-prop "$PTRID" --type=float --type=float "Coordinate Transformation Matrix" "$@" |
||||
} |
||||
|
||||
isrotated() { |
||||
xrandr | grep primary | cut -d' ' -f 5 | grep right && return 0 |
||||
return 1 |
||||
xrandr | grep primary | cut -d' ' -f 5 | grep right && return 0 |
||||
return 1 |
||||
} |
||||
|
||||
rotnormal() { |
||||
xrandr -o normal |
||||
applyptrmatrix 0 0 0 0 0 0 0 0 0 |
||||
exit 0 |
||||
xrandr -o normal |
||||
applyptrmatrix 0 0 0 0 0 0 0 0 0 |
||||
exit 0 |
||||
} |
||||
|
||||
rotright() { |
||||
xrandr -o right |
||||
applyptrmatrix 0 1 0 -1 0 1 0 0 1 |
||||
exit 0 |
||||
xrandr -o right |
||||
applyptrmatrix 0 1 0 -1 0 1 0 0 1 |
||||
exit 0 |
||||
} |
||||
|
||||
rotate() { |
||||
isrotated && rotnormal || rotright |
||||
if isrotated; then rotnormal; else rotright; fi |
||||
} |
||||
|
||||
rotate |
||||
|
@ -1,26 +1,26 @@ |
||||
#!/usr/bin/env sh |
||||
notify() { |
||||
VOL="$( |
||||
amixer get "$(sxmo_audiocurrentdevice.sh)" | |
||||
grep -oE '([0-9]+)%' | |
||||
tr -d ' %' | |
||||
awk '{ s += $1; c++ } END { print s/c }' | |
||||
xargs printf %.0f |
||||
)" |
||||
dunstify -i 0 -u normal -r 998 "♫ $VOL" |
||||
echo 1 > /tmp/sxmo_bar |
||||
VOL="$( |
||||
amixer get "$(sxmo_audiocurrentdevice.sh)" | |
||||
grep -oE '([0-9]+)%' | |
||||
tr -d ' %' | |
||||
awk '{ s += $1; c++ } END { print s/c }' | |
||||
xargs printf %.0f |
||||
)" |
||||
dunstify -i 0 -u normal -r 998 "♫ $VOL" |
||||
echo 1 > /tmp/sxmo_bar |
||||
} |
||||
|
||||
up() { |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" 1+ |
||||
notify |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" 1+ |
||||
notify |
||||
} |
||||
down() { |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" 1- |
||||
notify |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" 1- |
||||
notify |
||||
} |
||||
setvol() { |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" $1 |
||||
amixer set "$(sxmo_audiocurrentdevice.sh)" "$1" |
||||
} |
||||
|
||||
$@ |
||||
$1 |
||||
|
Loading…
Reference in new issue